From 0abb00416e680c295dfdeacf91d4aa2c5d4d83d1 Mon Sep 17 00:00:00 2001
From: RizaFarheen
Date: Thu, 21 Sep 2023 19:22:08 +0400
Subject: [PATCH 1/2] Update upgrade-workflow.md
---
.../api/workflow/upgrade-workflow.md | 89 +++++++++++--------
1 file changed, 52 insertions(+), 37 deletions(-)
diff --git a/docs/reference-docs/api/workflow/upgrade-workflow.md b/docs/reference-docs/api/workflow/upgrade-workflow.md
index aee7ecbe..d4a81d80 100644
--- a/docs/reference-docs/api/workflow/upgrade-workflow.md
+++ b/docs/reference-docs/api/workflow/upgrade-workflow.md
@@ -7,52 +7,26 @@ import TabItem from '@theme/TabItem';
# Upgrade Workflow
-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.
-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.
+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.
+
+:::note
+This API support is currently available only in the Conductor beta version.
+:::
## Input Payload
| Attribute | Description |
|---------------|------------------------------------------------------------------------------------------------------------------------------|
-| workflowId | The unique identifier of the workflow to be upgraded. |
-| 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 |
+| 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. |
## API Endpoint
```
POST /workflow/{workflowId}/upgrade
```
-
-## Examples
-
-Consider a workflow definition as per below,
-
-and the new definition of the workflow is,
-
-
-Now the workflow with version 1 is triggered and currently task_2 is completed but task_4 is in running state,
-
-
-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,
-
-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
@@ -66,37 +40,78 @@ void upgradeRunningWorkflow(String workflowId, UpgradeWorkflowRequest upgradeWor
```go
+Coming Soon
```
```python
+Coming Soon
```
```csharp
+Coming Soon
```
```javascript
+Coming Soon
```
```typescript
+Coming Soon
```
```clojure
+Coming Soon
```
-
\ No newline at end of file
+
+
+## Examples
+
+Sample Workflow
+
+
+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**:
+```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);
+```
+
+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.
+
+
+
+
From fef5a434af9535bd2d975c687cbbb84d940c0caf Mon Sep 17 00:00:00 2001
From: RizaFarheen
Date: Thu, 21 Sep 2023 19:28:04 +0400
Subject: [PATCH 2/2] Update update-secret.md
---
docs/reference-docs/system-tasks/update-secret.md | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/docs/reference-docs/system-tasks/update-secret.md b/docs/reference-docs/system-tasks/update-secret.md
index 35f90ba6..14a8b810 100644
--- a/docs/reference-docs/system-tasks/update-secret.md
+++ b/docs/reference-docs/system-tasks/update-secret.md
@@ -7,7 +7,7 @@ import TabItem from '@theme/TabItem';
# Update Secret
-Update Secret is used to update value of any secret given the user has permission to update the secret.
+A system task to update the value of any secret, given the user has permission to update the secret.
## Definitions
@@ -29,12 +29,13 @@ Update Secret is used to update value of any secret given the user has permissio
| Attributes | Description |
|-------------|-------------------------|
-| secretKey | name of the secret key |
-| secretValue | value of the secret key |
+| secretKey | Name of the secret key. |
+| secretValue | Value of the secret key. |
-**Notes**
-1. User must have update permission over the secretKey otherwise workflow will be terminated with 403 error.
-2. If the secret does not exist by the secretKey, it will be created and the value will be as per the secretValue
+:::note Notes
+1. The user must have update permission over the secretKey; otherwise, the workflow will be terminated with a 403 error.
+2. If the secret does not exist by the secretKey, it will be created, and the value will be as per the secretValue.
3. Only one secret can be updated at a time.
+:::