Skip to content

Commit 77c77b2

Browse files
committed
[Fix #742] Ricardos comments
Signed-off-by: Francisco Javier Tirado Sarti <[email protected]>
1 parent 3c9316b commit 77c77b2

File tree

1 file changed

+40
-51
lines changed

1 file changed

+40
-51
lines changed

specification.md

Lines changed: 40 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,8 @@ a workflow with a single event state and show how data filters can be combined.
643643

644644
```json
645645
{
646-
"id": "GreetCustomersWorkflow",
647-
"name": "Greet Customers when they arrive",
646+
"name": "GreetCustomersWorkflow",
647+
"description": "Greet Customers when they arrive",
648648
"version": "1.0.0",
649649
"specVersion": "0.8",
650650
"start": "WaitForCustomerToArrive",
@@ -1910,16 +1910,16 @@ we can use this expression in the workflow "version" parameter:
19101910

19111911
```json
19121912
{
1913-
"id": "MySampleWorkflow",
1914-
"name": "Sample Workflow",
1913+
"name": "MySampleWorkflow",
1914+
"description": "Sample Workflow",
19151915
"version": "${ .inputVersion }",
19161916
"specVersion": "0.8"
19171917
}
19181918
```
19191919

19201920
which would set the workflow version to "1.0.0".
1921-
Note that the workflow "id" property value is not allowed to use an expression. The workflow
1922-
definition "id" must be a constant value.
1921+
Note that the workflow "name" property value is not allowed to use an expression. The workflow
1922+
definition "name" must be a constant value.
19231923

19241924
### Workflow Definition Structure
19251925

@@ -1962,10 +1962,9 @@ definition "id" must be a constant value.
19621962

19631963
```json
19641964
{
1965-
"id": "sampleWorkflow",
1965+
"name": "sampleWorkflow",
19661966
"version": "1.0.0",
19671967
"specVersion": "0.8",
1968-
"name": "Sample Workflow",
19691968
"description": "Sample Workflow",
19701969
"start": "MyStartingState",
19711970
"states": [],
@@ -1980,10 +1979,9 @@ definition "id" must be a constant value.
19801979
<td valign="top">
19811980

19821981
```yaml
1983-
id: sampleWorkflow
1982+
name: sampleWorkflow
19841983
version: '1.0.0'
19851984
specVersion: '0.8'
1986-
name: Sample Workflow
19871985
description: Sample Workflow
19881986
start: MyStartingState
19891987
states: []
@@ -2006,18 +2004,13 @@ Following figure describes the main workflow definition blocks.
20062004
<img src="media/spec/workflowdefinitionblocks.png" height="300px" alt="Serverless Workflow Definitions Blocks"/>
20072005
</p>
20082006

2009-
The `id` property defines the unique, domain-specific workflow identifier, for example "orders", "payment", etc.
2010-
2011-
The `key` property defines the unique, domain-specific workflow identifier.
2012-
It can be used when the `id` property is auto-generated by a content-management system for example.
2013-
In these cases, you can specify the `key` property to be the domain-specific identifier of the workflow definition.
2014-
The `id` and `key` properties are mutually exclusive, meaning you cannot define both.
2007+
The required `name` property defines the unique workflow definition identifier, for example "orders", "payment", etc.
20152008

2016-
The `name` property is the workflow logical name.
2009+
The optional `key` property is an expression that evaluates to a domain related, unique running workflow instance identifier, for example "orders-1", "orders-2"...
20172010

2018-
The `description` property can be used to give further information about the workflow.
2011+
The `description` property might be used to give further information about the workflow.
20192012

2020-
The `version` property can be used to provide a specific workflow version. It must use the [semantic versioning](https://semver.org/) format.
2013+
The `version` property can be used to provide a specific workflow version. It must use the [semantic versioning](https://semver.org/) format.If not specified, "latest" is assumed.
20212014

20222015
The `annotations` property defines a list of helpful terms describing the workflows intended purpose, subject areas, or other important qualities,
20232016
for example "machine learning", "monitoring", "networking", etc
@@ -2168,10 +2161,9 @@ Here is an example of using external resource for function definitions:
21682161

21692162
```json
21702163
{
2171-
"id": "sampleWorkflow",
2164+
"name": "sampleWorkflow",
21722165
"version": "1.0.0",
21732166
"specVersion": "0.8",
2174-
"name": "Sample Workflow",
21752167
"description": "Sample Workflow",
21762168
"start": "MyStartingState",
21772169
"functions": "http://myhost:8080/functiondefs.json",
@@ -2205,10 +2197,9 @@ Here is an example of using external resource for event definitions:
22052197

22062198
```json
22072199
{
2208-
"id": "sampleWorkflow",
2200+
"name": "sampleWorkflow",
22092201
"version": "1.0.0",
22102202
"specVersion": "0.8",
2211-
"name": "Sample Workflow",
22122203
"description": "Sample Workflow",
22132204
"start": "MyStartingState",
22142205
"events": "http://myhost:8080/eventsdefs.json",
@@ -3149,7 +3140,6 @@ and our workflow is defined as:
31493140

31503141
```json
31513142
{
3152-
"id": "sendConfirmWorkflow",
31533143
"name": "SendConfirmationForCompletedOrders",
31543144
"version": "1.0.0",
31553145
"specVersion": "0.8",
@@ -3186,7 +3176,6 @@ and our workflow is defined as:
31863176
<td valign="top">
31873177

31883178
```yaml
3189-
id: sendConfirmWorkflow
31903179
name: SendConfirmationForCompletedOrders
31913180
version: '1.0.0'
31923181
specVersion: '0.8'
@@ -4031,9 +4020,9 @@ multiple other workflow definitions.
40314020
<img src="media/spec/subflowstateref.png" height="350px" alt="Referencing reusable workflow via SubFlow actions"/>
40324021
</p>
40334022

4034-
Reusable workflows are referenced by their `id` property via the SubFlow action `workflowId` parameter.
4023+
Reusable workflows are referenced by their `name` property via the SubFlow action `workflowId` parameter.
40354024

4036-
For the simple case, `subFlowRef` can be a string containing the `id` of the sub-workflow to invoke.
4025+
For the simple case, `subFlowRef` can be a string containing the `name` of the sub-workflow to invoke.
40374026
If you want to specify other parameters then a [subFlowRef](#SubFlowRef-Definition) should be provided instead.
40384027

40394028
Each referenced workflow receives the SubFlow actions data as workflow data input.
@@ -4200,19 +4189,19 @@ should not fail workflow execution.
42004189

42014190
`SubFlowRef` definition can have two types, namely `string` or `object`.
42024191

4203-
If `string` type, it defines the unique id of the sub-workflow to be invoked.
4204-
This short-hand definition can be used if sub-workflow lookup is done only by its `id`
4192+
If `string` type, it defines the unique name of the sub-workflow to be invoked.
4193+
This short-hand definition can be used if sub-workflow lookup is done only by its `name`
42054194
property and not its `version` property.
42064195

42074196
```json
4208-
"subFlowRef": "mySubFlowId"
4197+
"subFlowRef": "mySubFlowName"
42094198
```
42104199

42114200
If you need to define the `version` properties, you can use its `object` type:
42124201

42134202
| Parameter | Description | Type | Required |
42144203
| --- | --- | --- | --- |
4215-
| workflowId | Sub-workflow unique id | string | yes |
4204+
| workflowId | Sub-workflow unique name | string | yes |
42164205
| version | Sub-workflow version | string | no |
42174206
| invoke | Specifies if the subflow should be invoked `sync` or `async`. Default is `sync` | enum | no |
42184207
| onParentComplete | If `invoke` is `async`, specifies if subflow execution should `terminate` or `continue` when parent workflow completes. Default is `terminate` | enum | no |
@@ -4249,8 +4238,8 @@ version: '2.0.0'
42494238

42504239
</details>
42514240

4252-
The `workflowId` property define the unique ID of the sub-workflow to be invoked.
4253-
Usually, the workflow id should not be the same id of the workflow where the action is defined. Otherwise, it may occur undesired recurring calls to the same workflow.
4241+
The `workflowId` property define the unique name of the sub-workflow to be invoked.
4242+
The workflow id should not be the same name of the workflow where the action is defined. Otherwise, it may occur undesired recurring calls to the same workflow.
42544243

42554244
The `version` property defined the unique version of the sub-workflow to be invoked.
42564245
If this property is defined, runtimes should match both the `id` and the `version` properties
@@ -4707,7 +4696,7 @@ actions:
47074696

47084697
Each branch receives the same copy of the Parallel state's data input.
47094698

4710-
A branch can define actions that need to be executed. For the [`SubFlowRef`](#SubFlowRef-Definition) action, the workflow id should not be the same id of the workflow where the branch is defined. Otherwise, it may occur undesired recurring calls to the same workflow.
4699+
A branch can define actions that need to be executed. For the [`SubFlowRef`](#SubFlowRef-Definition) action, the workflow name should not be the same name of the workflow where the branch is defined. Otherwise, it may occur undesired recurring calls to the same workflow.
47114700

47124701

47134702
The `timeouts` property can be used to set branch specific timeout settings. Parallel state branches can set the
@@ -4993,7 +4982,7 @@ If the end definition is of type `object`, it has the following structure:
49934982
| terminate | If `true`. terminates workflow instance execution | boolean | no |
49944983
| produceEvents | Array of [producedEvent](#ProducedEvent-Definition) definitions. Defines events that should be produced. | array | no |
49954984
| [compensate](#Workflow-Compensation) | If set to `true`, triggers workflow compensation before workflow execution completes. Default is `false` | boolean | no |
4996-
| [continueAs](#continuing-as-a-new-execution) | Defines that current workflow execution should stop, and execution should continue as a new workflow instance of the provided id | string or object | no |
4985+
| [continueAs](#continuing-as-a-new-execution) | Defines that current workflow execution should stop, and execution should continue as a new workflow instance of the provided name | string or object | no |
49974986

49984987
<details><summary><strong>Click to view example definition</strong></summary>
49994988
<p>
@@ -5058,7 +5047,7 @@ The [continueAs](#Continuing-as-a-new-Execution) property defines that the curre
50585047
and worklow execution should continue as a new instance of a new workflow.
50595048
When defined, it should be assumed that `terminate` is `true`. If `continueAs` is defined, and `terminate` is explicitly
50605049
set to `false`, runtimes should report this to users. Producing events, and compensation should still be performed (if defined)
5061-
before the workflow execution is stopped, and continued as a new workflow instance with the defined workflow id.
5050+
before the workflow execution is stopped, and continued as a new workflow instance with the defined workflow name.
50625051

50635052
##### ProducedEvent Definition
50645053

@@ -5152,10 +5141,10 @@ Let's take a look at an example of additional properties:
51525141

51535142
```json
51545143
{
5155-
"id": "myworkflow",
5144+
"name": "myworkflow",
51565145
"version": "1.0.0",
51575146
"specVersion": "0.8",
5158-
"name": "My Test Workflow",
5147+
"description": "My Test Workflow",
51595148
"start": "My First State",
51605149
"loglevel": "Info",
51615150
"environment": "Production",
@@ -5170,10 +5159,10 @@ Note the same can be also specified using workflow metadata, which is the prefer
51705159

51715160
```json
51725161
{
5173-
"id": "myworkflow",
5162+
"name": "myworkflow",
51745163
"version": "1.0.0",
51755164
"specVersion": "0.8",
5176-
"name": "Py Test Workflow",
5165+
"description": "Py Test Workflow",
51775166
"start": "My First State",
51785167
"metadata": {
51795168
"loglevel": "Info",
@@ -5599,7 +5588,7 @@ To give an example, let's say that in our workflow definition we define the time
55995588

56005589
```json
56015590
{
5602-
"id": "testWorkflow",
5591+
"name": "testWorkflow",
56035592
...
56045593
"timeouts": {
56055594
...
@@ -6109,23 +6098,23 @@ likely to be forced to stop before reaching its completion. This can result in u
61096098
mission-critical workflows.
61106099

61116100
For those cases, the Serverless Workflow DSL provides a way to explicitly define stopping the current workflow
6112-
instance execution, and starting a new one (for the same workflow id or a different one).
6101+
instance execution, and starting a new one (for the same workflow name or a different one).
61136102
This can be done via the [end definitions](#end-definition) `continueAs` property.
61146103

61156104
The end definitions `continueAs` can be either of type `string` or `object`.
6116-
If string type, it contains the unique workflow id of the workflow that the execution should continue as, for example:
6105+
If string type, it contains the unique workflow name of the workflow that the execution should continue as, for example:
61176106

61186107

61196108
```json
61206109
{
61216110
"end": {
6122-
"continueAs": "myworkflowid"
6111+
"continueAs": "myworkflowname"
61236112
}
61246113
}
61256114
```
61266115

61276116
Defining this should stop the current workflow execution, and continue execution as a new workflow instance of the
6128-
workflow which defines the workflow id of "myworkflowid". The state data where this is define should
6117+
workflow which defines the workflow name of "myworkflowbane". The state data where this is define should
61296118
become the workflow data input of the workflow that is continuing the current workflow execution.
61306119

61316120
Note that any defined `produceEvents` and `compensate` definitions should be honored before `continueAs` is applied.
@@ -6134,7 +6123,7 @@ If `object` type, the `continueAs` property has the following properties:
61346123

61356124
| Parameter | Description | Type | Required |
61366125
| --- | --- | --- | --- |
6137-
| workflowId | Unique id of the workflow to continue execution as. | string | yes |
6126+
| workflowId | Unique name of the workflow to continue execution as. | string | yes |
61386127
| version | Version of the workflow to continue execution as. | string | no |
61396128
| data | If string type, a workflow expression which selects parts of the states data output to become the workflow data input of continued execution. If object type, a custom object to become the workflow data input of the continued execution. | string or object | no |
61406129
| [`workflowExecTimeout`](#Workflow-Timeouts) | Workflow execution timeout to be used by the workflow continuing execution. Overwrites any specific settings set by that workflow. | string or object | no |
@@ -6149,7 +6138,7 @@ in workflow states [Action](#Action-Definition) definitions.
61496138

61506139
Just like "parent" workflows, sub-workflow can also be long-running, and can run into the same type of runtime/serverless platform
61516140
limitations as previously discussed. As such they can also use `continueAs` to stop their current execution and continue it as
6152-
a new one of the same or different workflow id.
6141+
a new one of the same or different workflow name.
61536142

61546143
Note that when a sub-workflow is invoked it can produce a result that is then merged into the parent workflow state data.
61556144
This may bring up a question as to what happens when a sub-workflow calls `continueAs` in terms of what is returned as
@@ -6315,8 +6304,8 @@ Here is an example of metadata attached to the core workflow definition:
63156304

63166305
```json
63176306
{
6318-
"id": "processSalesOrders",
6319-
"name": "Process Sales Orders",
6307+
"name": "processSalesOrders",
6308+
"description": "Process Sales Orders",
63206309
"version": "1.0.0",
63216310
"specVersion": "0.8",
63226311
"start": "MyStartingState",
@@ -6351,8 +6340,8 @@ Implementations may use this keyword to give access to any relevant information
63516340
```json
63526341
63536342
{
6354-
"id": "processSalesOrders",
6355-
"name": "Process Sales Orders",
6343+
"name": "processSalesOrders",
6344+
"description": "Process Sales Orders",
63566345
"version": "1.0.0",
63576346
"specVersion": "0.8",
63586347
"start": "my-starting-state",

0 commit comments

Comments
 (0)