Skip to content

Commit b44177f

Browse files
authored
Merge branch 'main' into feat-add-await-run
2 parents 0e7b3a5 + fbcd135 commit b44177f

File tree

7 files changed

+165
-56
lines changed

7 files changed

+165
-56
lines changed

dsl-reference.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ A [workflow](#workflow) serves as a blueprint outlining the series of [tasks](#t
7373
| input | [`input`](#input) | `no` | Configures the workflow's input. |
7474
| use | [`use`](#use) | `no` | Defines the workflow's reusable components, if any. |
7575
| do | [`map[string, task][]`](#task) | `yes` | The [task(s)](#task) that must be performed by the [workflow](#workflow). |
76-
| timeout | [`timeout`](#timeout) | `no` | The configuration, if any, of the workflow's timeout. |
76+
| 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).* |
7777
| output | [`output`](#output) | `no` | Configures the workflow's output. |
7878
| schedule | [`schedule`](#schedule) | `no` | Configures the workflow's schedule, if any. |
7979
| evaluate | [`evaluate`](#evaluate) | `no` | Configures runtime expression evaluation. |
@@ -105,6 +105,7 @@ Defines the workflow's reusable components.
105105
| functions | [`map[string, task]`](#task) | `no` | A name/value mapping of the workflow's reusable tasks. |
106106
| retries | [`map[string, retryPolicy]`](#retry) | `no` | A name/value mapping of the workflow's reusable retry policies. |
107107
| secrets | `string[]` | `no` | A list containing the workflow's secrets. |
108+
| timeouts | [`map[string, timeout]`](#timeout) | `no` | A name/value mapping of the workflow's reusable timeouts. |
108109

109110
#### Schedule
110111

@@ -252,7 +253,7 @@ The Serverless Workflow DSL defines a list of [tasks](#task) that **must be** su
252253
| input | [`input`](#input) | `no` | An object used to customize the task's input and to document its schema, if any. |
253254
| output | [`output`](#output) | `no` | An object used to customize the task's output and to document its schema, if any. |
254255
| export | [`export`](#export) | `no` | An object used to customize the content of the workflow context. |
255-
| timeout | [`timeout`](#timeout) | `no` | The configuration of the task's timeout, if any. |
256+
| timeout | `string`<br>[`timeout`](#timeout) | `no` | The configuration of the task's timeout, if any.<br>*If a `string`, must be the name of a [timeout](#timeout) defined in the [workflow's reusable components](#use).* |
256257
| then | [`flowDirective`](#flow-directive) | `no` | The flow directive to execute next.<br>*If not set, defaults to `continue`.* |
257258
| metadata | `map` | `no` | Additional information about the task. |
258259

@@ -653,7 +654,7 @@ Intentionally triggers and propagates errors. By employing the "Raise" task, wor
653654

654655
| Name | Type | Required | Description |
655656
|:--|:---:|:---:|:---|
656-
| raise.error | [`error`](#error) | `yes` | Defines the error to raise. |
657+
| raise.error | `string`<br>[`error`](#error) | `yes` | Defines the [error](#error) to raise.<br>*If a `string`, must be the name of an [error](#error) defined in the [workflow's reusable components](#use).* |
657658

658659
##### Examples
659660

@@ -1036,12 +1037,12 @@ Defines the configuration of a catch clause, which a concept used to catch error
10361037

10371038
| Name | Type | Required | Description |
10381039
|:--|:---:|:---:|:---|
1039-
| errors | [`errorFilter`](#retry) | `no` | The definition of the errors to catch |
1040+
| errors | [`errorFilter`](#retry) | `no` | The definition of the errors to catch. |
10401041
| as | `string` | `no` | The name of the runtime expression variable to save the error as. Defaults to 'error'. |
1041-
| when | `string`| `no` | A runtime expression used to determine whether or not to catch the filtered error |
1042-
| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to catch the filtered error |
1043-
| retry | [`retryPolicy`](#retry) | `no` | The retry policy to use, if any, when catching errors |
1044-
| do | [`map[string, task][]`](#task) | `no` | The definition of the task(s) to run when catching an error |
1042+
| when | `string`| `no` | A runtime expression used to determine whether or not to catch the filtered error. |
1043+
| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to catch the filtered error. |
1044+
| 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).* |
1045+
| do | [`map[string, task][]`](#task) | `no` | The definition of the task(s) to run when catching an error. |
10451046

10461047
#### Wait
10471048

@@ -1590,17 +1591,17 @@ Represents the definition of the parameters that control the randomness or varia
15901591

15911592
### Input
15921593

1593-
Documents the structure - and optionally configures the filtering of - workflow/task input data.
1594+
Documents the structure - and optionally configures the transformation of - workflow/task input data.
15941595

15951596
It's crucial for authors to document the schema of input data whenever feasible. This documentation empowers consuming applications to provide contextual auto-suggestions when handling runtime expressions.
15961597

1597-
When set, runtimes must validate input data against the defined schema, unless defined otherwise.
1598+
When set, runtimes must validate raw input data against the defined schema before applying transformations, unless defined otherwise.
15981599

15991600
#### Properties
16001601

16011602
| Property | Type | Required | Description |
16021603
|----------|:----:|:--------:|-------------|
1603-
| schema | [`schema`](#schema) | `no` | The [`schema`](#schema) used to describe and validate input data.<br>*Even though the schema is not required, it is strongly encouraged to document it, whenever feasible.* |
1604+
| schema | [`schema`](#schema) | `no` | The [`schema`](#schema) used to describe and validate raw input data.<br>*Even though the schema is not required, it is strongly encouraged to document it, whenever feasible.* |
16041605
| from | `string`<br>`object` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to filter and/or mutate the workflow/task input. |
16051606

16061607
#### Examples
@@ -1611,9 +1612,16 @@ schema:
16111612
document:
16121613
type: object
16131614
properties:
1614-
petId:
1615-
type: string
1616-
required: [ petId ]
1615+
order:
1616+
type: object
1617+
required: [ pet ]
1618+
properties:
1619+
pet:
1620+
type: object
1621+
required: [ id ]
1622+
properties:
1623+
id:
1624+
type: string
16171625
from: .order.pet
16181626
```
16191627

@@ -1623,7 +1631,7 @@ Documents the structure - and optionally configures the transformations of - wor
16231631

16241632
It's crucial for authors to document the schema of output data whenever feasible. This documentation empowers consuming applications to provide contextual auto-suggestions when handling runtime expressions.
16251633

1626-
When set, runtimes must validate output data against the defined schema, unless defined otherwise.
1634+
When set, runtimes must validate output data against the defined schema after applying transformations, unless defined otherwise.
16271635

16281636
#### Properties
16291637

@@ -1646,16 +1654,13 @@ output:
16461654
required: [ petId ]
16471655
as:
16481656
petId: '${ .pet.id }'
1649-
export:
1650-
as:
1651-
'.petList += [ $task.output ]'
16521657
```
16531658

16541659
### Export
16551660

1656-
Certain task needs to set the workflow context to save the task output for later usage. Users set the content of the context through a runtime expression. The result of the expression is the new value of the context. The expression is evaluated against the existing context.
1661+
Certain task needs to set the workflow context to save the task output for later usage. Users set the content of the context through a runtime expression. The result of the expression is the new value of the context. The expression is evaluated against the transformed task output.
16571662

1658-
Optionally, the context might have an associated schema.
1663+
Optionally, the context might have an associated schema which is validated against the result of the expression.
16591664

16601665
#### Properties
16611666

@@ -1669,13 +1674,13 @@ Optionally, the context might have an associated schema.
16691674
Merge the task output into the current context.
16701675

16711676
```yaml
1672-
as: '.+$output'
1677+
as: '$context+.'
16731678
```
16741679

16751680
Replace the context with the task output.
16761681

16771682
```yaml
1678-
as: $output
1683+
as: '.'
16791684
```
16801685

16811686
### Schema

0 commit comments

Comments
 (0)