Upgrade Workflow API upgrades a running workflow to a newer/older version. When the workflow is running, one of the tasks would be currently in the execution state. When this workflow is upgraded using this API, all the tasks in the newer definition before this running task will be marked as skipped.
This API support is currently available only in the Conductor beta version.
|workflowId||The unique identifier of the workflow to be upgraded.|
|name||Name of the workflow with the latest definition to be upgraded.|
|version||Version to which the workflow is to be updated.|
|taskOutput||A map of key and value containing the output of the tasks that will be skipped. Here, the key is the task reference name, and the value is the task output.|
|workflowInput||A map of key and value to be given as the input to the new workflow execution.|
Client SDK Methods
void upgradeRunningWorkflow(String workflowId, UpgradeWorkflowRequest upgradeWorkflowRequest)
Consider a workflow definition with version 1 as follows:
Now let's run the workflow. Currently simple_task2 is completed, but simple_task4 is in a running state:
Now, we want to update the workflow to the newer definition with 2 more tasks as follows:
Let's call the upgrade API with the following UpgradeWorkflowRequest:
UpgradeWorkflowRequest upgradeWorkflowRequest = new UpgradeWorkflowRequest();
Map<String, Object> output = Map.of("updatedBy" , "upgrade");
Now, the workflow gets upgraded to the latest version as shown below:
All the tasks added above the running simple_task4 gets skipped here. The tasks simple_task1 and simple_task3 will have output as per the taskOutput map above. The workflow input will also get changed as per the workflowInput map.