Workflow engine is configured by zen. We do not support it and do not recommend to use it anymore. Please, use any other workflow engine e.g. Temporal .

Since the 2405 release, using Aidbox in FHIR schema validation engine is recommended, which is incompatible with zen or Entity/Attribute options.

Setup Aidbox with FHIR Schema validation engine

Task Executor API is designed to allow implement task executor in any programming language and use it in Aidbox via REST requests with RPC calls.

awf.task/poll

Fetches a task in the status ready from the queue and changes its status to requested.

Immediately returns an empty array if there are no tasks in the queue.

Either taskDefinitions or workflowDefinitions parameter SHOULD be specified.

Params:

ParameterTypeRequiredDescription
taskDefinitionsstring[]falseAn array of task definitions to include.
workflowDefinitionsstring[]falseAn array of workflow definitions to include. In response, decision tasks will be returned for specified workflow if available.
maxBatchSizeintegerfalseThe number of tasks that can be polled from the queue simultaneously.
Default value: 1

Result:

ParameterTypeDescription
resourcesobject[]AidboxTask resources with execId.
POST /rpc
content-type: text/yaml
accept: text/yaml

method: awf.task/poll
params:
    taskDefinitions: [aidbox.bulk/import-resource-task]

awf.task/long-poll

Fetches a task in the status ready from the queue and changes its status to requested.

Waits for a timeout unless a new task is received. In case of timeout, returns an empty array.

Either taskDefinitions or workflowDefinitions parameter SHOULD be specified.

Params:

ParameterTypeRequiredDescription
taskDefinitionsstring[]falseAn array of task definitions to include.
workflowDefinitionsstring[]falseAn array of workflow definitions to include. In response, decision tasks will be returned for specified workflow if available.
maxBatchSizeintegerfalseThe number of tasks that can be polled from the queue simultaneously.
Default value: 1
timeoutintegerfalseA period of time in ms, the period of time during which the tasks can be polled.
Default value: 60000 (equal to 1 minute)

Result:

ParameterTypeDescription
resourcesobject[]AidboxTask resources with execId.
POST /rpc
content-type: text/yaml
accept: text/yaml

method: awf.task/long-poll
params:
    timeout: 50000
    taskDefinitions: [aidbox.bulk/import-resource-task]

awf.task/start

Changes the status of a task from requested to in-progress and start its execution.

The required param of execId is supposed to be received from the requestawf.task/poll or awf.task/long-poll.

Params:

ParameterTypeRequiredDescription
idstringtrueIdentifier of the Task resource.
execIdstringtrueExecution id of the task. Used to avoid duplicate task executions.

Result:

ParameterTypeDescription
resourceobjectStarted AidboxTask resource.
POST /rpc
content-type: text/yaml
accept: text/yaml

method: awf.task/start
params:
    id: c578a224-c1fa-44c1-bc7a-9d2e624b872b
    execId: aac4c869-daa4-45fb-917a-46fe14359ed4

awf.task/notify

Notifies Task Service that a task is still alive.

After receiving notification, Task Service creates AidboxTaskLog resource with values of extra params fields below.

Notification Types:

Notification TypeDescription
heartbeatProlongs the inProgressTimeout property of the task and sends a string message.
progressProlongs the inProgressTimeout property of the task and sends information about its progress.

Params:

ParameterTypeRequiredDescription
idstringtrueIdentifier of the Task resource.
execIdstringtrueExecution id of the task. Used to avoid duplicate task executions.
notificationstringtrueThe type of notification depends on which extra parameters may be required.
Possible values: heartbeat, progress

Extra Params

Depending on the #notification-types, the following params are needed.

These parameters with notification type will be recorded in AidboxTaskLog resource after handling API request.

For heartbeat Notification Type :

ParameterTypeRequiredDescription
messagestringfalseA string message about any additional information.

For progress Notification Type :

ParameterTypeRequiredDescription
progress-currentintegertrueThe current value of progress in an integer
(The numerator of current / total).
progress-totalintegerfalseThe total value of progress in an integer
(The dominator of current / total).
progress-unitstringfalseThe unit for the values of progress-total and progress-current.
Example: rows

Result:

ParameterTypeDescription
inProgressTimeoutAtintegerThe renewed inProgressTimeout property of the task.
POST /rpc
content-type: text/yaml
accept: text/yaml

method: awf.task/notify
params:
    id: 3abf82be-ec63-4fb4-908a-21d91b2d4af9
    execId:   292e9f34-c275-4cd3-840f-b4c39d0512e4
    notification: awf.task/heartbeat
    message: "task is alive"

awf.task/success

Changes the status of a task from in-progress to done, setting the outcome to succeeded.

Params:

ParameterTypeRequiredDescription
idstringtrueIdentifier of the Task resource.
execIdstringtrueExecution id of the task. Used to avoid duplicate task executions.
resultobjectfalseResult with which task was succeeded.

Result:

ParameterTypeDescription
resourceobjectSucceeded AidboxTask resource.
POST /rpc
content-type: text/yaml
accept: text/yaml

method: awf.task/success
params:
    id: c578a224-c1fa-44c1-bc7a-9d2e624b872b
    execId: aac4c869-daa4-45fb-917a-46fe14359ed4

awf.task/fail

Changes the status of a task from in-progress to done, setting the outcome to failed.

Params:

ParameterTypeRequiredDescription
idstringtrueIdentifier of the Task resource.
execIdstringtrueExecution id of the task. Used to avoid duplicate task executions.
errorobjectfalseError with which task was failed.

Result:

ParameterTypeDescription
resourceobjectFailed AidboxTask resource.
POST /rpc
content-type: text/yaml
accept: text/yaml

method: awf.task/fail
params:
    id: 7572b48b-7196-4887-bab7-a78bf09bdd83
    execId: d9bdbaa7-35ee-4234-a603-990a6a5dd559