Workflow execution
There are two methods to execute a workflow:
- Initiate a pre-existing workflow definition and supply specific parameters.
- Specify the complete list of tasks to be executed.
Execute a workflow based on a workflow definition
Execute a workflow based on a list of tasks
API reference: Create workflow execution
To execute a workflow, send a request to the POST /workflow-executions
route. The workflow execution input, which consists of a list of tasks, must be defined in JSON format.
Below is a template for the input parameters of a workflow execution:
{
"tasks": [
{
// Task 1
},
{
// Task 2
}
]
}
Each task includes a set of attributes:
- Label: The name of the task, which must be unique in the list and contain only alphabetic characters.
- Type: Specifies the task to be executed. Choose one from the list of available tasks.
- Params: The parameter format varies depending on the selected task type. Refer to the API Reference for available parameters by task.
- Needs: An array containing the labels of tasks that must be completed before this task can start.
{
"label": "myLabel",
"type": "myType",
"params": {
"inputUri": "${aPreviousTask.results.outputUri}",
},
"needs": ["aPreviousTask"]
}
Variables
Variables can be utilized in task parameters by employing the template ${taskLabel.results.taskParamKey}
. This allows for dynamic values to be inserted into the parameters, where taskLabel
represents the label of the task and taskParamKey
represents the specific key within that task results. The task results varies depending on the selected task type. Refer to the API Reference for available results by task.