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
Parameter | Description | Type | Required/ Optional |
---|---|---|---|
workflowId | The execution ID of the workflow to be upgraded. | string | Required. |
Request body
Format the request as an object containing the following parameters.
Parameter | Description | Type | Required/ Optional |
---|---|---|---|
name | The name of the workflow definition. | string | Required. |
version | The version to which the workflow is to be updated. | integer | Required. |
taskOutput | A map of task outputs for any skipped tasks, with the key as the task reference name, and the value as the task output object. | map | Optional. |
workflowInput | A map of inputs for the upgraded workflow execution, with the parameter name as the key and its input value as the value. | map | Optional. |
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.
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.
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.