Skip to content

Commit 99d3f21

Browse files
jorgenjtsurdilo
andauthored
Remove workflowId from Parallel state (#359)
* Remove workflowId from Parallel state (use subFlow actions instead). Signed-off-by: Jorgen Johnson <[email protected]> * updated roadmap Signed-off-by: Tihomir Surdilovic <[email protected]> Co-authored-by: Tihomir Surdilovic <[email protected]>
1 parent f777c10 commit 99d3f21

File tree

5 files changed

+24
-54
lines changed

5 files changed

+24
-54
lines changed

comparisons/comparison-cadence.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,11 @@ version: '1.0'
298298
start: GreetingSubFlow
299299
states:
300300
- name: GreetingSubFlow
301-
type: subflow
302-
workflowId: subflowgreet
303-
waitForCompletion: false
301+
type: operation
302+
actions:
303+
- subFlowRef:
304+
workflowId: subflowgreet
305+
waitForCompletion: false
304306
end: true
305307
functions:
306308
- name: greetingfunction

examples/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,15 @@ to finish execution before it can transition (end workflow execution in this cas
519519
"branches": [
520520
{
521521
"name": "ShortDelayBranch",
522-
"workflowId": "shortdelayworkflowid"
522+
"actions": [{
523+
"subFlowRef": "shortdelayworkflowid"
524+
}]
523525
},
524526
{
525527
"name": "LongDelayBranch",
526-
"workflowId": "longdelayworkflowid"
528+
"actions": [{
529+
"subFlowRef": "longdelayworkflowid"
530+
}]
527531
}
528532
],
529533
"end": true
@@ -547,9 +551,11 @@ states:
547551
completionType: allOf
548552
branches:
549553
- name: ShortDelayBranch
550-
workflowId: shortdelayworkflowid
554+
actions:
555+
- subFlowRef: shortdelayworkflowid
551556
- name: LongDelayBranch
552-
workflowId: longdelayworkflowid
557+
actions:
558+
- subFlowRef: longdelayworkflowid
553559
end: true
554560
```
555561

roadmap/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ _Status description:_
2727
| ✔️| Rename switch state `default` to `defaultCondition` to avoid keyword conflicts for SDK's | [spec doc](../specification.md) |
2828
| ✔️| Add description of additional properties | [spec doc](../specification.md) |
2929
| ✔️| Rename Parallel `completionType` values | [spec doc](../specification.md) |
30+
| ✔️| Removed `workflowId` from ParallelState and ForEach states (use subFlow action instead) | [spec doc](../specification.md) |
3031
| 🚩 | Workflow invocation bindings | |
3132
| 🚩 | CE Subscriptions & Discovery | |
3233
| 🚩 | Error types | [issue](https://github.com/serverlessworkflow/specification/issues/200) |

schema/workflow.json

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@
449449
"properties": {
450450
"waitForCompletion": {
451451
"type": "boolean",
452-
"default": false,
452+
"default": true,
453453
"description": "Workflow execution must wait for sub-workflow to finish before continuing"
454454
},
455455
"workflowId": {
@@ -479,26 +479,12 @@
479479
"$ref": "#/definitions/action"
480480
},
481481
"additionalItems": false
482-
},
483-
"workflowId": {
484-
"type": "string",
485-
"description": "Unique Id of a workflow to be executed in this branch"
486482
}
487483
},
488484
"additionalProperties": false,
489-
"oneOf": [
490-
{
491-
"required": [
492-
"name",
493-
"workflowId"
494-
]
495-
},
496-
{
497-
"required": [
498-
"name",
499-
"actions"
500-
]
501-
}
485+
"required": [
486+
"name",
487+
"actions"
502488
]
503489
},
504490
"delaystate": {
@@ -1408,31 +1394,11 @@
14081394
"type",
14091395
"inputCollection",
14101396
"iterationParam",
1411-
"workflowId"
1397+
"actions"
14121398
]
14131399
},
14141400
"else": {
14151401
"oneOf": [
1416-
{
1417-
"required": [
1418-
"name",
1419-
"type",
1420-
"inputCollection",
1421-
"iterationParam",
1422-
"workflowId",
1423-
"end"
1424-
]
1425-
},
1426-
{
1427-
"required": [
1428-
"name",
1429-
"type",
1430-
"inputCollection",
1431-
"iterationParam",
1432-
"workflowId",
1433-
"transition"
1434-
]
1435-
},
14361402
{
14371403
"required": [
14381404
"name",

specification.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2556,7 +2556,7 @@ to the trigger/produced event.
25562556

25572557
| Parameter | Description | Type | Required |
25582558
| --- | --- | --- | --- |
2559-
| waitForCompletion | If workflow execution must wait for sub-workflow to finish before continuing | boolean | yes |
2559+
| waitForCompletion | If workflow execution must wait for sub-workflow to finish before continuing (default is `true`) | boolean | yes |
25602560
| workflowId |Sub-workflow unique id | boolean | no |
25612561

25622562
<details><summary><strong>Click to view example definition</strong></summary>
@@ -3276,8 +3276,7 @@ Exceptions may occur during execution of branches of the Parallel state, this is
32763276
| Parameter | Description | Type | Required |
32773277
| --- | --- | --- | --- |
32783278
| name | Branch name | string | yes |
3279-
| [actions](#Action-Definition) | Actions to be executed in this branch | array | yes if workflowId is not defined |
3280-
| workflowId | Unique Id of a workflow to be executed in this branch | string | yes if actions is not defined |
3279+
| [actions](#Action-Definition) | Actions to be executed in this branch | array | yes |
32813280

32823281
<details><summary><strong>Click to view example definition</strong></summary>
32833282
<p>
@@ -3352,7 +3351,7 @@ If the parallel states branch defines actions, all exceptions that arise from ex
33523351
are propagated to the parallel state
33533352
and can be handled with the parallel states `onErrors` definition.
33543353

3355-
If the parallel states defines a `workflowId`, exceptions that occur during execution of the called workflow
3354+
If the parallel states defines a subflow action, exceptions that occur during execution of the called workflow
33563355
can chose to handle exceptions on their own. All unhandled exceptions from the called workflow
33573356
execution however are propagated back to the parallel state and can be handled with the parallel states
33583357
`onErrors` definition.
@@ -3682,10 +3681,6 @@ It should contain the unique element of the `inputCollection` array and passed a
36823681

36833682
The `actions` property defines actions to be executed in each state iteration.
36843683

3685-
If actions are not defined, you can specify the `workflowid` to reference a workflow id which needs to be executed
3686-
for each iteration. Note that `workflowid` should not be the same as the workflow id of the workflow where the ForEach state
3687-
is defined.
3688-
36893684
Let's take a look at an example:
36903685

36913686
In this example the data input to our workflow is an array of orders:

0 commit comments

Comments
 (0)