> For the complete documentation index, see [llms.txt](https://docs.extrahorizon.com/extrahorizon/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.extrahorizon.com/extrahorizon/services/automation/task-service.md).

# Task Service

Do you need some custom logic in your medical backend? Run custom code in a certified environment using the Task Service. The Task Service is well-integrated with the [Data Service](/extrahorizon/services/manage-data/data-service.md#intro) to automatically act upon changes in your database. It can as well be used to run standalone business logic asynchronously, synchronous or on a schedule.

Some common use cases where you can leverage the Task Service include:

* **Data Processing**\
  When a new device measurement comes in, a task can be triggered to asynchronously process the measurement data. This task can make third-party API calls to augment the measurement.
* **Data synchronization**\
  To synchronize data between Extra Horizon other systems, a task can be created. This task can run on a schedule or can be triggered by an event.
* **GDPR-compliant user management**\
  When a user is deleted from the system, a task can be triggered that uses the API of a third-party system to delete the user's data in that system as well.
* **Daily reporting**\
  Run a reporting task to aggregate data from the data service into a daily report.
* **Creating custom endpoints**\
  An API Function can be used to create custom endpoints, enabling an IoT Device to perform simple HTTP requests to push, process and synchronize data.

## Functions & Tasks

The task service has two logical entities: functions and tasks.

A **function** contains the business logic, the code that you want to execute.

{% content-ref url="/pages/tRIMZhUag92HfwlY16jQ" %}
[Functions](/extrahorizon/services/automation/task-service/functions.md)
{% endcontent-ref %}

A **task** is represents the execution of a function with a set of inputs.

{% content-ref url="/pages/Jf8I9XlVUAsReFXwHl3v" %}
[Tasks](/extrahorizon/services/automation/task-service/tasks.md)
{% endcontent-ref %}

### Functions and tasks

Functions and tasks are the two main concepts in this service.

A **function** is the single unit of code that can be executed within the executable piece of code that an executable

A **task** represents the execution of a specific function.

### 🔗 More Resources

{% embed url="<https://www.youtube.com/watch?v=ncOFiA5lrRE>" %}

## Resources & References

* [Task service changelog](https://docs.extrahorizon.com/extrahorizon/api-reference/changelog-chronological/changelog-service#tasks-service)
* [API Specifications](https://docs.extrahorizon.com/extrahorizon/api-reference/api-specs)

##
