Skip to main content

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 status of a task can be updated in two ways:

  • Using the workflow ID and the reference name—Update the task status by specifying the workflow execution ID and the task's reference name.

  • Using the task execution ID—Update the task status 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.

ParameterDescriptionRequired/Optional
inputParameters.taskStatusThe status of the task to be updated. Supported values:
  • FAILED_WITH_TERMINAL_ERROR
  • FAILED
  • COMPLETED
It can be passed as a variable.
Required.
inputParameters.workflowIdThe execution ID of the workflow containing the task to be updated. It can be passed as a variable. The default value is ${workflow.workflowId}.Required if updating using workflowId and taskRefName.
inputParameters.taskRefNameThe reference name of the task to be updated. It can be passed as a variable.Required if updating using workflowId and taskRefName.
inputParameters.taskIdThe execution ID of the task to be updated. It can be passed as a variable.Required if updating using taskId.
inputParameters.taskOutputA key-value map that will be updated as the new task output. Supports string, number, boolean, null, and object/array.Optional.
inputParameters.mergeOutputDetermines whether the output will be merged with the existing task output. The default value is false. Accepted values:
  • true—The output generated by this task (taskOutput) will be combined with the existing task output.
  • false—The output will not be merged.
Optional.

Task configuration

This is the task configuration for an Update Task.

{
"name": "update_task",
"taskReferenceName": "update_task_ref",
"inputParameters": {
"taskStatus": "COMPLETED",
"mergeOutput": true,
"workflowId": "${workflow.workflowId}",
"taskRefName": "${workflow.input.taskRefName}",
"taskOutput": {
"key": "value"
}
},
"type": "UPDATE_TASK"
}

Task output

The Update Task will return the following parameters.

ParameterDescription
updatedTaskIdThe task execution ID of the updated task.
taskOutputThe new output of the task, if defined in input parameters.

Adding an Update Task in UI

To add an Update Task:

  1. In your workflow, select the (+) icon and add a Update task.
  2. Select the method required to update the task: using WorkflowId + Task Ref Name or Task ID.
  3. Enter Workflow ID and Task reference name, or Task ID, based on the chosen method.
  4. Select the required Task status.
  5. (Optional) Enable Merge Output if required.
  6. (Optional) Add any Task output parameters.

Adding Update task

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.

Workflow in 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.

Completed workflow using update task