diff --git a/comparisons/comparison-cadence.md b/comparisons/comparison-cadence.md index 5b97debd..10bf0f7b 100644 --- a/comparisons/comparison-cadence.md +++ b/comparisons/comparison-cadence.md @@ -298,9 +298,11 @@ version: '1.0' start: GreetingSubFlow states: - name: GreetingSubFlow - type: subflow - workflowId: subflowgreet - waitForCompletion: false + type: operation + actions: + - subFlowRef: + workflowId: subflowgreet + waitForCompletion: false end: true functions: - name: greetingfunction diff --git a/examples/README.md b/examples/README.md index 1665c817..384086c4 100644 --- a/examples/README.md +++ b/examples/README.md @@ -519,11 +519,15 @@ to finish execution before it can transition (end workflow execution in this cas "branches": [ { "name": "ShortDelayBranch", - "workflowId": "shortdelayworkflowid" + "actions": [{ + "subFlowRef": "shortdelayworkflowid" + }] }, { "name": "LongDelayBranch", - "workflowId": "longdelayworkflowid" + "actions": [{ + "subFlowRef": "longdelayworkflowid" + }] } ], "end": true @@ -547,9 +551,11 @@ states: completionType: allOf branches: - name: ShortDelayBranch - workflowId: shortdelayworkflowid + actions: + - subFlowRef: shortdelayworkflowid - name: LongDelayBranch - workflowId: longdelayworkflowid + actions: + - subFlowRef: longdelayworkflowid end: true ``` diff --git a/roadmap/README.md b/roadmap/README.md index 13e71a4c..5522a130 100644 --- a/roadmap/README.md +++ b/roadmap/README.md @@ -27,6 +27,7 @@ _Status description:_ | ✔️| Rename switch state `default` to `defaultCondition` to avoid keyword conflicts for SDK's | [spec doc](../specification.md) | | ✔️| Add description of additional properties | [spec doc](../specification.md) | | ✔️| Rename Parallel `completionType` values | [spec doc](../specification.md) | +| ✔️| Removed `workflowId` from ParallelState and ForEach states (use subFlow action instead) | [spec doc](../specification.md) | | 🚩 | Workflow invocation bindings | | | 🚩 | CE Subscriptions & Discovery | | | 🚩 | Error types | [issue](https://github.com/serverlessworkflow/specification/issues/200) | diff --git a/schema/workflow.json b/schema/workflow.json index 57672ac9..a03b2f56 100644 --- a/schema/workflow.json +++ b/schema/workflow.json @@ -449,7 +449,7 @@ "properties": { "waitForCompletion": { "type": "boolean", - "default": false, + "default": true, "description": "Workflow execution must wait for sub-workflow to finish before continuing" }, "workflowId": { @@ -479,26 +479,12 @@ "$ref": "#/definitions/action" }, "additionalItems": false - }, - "workflowId": { - "type": "string", - "description": "Unique Id of a workflow to be executed in this branch" } }, "additionalProperties": false, - "oneOf": [ - { - "required": [ - "name", - "workflowId" - ] - }, - { - "required": [ - "name", - "actions" - ] - } + "required": [ + "name", + "actions" ] }, "delaystate": { @@ -1408,31 +1394,11 @@ "type", "inputCollection", "iterationParam", - "workflowId" + "actions" ] }, "else": { "oneOf": [ - { - "required": [ - "name", - "type", - "inputCollection", - "iterationParam", - "workflowId", - "end" - ] - }, - { - "required": [ - "name", - "type", - "inputCollection", - "iterationParam", - "workflowId", - "transition" - ] - }, { "required": [ "name", diff --git a/specification.md b/specification.md index c19a1439..e9384482 100644 --- a/specification.md +++ b/specification.md @@ -2556,7 +2556,7 @@ to the trigger/produced event. | Parameter | Description | Type | Required | | --- | --- | --- | --- | -| waitForCompletion | If workflow execution must wait for sub-workflow to finish before continuing | boolean | yes | +| waitForCompletion | If workflow execution must wait for sub-workflow to finish before continuing (default is `true`) | boolean | yes | | workflowId |Sub-workflow unique id | boolean | no |
Click to view example definition @@ -3276,8 +3276,7 @@ Exceptions may occur during execution of branches of the Parallel state, this is | Parameter | Description | Type | Required | | --- | --- | --- | --- | | name | Branch name | string | yes | -| [actions](#Action-Definition) | Actions to be executed in this branch | array | yes if workflowId is not defined | -| workflowId | Unique Id of a workflow to be executed in this branch | string | yes if actions is not defined | +| [actions](#Action-Definition) | Actions to be executed in this branch | array | yes |
Click to view example definition

@@ -3352,7 +3351,7 @@ If the parallel states branch defines actions, all exceptions that arise from ex are propagated to the parallel state and can be handled with the parallel states `onErrors` definition. -If the parallel states defines a `workflowId`, exceptions that occur during execution of the called workflow +If the parallel states defines a subflow action, exceptions that occur during execution of the called workflow can chose to handle exceptions on their own. All unhandled exceptions from the called workflow execution however are propagated back to the parallel state and can be handled with the parallel states `onErrors` definition. @@ -3682,10 +3681,6 @@ It should contain the unique element of the `inputCollection` array and passed a The `actions` property defines actions to be executed in each state iteration. -If actions are not defined, you can specify the `workflowid` to reference a workflow id which needs to be executed -for each iteration. Note that `workflowid` should not be the same as the workflow id of the workflow where the ForEach state -is defined. - Let's take a look at an example: In this example the data input to our workflow is an array of orders: