Skip to content

Commit c4a5f94

Browse files
committed
fix(dsl): fix a few issues in dsl and dsl-reference
Signed-off-by: Gilles Barbier <gilles@infinitic.io>
1 parent 77fb2c7 commit c4a5f94

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

.DS_Store

8 KB
Binary file not shown.

dsl-reference.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@ A [workflow](#workflow) serves as a blueprint outlining the series of [tasks](#t
9696

9797
#### Properties
9898

99-
| Name | Type | Required | Description|
100-
|:--|:---:|:---:|:---|
101-
| document | [`document`](#document) | `yes` | Documents the defined workflow. |
102-
| input | [`input`](#input) | `no` | Configures the workflow's input. |
103-
| use | [`use`](#use) | `no` | Defines the workflow's reusable components, if any. |
104-
| do | [`map[string, task][]`](#task) | `yes` | The [task(s)](#task) that must be performed by the [workflow](#workflow). |
99+
| Name | Type | Required | Description|
100+
|:--|:---------------------------------:|:---:|:---|
101+
| document | [`document`](#document) | `yes` | Documents the defined workflow. |
102+
| input | [`input`](#input) | `no` | Configures the workflow's input. |
103+
| use | [`use`](#use) | `no` | Defines the workflow's reusable components, if any. |
104+
| do | [`map[string, task`](#task) | `yes` | The [task(s)](#task) that must be performed by the [workflow](#workflow). |
105105
| timeout | `string`<br>[`timeout`](#timeout) | `no` | The configuration, if any, of the workflow's timeout.<br>*If a `string`, must be the name of a [timeout](#timeout) defined in the [workflow's reusable components](#use).* |
106-
| output | [`output`](#output) | `no` | Configures the workflow's output. |
107-
| schedule | [`schedule`](#schedule) | `no` | Configures the workflow's schedule, if any. |
108-
| evaluate | [`evaluate`](#evaluate) | `no` | Configures runtime expression evaluation. |
106+
| output | [`output`](#output) | `no` | Configures the workflow's output. |
107+
| schedule | [`schedule`](#schedule) | `no` | Configures the workflow's schedule, if any. |
108+
| evaluate | [`evaluate`](#evaluate) | `no` | Configures runtime expression evaluation. |
109109

110110
#### Document
111111

@@ -588,13 +588,13 @@ Allows workflows to iterate over a collection of items, executing a defined set
588588

589589
##### Properties
590590

591-
| Name | Type | Required | Description|
592-
|:--|:---:|:---:|:---|
593-
| for.each | `string` | `no` | The name of the variable used to store the current item being enumerated.<br>Defaults to `item`. |
594-
| for.in | `string` | `yes` | A [runtime expression](dsl.md#runtime-expressions) used to get the collection to enumerate. |
595-
| for.at | `string` | `no` | The name of the variable used to store the index of the current item being enumerated.<br>Defaults to `index`. |
596-
| while | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions) that represents the condition, if any, that must be met for the iteration to continue. |
597-
| do | [`task`](#task) | `yes` | The task to perform for each item in the collection. |
591+
| Name | Type | Required | Description|
592+
|:--|:----------------------------:|:---:|:---|
593+
| for.each | `string` | `no` | The name of the variable used to store the current item being enumerated.<br>Defaults to `item`. |
594+
| for.in | `string` | `yes` | A [runtime expression](dsl.md#runtime-expressions) used to get the collection to enumerate. |
595+
| for.at | `string` | `no` | The name of the variable used to store the index of the current item being enumerated.<br>Defaults to `index`. |
596+
| while | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions) that represents the condition, if any, that must be met for the iteration to continue. |
597+
| do | [`map[string, task]`](#task) | `yes` | The [task(s)](#task) to perform for each item in the collection. |
598598

599599
##### Examples
600600

@@ -1157,6 +1157,9 @@ Flow Directives are commands within a workflow that dictate its progression.
11571157
| `"end"` | Provides a graceful conclusion to the workflow execution, signaling its completion explicitly. |
11581158
| `string` | Continues the workflow at the task with the specified name |
11591159

1160+
> [!WARNING]
1161+
> Flow directives may only redirect to tasks declared within their own scope. In other words, they cannot target tasks at a different depth.
1162+
11601163
### Lifecycle Events
11611164

11621165
Lifecycle events are [cloud events](https://github.com/cloudevents/spec) used to notify users and external services about key state changes in workflows and tasks.
@@ -1540,9 +1543,6 @@ updatedAt: '2024-07-26T16:59:57-05:00'
15401543
status: completed
15411544
```
15421545

1543-
> [!WARNING]
1544-
> Flow directives may only redirect to tasks declared within their own scope. In other words, they cannot target tasks at a different depth.
1545-
15461546
### External Resource
15471547

15481548
Defines an external resource.

dsl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Before the workflow starts, the input data provided to the workflow can be valid
241241
The execution only proceeds if the input is valid. Otherwise, it will fault with a [ValidationError (https://serverlessworkflow.io/spec/1.0.0/errors/validation)](dsl-reference.md#error).
242242

243243
2. **Transform Workflow Input**
244-
Before the workflow starts, the input data provided to the workflow can be transformed to ensure only relevant data in the expected format is passed into the workflow context. This can be done using the top level `input.from` expression. It evaluates on the raw workflow input and defaults to the identity expression which leaves the input unchanged. This step allows the workflow to start with a clean and focused dataset, reducing potential overhead and complexity in subsequent tasks. The result of this expression will set as the initial value for the `$context` runtime expression argument and be passed to the first task.
244+
Before the workflow starts, the input data provided to the workflow can be transformed to ensure only relevant data in the expected format is passed into the workflow context. This can be done using the top level `input.from` expression. It evaluates on the raw workflow input and defaults to the identity expression which leaves the input unchanged. This step allows the workflow to start with a clean and focused dataset, reducing potential overhead and complexity in subsequent tasks. The result of this expression will set as the initial value for the `$input` runtime expression argument and be passed to the first task.
245245

246246
*Example: If the workflow receives a JSON object as input, a transformation can be applied to remove unnecessary fields and retain only those that are required for the workflow's execution.*
247247

0 commit comments

Comments
 (0)