Update Task
The Update Task is used to update the status of other tasks. The user should have access to the task being updated.
The Update Task can update the status of a task in two ways:
Using the workflow ID and the reference name—This method updates the task status by specifying the workflow execution ID and the task's reference name.
Using the task execution ID—This method updates the task status directly by specifying the task's execution ID.
The task can be updated only if the workflow is in “RUNNING” status.
Task parameters
Configure these parameters for the Update Task.
Parameter | Description | Required/Optional |
---|---|---|
inputParameters.taskStatus | The status of the task to be updated. Supported values:
| Required. |
inputParameters.workflowId | The execution ID of the workflow containing the task to be updated. It can be passed as a variable. | Required if updating using workflowId and taskRefName . |
inputParameters.taskRefName | The reference name of the task to be updated. It can be passed as a variable. | Required if updating using workflowId and taskRefName . |
inputParameters.taskId | The execution ID of the task to be updated. It can be passed as a variable. | Required if updating using taskId . |
inputParameters.taskOutput | A key-value map that will be updated as the new task output. Supports string, number, boolean, null, and object/array. | Optional. |
inputParameters.mergeOutput | Determines whether the output will be merged with the existing task output. The default value is false . Accepted values:
| Optional. |
Task configuration
This is the task configuration for an Update Task.
- Using workflowId and taskRefName
- Using taskId
{
"name": "update_task",
"taskReferenceName": "update_task_ref",
"inputParameters": {
"taskStatus": "COMPLETED",
"mergeOutput": true,
"workflowId": "${workflow.input.workflowID}", // hardcoded value or passed as variables
"taskRefName": "${workflow.input.taskRefName}",// hardcoded value or passed as variables
"taskOutput": {
"key": "value"
}
},
"type": "UPDATE_TASK"
}
{
"name": "update_task",
"taskReferenceName": "update_task_ref",
"inputParameters": {
"taskStatus": "COMPLETED",
"mergeOutput": false,
"taskId": "taskID" // hardcoded value or passed as variables
},
"type": "UPDATE_TASK"
}
Task output
The Update Task will return the following parameters.
Parameter | Description |
---|---|
updatedTaskId | The task execution ID of the updated task. |
taskOutput | The new output of the task, if defined in input parameters. |
Adding an Update Task in UI
To add an Update Task:
- In your workflow, select the (+) icon and add a Update task.
- Select the method required to update the task: using WorkflowId + Task Ref Name or Task ID.
- Enter Workflow ID and Task reference name, or Task ID, based on the chosen method.
- Select the required Task status.
- (Optional) Enable Merge Output if required.
- (Optional) Add any Task output parameters.
Examples
Here are some examples for using the Update Task.
Using Update Task in a workflow
To demonstrate the Update Task, consider the following workflow in a running state.
Let’s update this task with the following workflow containing an update task.
//workflow definition
{
"name": "update_task",
"taskReferenceName": "update_task_ref",
"inputParameters": {
"taskStatus": "COMPLETED",
"mergeOutput": false,
"workflowId": "97c19cc0-4fd9-11ef-9e2a-9ab0a049e912",
"taskRefName": "http_ref"
},
"type": "UPDATE_TASK"
}
Now, run the workflow. Once the execution is successful, check the workflow containing the HTTP task to verify that the task status has been updated successfully.