Start Workflow
Start Workflow is an operator task used to start another workflow from an existing workflow. Unlike a sub-workflow task, a start workflow task doesn’t create a relationship between the current workflow and the newly started workflow. That means it doesn’t wait for the started workflow to get completed.
Definitions
{
"name": "start_workflow",
"taskReferenceName": "start_workflow_task_ref",
"inputParameters": {
"startWorkflow": {
"name": "name_of_the_workflow_to_be_started",
"version": 1
}
},
"type": "START_WORKFLOW"
}
A start workflow task is considered successful when the requested workflow begins or, more precisely, when the requested workflow is in the RUNNING state.
Input Parameters
Attribute | Description |
---|---|
startWorkflow | Provide the workflow name to be started. |
version | If the workflow has different versions, you can provide the version to be started here. If not specified, the latest version runs. |
Output Parameters
Attribute | Description |
---|---|
workflowId | Displays the ID of the started workflow. |
Examples
- UI
- JSON Example
- Add task type
Start Workflow Task
. - Select the workflow to start.
- Select version if required.
- Add the input params to the workflow.
{
"name": "start_workflow_task_example",
"taskReferenceName": "start_workflow_task_example_ref_1",
"inputParameters": {
"startWorkflow": {
"name": "wait-task-example",
"input": {
"inputToWorkflow": "${workflow.input.sampleInput}"
}
}
},
"type": "START_WORKFLOW"
}
Complete Example
Let’s see a sample JSON file for the start workflow task:
{
"name": "sample_start_workflow",
"description": "Sample Workflow to start a new workflow.",
"tasks": [
{
"name": "start",
"taskReferenceName": "start_ref",
"inputParameters": {
"startWorkflow": {
"name": "your_workflow_name_to_be_started",
"version": 3,
"input": {}
}
},
"type": "START_WORKFLOW"
}
]
}
Here the input parameters are defined as:
"inputParameters": {
"startWorkflow": {
"name": "your_workflow_name_to_be_started",
"version": 3
}
},
This would start your workflow named “your_workflow_name_to_be_started” with the version being 3.
The output shows the generated workflow ID of the started workflow.
{
"workflowId": "8ca4184e-6a52-11ed-aaf5-f62716e2ae41"
}
From the workflow executions page, you can click on Start Workflow on the Summary tab to see the newly started workflow status.
Even if the started workflow is not completed, the main workflow would be completed, i.e., in this case, even if your_workflow_name_to_started is not completed, the main workflow sample_start_workflow would be completed.