You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dsl-reference.md
+15-15
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ A [workflow](#workflow) serves as a blueprint outlining the series of [tasks](#t
101
101
| document |[`document`](#document)|`yes`| Documents the defined workflow. |
102
102
| input |[`input`](#input)|`no`| Configures the workflow's input. |
103
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). |
104
+
| do |[`map[string, task]`](#task)|`yes`| The [task(s)](#task) that must be performed by the [workflow](#workflow). |
105
105
| 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
106
| output |[`output`](#output)|`no`| Configures the workflow's output. |
107
107
| schedule |[`schedule`](#schedule)|`no`| Configures the workflow's schedule, if any. |
@@ -131,7 +131,7 @@ Defines the workflow's reusable components.
131
131
| authentications |[`map[string, authentication]`](#authentication)|`no`| A name/value mapping of the workflow's reusable authentication policies. |
132
132
| catalogs |[`map[string, catalog]`(#catalog)]|`no`| A name/value mapping of the workflow's reusable resource catalogs. |
133
133
| errors |[`map[string, error]`](#error)|`no`| A name/value mapping of the workflow's reusable errors. |
134
-
| extensions |[`map[string, extension][]`](#extension)|`no`| A list of the workflow's reusable extensions. |
134
+
| extensions |[`map[string, extension]`](#extension)|`no`| A list of the workflow's reusable extensions. |
135
135
| functions |[`map[string, task]`](#task)|`no`| A name/value mapping of the workflow's reusable tasks. |
136
136
| retries |[`map[string, retryPolicy]`](#retry)|`no`| A name/value mapping of the workflow's reusable retry policies. |
137
137
| secrets |`string[]`|`no`| A list containing the workflow's secrets. |
@@ -491,7 +491,7 @@ Serves as a fundamental building block within workflows, enabling the sequential
491
491
492
492
| Name | Type | Required | Description|
493
493
|:--|:---:|:---:|:---|
494
-
| do | [`map[string, task][]`](#task) | `no` | The tasks to perform sequentially. |
494
+
| do | [`map[string, task]`](#task) | `no` | The tasks to perform sequentially. |
495
495
496
496
##### Examples
497
497
@@ -594,7 +594,7 @@ Allows workflows to iterate over a collection of items, executing a defined set
594
594
| for.in | `string` | `yes` | A [runtime expression](dsl.md#runtime-expressions) used to get the collection to enumerate. |
595
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
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. |
597
+
| do | [`map[string, task]`](#task) | `yes` | The [task(s)](#task) to perform for each item in the collection. |
| fork.branches | [`map[string, task][]`](#task) | `no` | The tasks to perform concurrently. |
633
+
| fork.branches | [`map[string, task]`](#task) | `no` | The tasks to perform concurrently. |
634
634
| fork.compete | `boolean` | `no` | Indicates whether or not the concurrent [`tasks`](#task) are racing against each other, with a single possible winner, which sets the composite task's output.<br>*If set to `false`, the task returns an array that includes the outputs from each branch, preserving the order in which the branches are declared.*<br>*If to `true`, the task returns only the output of the winning branch.*<br>*Defaults to `false`.* |
635
635
636
636
##### Examples
@@ -1072,7 +1072,7 @@ Serves as a mechanism within workflows to handle errors gracefully, potentially
1072
1072
1073
1073
| Name | Type | Required | Description|
1074
1074
|:--|:---:|:---:|:---|
1075
-
| try | [`map[string, task][]`](#task) | `yes` | The task(s) to perform. |
1075
+
| try | [`map[string, task]`](#task) | `yes` | The task(s) to perform. |
1076
1076
| catch | [`catch`](#catch) | `yes` | Configures the errors to catch and how to handle them. |
1077
1077
1078
1078
##### Examples
@@ -1120,7 +1120,7 @@ Defines the configuration of a catch clause, which a concept used to catch error
1120
1120
| when | `string`| `no` | A runtime expression used to determine whether or not to catch the filtered error. |
1121
1121
| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to catch the filtered error. |
1122
1122
| retry | `string`<br>[`retryPolicy`](#retry) | `no` | The [`retry policy`](#retry) to use, if any, when catching [`errors`](#error).<br>*If a `string`, must be the name of a [retry policy](#retry) defined in the [workflow's reusable components](#use).* |
1123
-
| do | [`map[string, task][]`](#task) | `no` | The definition of the task(s) to run when catching an error. |
1123
+
| do | [`map[string, task]`](#task) | `no` | The definition of the task(s) to run when catching an error. |
1124
1124
1125
1125
#### Wait
1126
1126
@@ -1153,9 +1153,12 @@ Flow Directives are commands within a workflow that dictate its progression.
1153
1153
| Directive | Description |
1154
1154
| --------- | ----------- |
1155
1155
| `"continue"` | Instructs the workflow to proceed with the next task in line. This action may conclude the execution of a particular workflow or branch if there are not task defined after the continue one. |
1156
-
| `"exit"` | Halts the current branch's execution, potentially terminating the entire workflow if the current task resides within the main branch. |
1156
+
| `"exit"` | Completes the current scope's execution, potentially terminating the entire workflow if the current task resides within the main `do` scope. |
1157
1157
| `"end"` | Provides a graceful conclusion to the workflow execution, signaling its completion explicitly. |
1158
-
| `string` | Continues the workflow at the task with the specified name |
1158
+
| `string` | Continues the workflow at the task with the specified name. |
1159
+
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.
Copy file name to clipboardExpand all lines: dsl.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -241,7 +241,7 @@ Before the workflow starts, the input data provided to the workflow can be valid
241
241
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).
242
242
243
243
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.
245
245
246
246
*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.*
0 commit comments