Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions comparisons/comparison-cadence.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -547,9 +551,11 @@ states:
completionType: allOf
branches:
- name: ShortDelayBranch
workflowId: shortdelayworkflowid
actions:
- subFlowRef: shortdelayworkflowid
- name: LongDelayBranch
workflowId: longdelayworkflowid
actions:
- subFlowRef: longdelayworkflowid
end: true
```

Expand Down
1 change: 1 addition & 0 deletions roadmap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
44 changes: 5 additions & 39 deletions schema/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
11 changes: 3 additions & 8 deletions specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

<details><summary><strong>Click to view example definition</strong></summary>
Expand Down Expand Up @@ -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 |

<details><summary><strong>Click to view example definition</strong></summary>
<p>
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down