diff --git a/docs/reference-docs/api/workflow/upgrade-workflow.md b/docs/reference-docs/api/workflow/upgrade-workflow.md index eec0d835..96abbc83 100644 --- a/docs/reference-docs/api/workflow/upgrade-workflow.md +++ b/docs/reference-docs/api/workflow/upgrade-workflow.md @@ -9,7 +9,7 @@ import TabItem from '@theme/TabItem'; This api is used to upgrade running workflow to a newer/older version. All the tasks that present earlier in the new definition will be marked as skipped. -taksOutput is the map contains output of the tasks that are going to be skipped. +taskOutput is the map contains output of the tasks that are going to be skipped. workflowInput is the map if user want to set the input to the workflow that is being upgraded. The support for this api is in beta. @@ -18,8 +18,8 @@ The support for this api is in beta. | Attribute | Description | |---------------|------------------------------------------------------------------------------------------------------------------------------| | workflowId | The unique identifier of the workflow to be upgraded. | -| name | Name of the workflow to pick the definition from. | -| version | Version of the workflow to pick the definition from. | +| name | Name of the workflow to pick the definition for upgrade. | +| version | Version of the workflow to pick the definition for upgrade. | | taskOutput | Map of Key and Value for the tasks that are going to be skipped. key is the task reference name and value is the task output | | workflowInput | Map of Key and Value given as the input to the new workflow execution | @@ -30,6 +30,28 @@ POST /workflow/{workflowId}/upgrade ## Examples +Consider a workflow definition as per below, +

Upgrade workflow old definition

+and the new definition of the workflow is, +

Upgrade workflow new definition

+ +Now the workflow with version 1 is triggered and currently task_2 is completed but task_4 is in running state, +

Upgrade workflow old instance running

+ +Now when we call upgrade api with following UpgradeWorkflowRequest, +```java +UpgradeWorkflowRequest upgradeWorkflowRequest = new UpgradeWorkflowRequest(); + Map output = Map.of("updatedBy" , "upgrade"); + upgradeWorkflowRequest.setTaskOutput(Map.of("simple_task3", output,"simple_task1",output)); + upgradeWorkflowRequest.setWorkflowInput(Map.of("name", "orkes")); + + upgradeWorkflowRequest.setVersion(2); + upgradeWorkflowRequest.setName(workflowName); +``` +The workflow state will be changed as below, +

Upgrade workflow new instance running

+Also the task that are skipped i.e. simple_task_1 and simple_task_3 will have output as per the map output above. +The workflow input will also get changed as per the workflowInput map. ## Client SDK Methods diff --git a/static/img/upgrade-workflow-new-definition.png b/static/img/upgrade-workflow-new-definition.png new file mode 100644 index 00000000..cb01c4ed Binary files /dev/null and b/static/img/upgrade-workflow-new-definition.png differ diff --git a/static/img/upgrade-workflow-new-running.png b/static/img/upgrade-workflow-new-running.png new file mode 100644 index 00000000..a302c452 Binary files /dev/null and b/static/img/upgrade-workflow-new-running.png differ diff --git a/static/img/upgrade-workflow-old-definition.png b/static/img/upgrade-workflow-old-definition.png new file mode 100644 index 00000000..912a40d1 Binary files /dev/null and b/static/img/upgrade-workflow-old-definition.png differ diff --git a/static/img/upgrade-workflow-old-running.png b/static/img/upgrade-workflow-old-running.png new file mode 100644 index 00000000..1abec89f Binary files /dev/null and b/static/img/upgrade-workflow-old-running.png differ