Skip to main content

Update Task

The Update Task is used to update the status of a Wait task. The status of a task can be updated in two ways:

  • Using the workflow (execution) 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 Wait task can be updated only if the workflow is in “RUNNING” status, and the invoking user or application should have access to the task being updated.

note

Using the Update Task in non-Wait signal scenarios may result in unintended side effects, as it is not designed for these use cases.

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 dynamic input.
Required.
inputParameters.workflowIdThe execution ID of the workflow containing the task to be updated. It can be passed as a dynamic input. 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 dynamic input.Required if updating using workflowId and taskRefName.
inputParameters.taskIdThe execution ID of the task to be updated. It can be passed as a dynamic input.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.

Schema parameters

You can enforce input/output validation for the task using the following parameters. Refer to Schema Validation for a full guide.

ParameterDescriptionRequired/ Optional
taskDefinition.enforceSchemaWhether to enforce schema validation for task inputs/outputs. Set to true to enable validation.Optional.
taskDefinition.inputSchemaThe name and type of the input schema to be associated with the task.Required if enforceSchema is set to true.
taskDefinition.outputSchemaThe name and type of the output schema to be associated with the task.Required if enforceSchema is set to true.

Other generic parameters

Here are other parameters for configuring the task behavior.

ParameterDescriptionRequired/ Optional
optionalWhether the task is optional. The default is false.

If set to true, the workflow continues to the next task even if this task is in progress or fails.
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.

// task configuration

{
"name": "update_task",
"taskReferenceName": "update_task_ref",
"inputParameters": {
"taskStatus": "COMPLETED",
"mergeOutput": false,
"workflowId": "c7a49124-1f4c-11f0-853e-523c761f9110",
"taskRefName": "wait_ref"
},
"type": "UPDATE_TASK"
}

Now, run the workflow. Once the execution is successful, check the workflow containing the Wait task to verify that the task status has been updated successfully.

Completed workflow using update task