Skip to main content

Upgrade Workflow

Endpoint: POST /api/workflow/{workflowId}/upgrade

Upgrades a running workflow to a different version.

The workflow execution will continue from its last running task, even when it has been upgraded. In other words, all the tasks in the upgraded definition prior to the currently running task will be marked as skipped.

Path parameters

ParameterDescriptionTypeRequired/ Optional
workflowIdThe execution ID of the workflow to be upgraded.stringRequired.

Request body

Format the request as an object containing the following parameters.

ParameterDescriptionTypeRequired/ Optional
nameThe name of the workflow definition.stringRequired.
versionThe version to which the workflow is to be updated.integerRequired.
taskOutputA map of task outputs for any skipped tasks, with the key as the task reference name, and the value as the task output object.mapOptional.
workflowInputA map of inputs for the upgraded workflow execution, with the parameter name as the key and its input value as the value.mapOptional.

Example

{
"name": "myWorkflow",
"taskOutput": {
"newTaskRefName": {
"someKey: "someValue
}
},
"version": 3,
"workflowInput": {
"someKey": "someValue"
}
}

Response

Returns 200 OK, indicating that the workflow execution has been upgraded successfully. All new tasks before the currently running task are skipped in the execution.

Examples

Upgrade to the next version

Request

curl -X 'POST' \
'https://<YOUR_CLUSTER>/api/workflow/77916c63-d3e7-11ef-87b1-b2b27c52ebde/upgrade' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"name": "someWorkflow",
"taskOutput": {},
"version": 2
}'

Response

Returns 200 OK, indicating that the workflow execution has been upgraded successfully. All new tasks before the currently running task are skipped in the execution.

Screenshot of Conductor UI showing the skipped tasks in the upgraded workflow execution.

Upgrade to the next version with updated workflow input

Request

curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/workflow/ce5ce5d6-6ed1-11f0-880f-0246e7260963/upgrade' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"name": "someWorkflow",
"version": 2,
"workflowInput": {
"name": "updatedValue"
}
'

Response

Returns 200 OK, indicating that the workflow execution has been upgraded successfully, and the workflowInput is updated in the running execution.

Screenshot of Conductor UI showing updated workflow input using upgrade workflow API.

Upgrade to the next version with updated task output for a skipped task

Request

 curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/workflow/b24acffe-6ed2-11f0-880f-0246e7260963/upgrade' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"name": "someWorkflow",
"taskOutput": {
"event_ref": {
"output": "This task execution is skipped via API call"
}
},
"version": 2
}
'

Response

Returns 200 OK, indicating that the workflow execution has been upgraded successfully. The output for the skipped task (event_ref) is added to the execution.

Screenshot of Conductor UI showing updated task output for a skipped task.