Executor
Overview
Rill Flow employs the concept of executors to decouple task flow orchestration from the execution nodes. Each task
node is bound to dispatchers and executors through the resourceName
attribute. The dispatcher is responsible for delegating the actual execution process to the executor.Each task
node is bound to the dispatcher and the executor via the resourceName
attribute.The issuer is responsible for entrusting the specific execution of the task to the executor.
Executor Address
The sender will parse the executor address through resourceName
. Rill Flow assigns the task to the executor via the executor address. The executor is responsible for the specific task.Normally, the executor resourceName
that provides the HTTP interface is the executor address.
Example Python executor:
- When the executor is deployed using [docker-compose](../../getting-started/02-sample.md#parallel and asynchronous) the executor's
resourceName
and the executor addresses are:
Executor input and output
Input
Key | Value Type | Description |
---|---|---|
query_params_* | map | GET request parameters, keys with query_params_ prefix should be of map type, appended to the URL as key=value |
request_header_* | map | Request headers, keys with request_header_ prefix should be of map type, included in the request headers |
Other keys | string | POST request body parameters, currently only supports json type, other key/values will be included in the json structure of the post body |
Before calling the executor, the dispatcher of Rill Flow will prepare the call argument of the executor as defined in inputMappings attribute.Enter the parameter to map the function in context
.
Output
After execution by executor, output is json type (currently only json type is supported), Rill Flow is mapped through outputMappings attribute rules that map the executor results back to the context of the workflow for subsequent tasks.
For more information about context and mapping rules, see Context and Mapping.
Executor execution method
Task Attributes
Executor execution method can be specified by task attribute.
Parameter | Value | Description |
---|---|---|
Pattern | task_sync/task_async | Specifies the task execution mode, synchronous (task_sync ) or asynchronous (task_async ) |
Synchronize
For tasks that take time in milliseconds.
Asynchronous
For heavy computing tasks such as large models.When X-Mode
and X-Callback-Url
are present in the header and X-Mode=async
, the executor will enable asyncby default until the task is completed by calling
X-Callback-Url` to notify Rill Flow
that the task is complete.