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"
}
}
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.