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
@@ -230,9 +231,9 @@ The Serverless Workflow DSL defines a list of [tasks](#task) that **must be** su
230
231
- [Call](#call), used to call services and/or functions.
231
232
- [Do](#do), used to define one or more subtasks to perform in sequence.
232
233
- [Fork](#fork), used to define one or more subtasks to perform concurrently.
233
-
- [Emit](#emit), used to emit [events](#event).
234
+
- [Emit](#emit), used to emit [events](#event-properties).
234
235
- [For](#for), used to iterate over a collection of items, and conditionally perform a task for each of them.
235
-
- [Listen](#listen), used to listen for an [event](#event) or more.
236
+
- [Listen](#listen), used to listen for an [event](#event-properties) or more.
236
237
- [Raise](#raise), used to raise an [error](#error) and potentially fault the [workflow](#workflow).
237
238
- [Run](#run), used to run a [container](#container-process), a [script](#script-process) , a [shell](#shell-process) command or even another [workflow](#workflow-process).
238
239
- [Switch](#switch), used to dynamically select and execute one of multiple alternative paths based on specified conditions
@@ -369,7 +370,7 @@ The [HTTP Call](#http-call) enables workflows to interact with external services
| endpoint | [`endpoint`](#endpoint) | `yes` | An URI or an object that describes the HTTP endpoint to call. |
373
+
| endpoint | `string`\|[`endpoint`](#endpoint) | `yes` | An URI or an object that describes the HTTP endpoint to call. |
373
374
| headers | `map` | `no` | A name/value mapping of the HTTP headers to use, if any. |
374
375
| body | `any` | `no` | The HTTP request body, if any. |
375
376
| query | `map[string, any]` | `no` | A name/value mapping of the query parameters to use, if any. |
@@ -496,7 +497,7 @@ Allows workflows to publish events to event brokers or messaging systems, facili
496
497
497
498
| Name | Type | Required | Description |
498
499
|:--|:---:|:---:|:---|
499
-
| emit.event | [`event`](#event) | `yes` | Defines the event to emit. |
500
+
| emit.event | [`eventProperties`](#event-properties) | `yes` | Defines the event to emit. |
500
501
501
502
##### Examples
502
503
@@ -510,15 +511,16 @@ do:
510
511
- emitEvent:
511
512
emit:
512
513
event:
513
-
source: https://petstore.com
514
-
type: com.petstore.order.placed.v1
515
-
data:
516
-
client:
517
-
firstName: Cruella
518
-
lastName: de Vil
519
-
items:
520
-
- breed: dalmatian
521
-
quantity: 101
514
+
with:
515
+
source: https://petstore.com
516
+
type: com.petstore.order.placed.v1
517
+
data:
518
+
client:
519
+
firstName: Cruella
520
+
lastName: de Vil
521
+
items:
522
+
- breed: dalmatian
523
+
quantity: 101
522
524
```
523
525
524
526
#### For
@@ -530,9 +532,9 @@ Allows workflows to iterate over a collection of items, executing a defined set
530
532
| Name | Type | Required | Description|
531
533
|:--|:---:|:---:|:---|
532
534
| for.each | `string` | `no` | The name of the variable used to store the current item being enumerated.<br>Defaults to `item`. |
533
-
| for.in | `string` | `yes` | A [runtime expression](./dsl.md/#runtime-expressions) used to get the collection to enumerate. |
535
+
| for.in | `string` | `yes` | A [runtime expression](dsl.md#runtime-expressions) used to get the collection to enumerate. |
534
536
| for.at | `string` | `no` | The name of the variable used to store the index of the current item being enumerated.<br>Defaults to `index`. |
535
-
| 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. |
537
+
| 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. |
536
538
| do | [`task`](#task) | `yes` | The task to perform for each item in the collection. |
537
539
538
540
##### Examples
@@ -968,7 +970,7 @@ do:
968
970
969
971
##### Switch Case
970
972
971
-
Defines a switch case, encompassing of a condition for matching and an associated action to execute upon a match.
973
+
Defines a switch case, encompassing a condition for matching and an associated action to execute upon a match.
972
974
973
975
| Name | Type | Required | Description |
974
976
|:--|:---:|:---:|:---|
@@ -1393,6 +1395,28 @@ Represents the configuration of an event consumption strategy.
1393
1395
| any | [`eventFilter[]`](#event-filter) | `no` | Configures the workflow to wait for any of the defined events before resuming execution.<br>*Required if `all` and `one` have not been set.* |
1394
1396
| one | [`eventFilter`](#event-filter) | `no` | Configures the workflow to wait for the defined event before resuming execution.<br>*Required if `all` and `any` have not been set.* |
1395
1397
1398
+
### Event Properties
1399
+
1400
+
An event object typically includes details such as the event type, source, timestamp, and unique identifier along with any relevant data payload. The [Cloud Events specification](https://cloudevents.io/), favored by Serverless Workflow, standardizes this structure to ensure interoperability across different systems and services.
1401
+
1402
+
#### Properties
1403
+
1404
+
| Property | Type | Required | Description |
1405
+
|----------|:----:|:--------:|-------------|
1406
+
| id | `string` | `no` | Identifies the event. `source` + `id` is unique for each distinct event.<br>*Required when emitting an event using `emit.event.with`.* |
1407
+
| source | `string` | `no` | An URI formatted string, or [runtime expression](dsl.md#runtime-expressions), that identifies the context in which an event happened. `source` + `id` is unique for each distinct event.<br>*Required when emitting an event using `emit.event.with`.* |
1408
+
| type | `string` | `no` | Describes the type of event related to the originating occurrence.<br>*Required when emitting an event using `emit.event.with`.* |
1409
+
| time | `string` | `no` | A string, or [runtime expression](dsl.md#runtime-expressions), representing the timestamp of when the occurrence happened. |
1410
+
| subject | `string` | `no` | Describes the subject of the event in the context of the event producer. |
1411
+
| datacontenttype | `string` | `no` | Content type of `data` value. If omitted, it implies the `data` is a JSON value conforming to the "application/json" media type. |
1412
+
| dataschema | `string` | `no` | An URI formatted string, or [runtime expression](dsl.md#runtime-expressions), that identifies the schema that `data` adheres to. |
1413
+
| data | `object` | `no` | The event payload. |
1414
+
1415
+
*Additional properties can be supplied, see the Cloud Events specification [documentation](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#extension-context-attributes) for more info.*
1416
+
1417
+
*When used in an [`eventFilter`](#event-filter), at least one property must be supplied.*
1418
+
1419
+
1396
1420
### Event Filter
1397
1421
1398
1422
An event filter is a mechanism used to selectively process or handle events based on predefined criteria, such as event type, source, or specific attributes.
@@ -1401,7 +1425,7 @@ An event filter is a mechanism used to selectively process or handle events base
1401
1425
1402
1426
| Property | Type | Required | Description |
1403
1427
|----------|:----:|:--------:|-------------|
1404
-
| with | `object` | `yes` | A name/value mapping of the attributes filtered events must define. Supports both regular expressions and runtime expressions. |
1428
+
| with | [`eventProperties`](#event-properties) | `yes` | A name/value mapping of the attributes filtered events must define. Supports both regular expressions and runtime expressions. |
1405
1429
| correlate | [`map[string, correlation]`](#correlation) | `no` | A name/definition mapping of the correlations to attempt when filtering events. |
1406
1430
1407
1431
### Correlation
@@ -1477,7 +1501,7 @@ When set, runtimes must validate input data against the defined schema, unless d
1477
1501
| Property | Type | Required | Description |
1478
1502
|----------|:----:|:--------:|-------------|
1479
1503
| 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.* |
1480
-
| from | `string`<br>`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to filter and/or mutate the workflow/task input. |
1504
+
| from | `string`<br>`object` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to filter and/or mutate the workflow/task input. |
1481
1505
1482
1506
#### Examples
1483
1507
@@ -1506,7 +1530,7 @@ When set, runtimes must validate output data against the defined schema, unless
1506
1530
| Property | Type | Required | Description |
1507
1531
|----------|:----:|:--------:|-------------|
1508
1532
| schema | [`schema`](#schema) | `no` | The [`schema`](#schema) used to describe and validate output data.<br>*Even though the schema is not required, it is strongly encouraged to document it, whenever feasible.* |
1509
-
| as | `string`<br>`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to filter and/or mutate the workflow/task output. |
1533
+
| as | `string`<br>`object` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to filter and/or mutate the workflow/task output. |
1510
1534
1511
1535
#### Examples
1512
1536
@@ -1640,6 +1664,17 @@ minutes: 15
1640
1664
seconds: 30
1641
1665
```
1642
1666
1667
+
### Endpoint
1668
+
1669
+
Describes an enpoint.
1670
+
1671
+
#### Properties
1672
+
1673
+
| Property | Type | Required | Description |
1674
+
|----------|:----:|:--------:|-------------|
1675
+
| uri | `string` | `yes` | The endpoint's URI. |
1676
+
| authentication | `[authentication](#authentication)` | `no` | The authentication policy to use. |
Copy file name to clipboardExpand all lines: dsl.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ Workflows in the Serverless Workflow DSL can exist in several phases, each indic
81
81
82
82
Additionally, the flow of execution within a workflow can be controlled using [directives*](dsl-reference.md#flow-directive), which provide instructions to the workflow engine on how to manage and handle specific aspects of workflow execution.
83
83
84
-
**To learn more about flow directives and how they can be utilized to control the execution and behavior of workflows, please refer to [Flow Directives](dsl-reference.md#flow-directive).*
84
+
\**To learn more about flow directives and how they can be utilized to control the execution and behavior of workflows, please refer to [Flow Directives](dsl-reference.md#flow-directive).*
85
85
86
86
#### Components
87
87
@@ -102,14 +102,14 @@ The Serverless Workflow DSL defines several default [task](dsl-reference.md#task
102
102
103
103
-[Call](dsl-reference.md#call), used to call services and/or functions.
104
104
-[Do](dsl-reference.md#do), used to define one or more subtasks to perform in sequence.
105
-
-[Fork](dsl-reference.md#fork), used to define one or more two subtasks to perform in parallel.
106
105
-[Emit](dsl-reference.md#emit), used to emit [events](dsl-reference.md#event).
107
106
-[For](dsl-reference.md#for), used to iterate over a collection of items, and conditionally perform a task for each of them.
107
+
-[Fork](dsl-reference.md#fork), used to define one or more two subtasks to perform in parallel.
108
108
-[Listen](dsl-reference.md#listen), used to listen for an [event](dsl-reference.md#event) or more.
109
109
-[Raise](dsl-reference.md#raise), used to raise an [error](dsl-reference.md#error) and potentially fault the [workflow](dsl-reference.md#workflow).
110
110
-[Run](dsl-reference.md#run), used to run a [container](dsl-reference.md#container-process), a [script](dsl-reference.md#script-process), a [shell](dsl-reference.md#shell-process) command or even another [workflow](dsl-reference.md#workflow-process).
111
-
-[Switch](dsl-reference.md#switch), used to dynamically select and execute one of multiple alternative paths based on specified conditions
112
111
-[Set](dsl-reference.md#set), used to dynamically set or update the [workflow](dsl-reference.md#workflow)'s data during the its execution.
112
+
-[Switch](dsl-reference.md#switch), used to dynamically select and execute one of multiple alternative paths based on specified conditions
113
113
-[Try](dsl-reference.md#try), used to attempt executing a specified [task](dsl-reference.md#task), and to handle any resulting [errors](dsl-reference.md#error) gracefully, allowing the [workflow](dsl-reference.md#workflow) to continue without interruption.
114
114
-[Wait](dsl-reference.md#wait), used to pause or wait for a specified duration before proceeding to the next task.
115
115
@@ -138,7 +138,7 @@ A workflow begins with the first task defined.
138
138
139
139
Once the task has been executed, different things can happen:
140
140
141
-
-`continue`: the task ran to completion, and the next task, if any, should be executed. The task to run next is implictly the next in declaration order, or explicitly defined by the `then` property of the executed task. If the executed task is the last task, then the workflow's execution gracefully ends.
141
+
-`continue`: the task ran to completion, and the next task, if any, should be executed. The task to run next is implicitly the next in declaration order, or explicitly defined by the `then` property of the executed task. If the executed task is the last task, then the workflow's execution gracefully ends.
142
142
-`fault`: the task raised an uncaught error, which abruptly halts the workflow's execution and makes it transition to `faulted`[status phase](#status-phases).
143
143
-`end`: the task explicitly and gracefully ends the workflow's execution.
description: Identifies the context in which an event happened
377
-
oneOf:
378
-
- title: LiteralSource
379
-
type: string
380
-
format: uri-template
381
-
- $ref: '#/$defs/runtimeExpression'
382
-
type:
383
-
type: string
384
-
description: This attribute contains a value describing the type of event related to the originating occurrence.
385
-
time:
386
-
oneOf:
387
-
- title: LiteralTime
388
-
type: string
389
-
format: date-time
390
-
- $ref: '#/$defs/runtimeExpression'
391
-
subject:
392
-
type: string
393
-
datacontenttype:
394
-
type: string
395
-
description: Content type of data value. This attribute enables data to carry any type of content, whereby format and encoding might differ from that of the chosen event format.
396
-
dataschema:
397
-
oneOf:
398
-
- title: LiteralDataSchema
399
-
type: string
400
-
format: uri-template
401
-
- $ref: '#/$defs/runtimeExpression'
402
-
required: [ source, type ]
373
+
with:
374
+
$ref: '#/$defs/eventProperties'
375
+
required: [ source, type ]
403
376
additionalProperties: true
404
377
required: [ event ]
405
378
forTask:
@@ -857,6 +830,40 @@ $defs:
857
830
$ref: '#/$defs/referenceableAuthenticationPolicy'
858
831
description: The authentication policy to use.
859
832
required: [ uri ]
833
+
eventProperties:
834
+
type: object
835
+
properties:
836
+
id:
837
+
type: string
838
+
description: The event's unique identifier
839
+
source:
840
+
description: Identifies the context in which an event happened
841
+
oneOf:
842
+
- title: LiteralSource
843
+
type: string
844
+
format: uri-template
845
+
- $ref: '#/$defs/runtimeExpression'
846
+
type:
847
+
type: string
848
+
description: This attribute contains a value describing the type of event related to the originating occurrence.
849
+
time:
850
+
oneOf:
851
+
- title: LiteralTime
852
+
type: string
853
+
format: date-time
854
+
- $ref: '#/$defs/runtimeExpression'
855
+
subject:
856
+
type: string
857
+
datacontenttype:
858
+
type: string
859
+
description: Content type of data value. This attribute enables data to carry any type of content, whereby format and encoding might differ from that of the chosen event format.
860
+
dataschema:
861
+
oneOf:
862
+
- title: LiteralDataSchema
863
+
type: string
864
+
format: uri-template
865
+
- $ref: '#/$defs/runtimeExpression'
866
+
additionalProperties: true
860
867
eventConsumptionStrategy:
861
868
type: object
862
869
unevaluatedProperties: false
@@ -889,28 +896,8 @@ $defs:
889
896
properties:
890
897
with:
891
898
title: WithEvent
892
-
type: object
899
+
$ref: '#/$defs/eventProperties'
893
900
minProperties: 1
894
-
properties:
895
-
id:
896
-
type: string
897
-
description: The event's unique identifier
898
-
source:
899
-
type: string
900
-
description: Identifies the context in which an event happened
901
-
type:
902
-
type: string
903
-
description: This attribute contains a value describing the type of event related to the originating occurrence.
904
-
time:
905
-
type: string
906
-
subject:
907
-
type: string
908
-
datacontenttype:
909
-
type: string
910
-
description: Content type of data value. This attribute enables data to carry any type of content, whereby format and encoding might differ from that of the chosen event format.
911
-
dataschema:
912
-
type: string
913
-
additionalProperties: true
914
901
description: An event filter is a mechanism used to selectively process or handle events based on predefined criteria, such as event type, source, or specific attributes.
0 commit comments