From 0533865449f5d0b5286ceda1a0deddb81841b934 Mon Sep 17 00:00:00 2001 From: Matthias Pichler Date: Wed, 5 Jun 2024 17:06:22 +0000 Subject: [PATCH] fix: rename name from task Signed-off-by: Matthias Pichler --- dsl-reference.md | 816 ++++++++++++++++++++++++----------------------- 1 file changed, 410 insertions(+), 406 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index c9b256f9..26a41cec 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -4,50 +4,50 @@ - [Abstract](#abstract) - [Definitions](#definitions) - + [Workflow](#workflow) + - [Workflow](#workflow) - [Document](#document) - [Use](#use) - [Schedule](#schedule) - + [Task](#task) + - [Task](#task) - [Call](#call) - + [AsyncAPI](#asyncapi-call) - + [gRPC](#grpc-call) - + [HTTP](#http-call) - + [OpenAPI](#openapi-call) + - [AsyncAPI](#asyncapi-call) + - [gRPC](#grpc-call) + - [HTTP](#http-call) + - [OpenAPI](#openapi-call) - [Composite](#composite) - [Emit](#emit) - [For](#for) - [Listen](#listen) - [Raise](#raise) - [Run](#run) - + [Container](#container-process) - + [Shell](#shell-process) - + [Script](#script-process) - + [Workflow](#workflow-process) + - [Container](#container-process) + - [Shell](#shell-process) + - [Script](#script-process) + - [Workflow](#workflow-process) - [Switch](#switch) - [Set](#set) - [Try](#try) - [Wait](#wait) - + [Flow Directive](#flow-directive) - + [External Resource](#external-resource) - + [Authentication](#authentication) + - [Flow Directive](#flow-directive) + - [External Resource](#external-resource) + - [Authentication](#authentication) - [Basic](#basic-authentication) - [Bearer](#bearer-authentication) - [Certificate](#certificate-authentication) - [Digest](#digest-authentication) - [OAUTH2](#oauth2-authentication) - + [Extension](#extension) - + [Error](#error) + - [Extension](#extension) + - [Error](#error) - [Standard Error Types](#standard-error-types) - + [Event Consumption Strategy](#event-consumption-strategy) - + [Event Filter](#event-filter) - + [Retry](#retry) - + [Input](#input) - + [Output](#output) - + [Timeout](#timeout) - + [Duration](#duration) - + [HTTP Response](#http-response) - + [HTTP Request](#http-request) + - [Event Consumption Strategy](#event-consumption-strategy) + - [Event Filter](#event-filter) + - [Retry](#retry) + - [Input](#input) + - [Output](#output) + - [Timeout](#timeout) + - [Duration](#duration) + - [HTTP Response](#http-response) + - [HTTP Request](#http-request) ## Abstract @@ -61,63 +61,63 @@ A [workflow](#workflow) serves as a blueprint outlining the series of [tasks](#t #### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| document | [`document`](#document) | `yes` | Documents the defined workflow. | -| input | [`input`](#input) | `no` | Configures the workflow's input. | -| use | [`use`](#use) | `no` | Defines the workflow's reusable components, if any. | -| do | [`task`](#task) | `yes` | The [task](#task) that must be performed by the [workflow](#workflow). | -| timeout | [`timeout`](#timeout) | `no` | The configuration, if any, of the workflow's timeout. | -| output | [`output`](#output) | `no` | Configures the workflow's output. | -| schedule | [`schedule`](#schedule) | `no` | Configures the workflow's schedule, if any. | -| evaluate | [`evaluate`](#evaluate) | `no` | Configures runtime expression evaluation. | +| Name | Type | Required | Description | +| :------- | :---------------------: | :------: | :--------------------------------------------------------------------- | +| document | [`document`](#document) | `yes` | Documents the defined workflow. | +| input | [`input`](#input) | `no` | Configures the workflow's input. | +| use | [`use`](#use) | `no` | Defines the workflow's reusable components, if any. | +| do | [`task`](#task) | `yes` | The [task](#task) that must be performed by the [workflow](#workflow). | +| timeout | [`timeout`](#timeout) | `no` | The configuration, if any, of the workflow's timeout. | +| output | [`output`](#output) | `no` | Configures the workflow's output. | +| schedule | [`schedule`](#schedule) | `no` | Configures the workflow's schedule, if any. | +| evaluate | [`evaluate`](#evaluate) | `no` | Configures runtime expression evaluation. | #### Document Documents the workflow definition. -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| dsl | `string` | `yes` | The version of the DSL used to define the workflow. | -| namespace | `string` | `yes` | The workflow's namespace.
| -| name | `string` | `yes` | The workflow's name.
| -| version | `string` | `yes` | The workflow's [semantic version] -| title | `string` | `no` | The workflow's title. | -| summary | `string` | `no` | The workflow's Markdown summary. | -| tags | `map[string, string]` | `no` | A key/value mapping of the workflow's tags, if any. | +| Name | Type | Required | Description | +| :-------- | :-------------------: | :------: | :-------------------------------------------------- | +| dsl | `string` | `yes` | The version of the DSL used to define the workflow. | +| namespace | `string` | `yes` | The workflow's namespace.
| +| name | `string` | `yes` | The workflow's name.
| +| version | `string` | `yes` | The workflow's [semantic version] | +| title | `string` | `no` | The workflow's title. | +| summary | `string` | `no` | The workflow's Markdown summary. | +| tags | `map[string, string]` | `no` | A key/value mapping of the workflow's tags, if any. | #### Use Defines the workflow's reusable components. -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| authentications | [`map[string, authentication]`](#authentication) | `no` | A name/value mapping of the workflow's reusable authentication policies. | -| errors | [`map[string, error]`](#error) | `no` | A name/value mapping of the workflow's reusable errors. | -| extensions | [`map[string, extension][]`](#extension) | `no` | A list of the workflow's reusable extensions. | -| functions | [`map[string, task]`](#task) | `no` | A name/value mapping of the workflow's reusable tasks. | -| retries | [`map[string, retryPolicy]`](#retry) | `no` | A name/value mapping of the workflow's reusable retry policies. | -| secrets | `string[]` | `no` | A list containing the workflow's secrets. | +| Name | Type | Required | Description | +| :-------------- | :----------------------------------------------: | :------: | :----------------------------------------------------------------------- | +| authentications | [`map[string, authentication]`](#authentication) | `no` | A name/value mapping of the workflow's reusable authentication policies. | +| errors | [`map[string, error]`](#error) | `no` | A name/value mapping of the workflow's reusable errors. | +| extensions | [`map[string, extension][]`](#extension) | `no` | A list of the workflow's reusable extensions. | +| functions | [`map[string, task]`](#task) | `no` | A name/value mapping of the workflow's reusable tasks. | +| retries | [`map[string, retryPolicy]`](#retry) | `no` | A name/value mapping of the workflow's reusable retry policies. | +| secrets | `string[]` | `no` | A list containing the workflow's secrets. | #### Schedule Configures the schedule of a workflow. -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| every | [`duration`](#duration) | `no` | Specifies the duration of the interval at which the workflow should be executed. Unlike `after`, this option will run the workflow regardless of whether the previous run is still in progress.
*Required when no other property has been set.* | -| cron | `string` | `no` | Specifies the schedule using a CRON expression, e.g., '0 0 * * *' for daily at midnight.
*Required when no other property has been set.* | -| after | [`duration`](#duration) | `no` | Specifies a delay duration that the workflow must wait before starting again after it completes. In other words, when this workflow completes, it should run again after the specified amount of time.
*Required when no other property has been set.* | -| on | [`eventConsumptionStrategy`](#event-consumption-strategy) | `no` | Specifies the events that trigger the workflow execution.
*Required when no other property has been set.* | +| Name | Type | Required | Description | +| :---- | :-------------------------------------------------------: | :------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| every | [`duration`](#duration) | `no` | Specifies the duration of the interval at which the workflow should be executed. Unlike `after`, this option will run the workflow regardless of whether the previous run is still in progress.
_Required when no other property has been set._ | +| cron | `string` | `no` | Specifies the schedule using a CRON expression, e.g., '0 0 \* \* *' for daily at midnight.
*Required when no other property has been set.\* | +| after | [`duration`](#duration) | `no` | Specifies a delay duration that the workflow must wait before starting again after it completes. In other words, when this workflow completes, it should run again after the specified amount of time.
_Required when no other property has been set._ | +| on | [`eventConsumptionStrategy`](#event-consumption-strategy) | `no` | Specifies the events that trigger the workflow execution.
_Required when no other property has been set._ | #### Evaluate Configures a workflow's runtime expression evaluation. -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| language | `string` | `yes` | The language used for writting runtime expressions.
*Defaults to `jq`.* | -| mode | `string` | `yes` | The runtime expression evaluation mode.
*Supported values are:*
- `strict`: requires all expressions to be enclosed within `${ }` for proper identification and evaluation.
- `loose`: evaluates any value provided. If the evaluation fails, it results in a string with the expression as its content.
*Defaults to `strict`.* +| Name | Type | Required | Description | +| :------- | :------: | :------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| language | `string` | `yes` | The language used for writting runtime expressions.
_Defaults to `jq`._ | +| mode | `string` | `yes` | The runtime expression evaluation mode.
_Supported values are:_
- `strict`: requires all expressions to be enclosed within `${ }` for proper identification and evaluation.
- `loose`: evaluates any value provided. If the evaluation fails, it results in a string with the expression as its content.
_Defaults to `strict`._ | #### Examples @@ -206,11 +206,11 @@ do: ### Task -A task within a [workflow](#workflow) represents a discrete unit of work that contributes to achieving the overall objectives defined by the [workflow](#workflow). +A task within a [workflow](#workflow) represents a discrete unit of work that contributes to achieving the overall objectives defined by the [workflow](#workflow). -It encapsulates a specific action or set of actions that need to be executed in a predefined order to advance the workflow towards its completion. +It encapsulates a specific action or set of actions that need to be executed in a predefined order to advance the workflow towards its completion. -[Tasks](#task) are designed to be modular and focused, each serving a distinct purpose within the broader context of the [workflow](#workflow). +[Tasks](#task) are designed to be modular and focused, each serving a distinct purpose within the broader context of the [workflow](#workflow). By breaking down the [workflow](#workflow) into manageable [tasks](#task), organizations can effectively coordinate and track progress, enabling efficient collaboration and ensuring that work is completed in a structured and organized manner. @@ -222,21 +222,20 @@ The Serverless Workflow DSL defines a list of [tasks](#task) that **must be** su - [For](#for), used to iterate over a collection of items, and conditionally perform a task for each of them. - [Listen](#listen), used to listen for an [event](#event) or more. - [Raise](#raise), used to raise an [error](#error) and potentially fault the [workflow](#workflow). -- [Run](#run), used to run a [container](#container), a [script](#script) or event a [shell](#shell) command. +- [Run](#run), used to run a [container](#container), a [script](#script) or event a [shell](#shell) command. - [Switch](#switch), used to dynamically select and execute one of multiple alternative paths based on specified conditions -- [Set](#set), used to dynamically set or update the [workflow](#workflow)'s data during the its execution. +- [Set](#set), used to dynamically set or update the [workflow](#workflow)'s data during the its execution. - [Try](#try), used to attempt executing a specified [task](#task), and to handle any resulting [errors](#error) gracefully, allowing the [workflow](#workflow) to continue without interruption. - [Wait](#wait), used to pause or wait for a specified duration before proceeding to the next task. #### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| name | `string` | `no` | The name of the task, if any. **SHOULD** be unique within an array. Required if you want to reference the task in [`then`](#flow-directive) | -| input | [`input`](#input) | `no` | An object used to customize the task's input and to document its schema, if any. | -| output | [`output`](#output) | `no` | An object used to customize the task's output and to document its schema, if any. | -| timeout | [`timeout`](#timeout) | `no` | The configuration of the task's timeout, if any. | -| then | [`flowDirective`](#flow-directive) | `no` | The flow directive to execute next.
*If not set, defaults to `continue`.* | +| Name | Type | Required | Description | +| :------ | :--------------------------------: | :------: | :-------------------------------------------------------------------------------- | +| input | [`input`](#input) | `no` | An object used to customize the task's input and to document its schema, if any. | +| output | [`output`](#output) | `no` | An object used to customize the task's output and to document its schema, if any. | +| timeout | [`timeout`](#timeout) | `no` | The configuration of the task's timeout, if any. | +| then | [`flowDirective`](#flow-directive) | `no` | The flow directive to execute next.
_If not set, defaults to `continue`._ | #### Call @@ -244,19 +243,19 @@ Enables the execution of a specified function within a workflow, allowing seamle ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| call | `string` | `yes` | The name of the function to call. | -| with | `map` | `no` | A name/value mapping of the parameters to call the function with | +| Name | Type | Required | Description | +| :--- | :------: | :------: | :--------------------------------------------------------------- | +| call | `string` | `yes` | The name of the function to call. | +| with | `map` | `no` | A name/value mapping of the parameters to call the function with | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: call: http with: @@ -277,24 +276,24 @@ The [AsyncAPI Call](#asyncapi-call) enables workflows to interact with external ###### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| document | [`externalResource`](#external-resource) | `yes` | The AsyncAPI document that defines the operation to call. | -| operationRef | `string` | `yes` | A reference to the AsyncAPI operation to call. | -| server | `string` | `no` | A reference to the server to call the specified AsyncAPI operation on.
If not set, default to the first server matching the operation's channel. | -| message | `string` | `no` | The name of the message to use.
If not set, defaults to the first message defined by the operation. | -| binding | `string` | `no` | The name of the binding to use.
If not set, defaults to the first binding defined by the operation | -| payload | `any` | `no` | The operation's payload, as defined by the configured message | -| authentication | `string`
[`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the AsyncAPI operation. | +| Name | Type | Required | Description | +| :------------- | :---------------------------------------------: | :------: | :-------------------------------------------------------------------------------------------------------------------------------------------------- | +| document | [`externalResource`](#external-resource) | `yes` | The AsyncAPI document that defines the operation to call. | +| operationRef | `string` | `yes` | A reference to the AsyncAPI operation to call. | +| server | `string` | `no` | A reference to the server to call the specified AsyncAPI operation on.
If not set, default to the first server matching the operation's channel. | +| message | `string` | `no` | The name of the message to use.
If not set, defaults to the first message defined by the operation. | +| binding | `string` | `no` | The name of the binding to use.
If not set, defaults to the first binding defined by the operation | +| payload | `any` | `no` | The operation's payload, as defined by the configured message | +| authentication | `string`
[`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the AsyncAPI operation. | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: call: asyncapi with: @@ -313,24 +312,24 @@ The [gRPC Call](#grpc-call) enables communication with external systems via the ###### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| proto | [`externalResource`](#external-resource) | `yes` | The proto resource that describes the GRPC service to call. | -| service.name | `string` | `yes` | The name of the GRPC service to call. | -| service.host | `string` | `yes` | The hostname of the GRPC service to call. | -| service.port | `integer` | `no` | The port number of the GRPC service to call. | -| service.authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the GRPC service. | -| method | `string` | `yes` | The name of the GRPC service method to call. | -| arguments | `map` | `no` | A name/value mapping of the method call's arguments, if any. | +| Name | Type | Required | Description | +| :--------------------- | :--------------------------------------: | :------: | :--------------------------------------------------------------------------------------------------------- | +| proto | [`externalResource`](#external-resource) | `yes` | The proto resource that describes the GRPC service to call. | +| service.name | `string` | `yes` | The name of the GRPC service to call. | +| service.host | `string` | `yes` | The hostname of the GRPC service to call. | +| service.port | `integer` | `no` | The port number of the GRPC service to call. | +| service.authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the GRPC service. | +| method | `string` | `yes` | The name of the GRPC service method to call. | +| arguments | `map` | `no` | A name/value mapping of the method call's arguments, if any. | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: call: grpc with: @@ -350,22 +349,22 @@ The [HTTP Call](#http-call) enables workflows to interact with external services ###### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| method | `string` | `yes` | The HTTP request method. | -| endpoint | [`endpoint`](#endpoint) | `yes` | An URI or an object that describes the HTTP endpoint to call. | -| headers | `map` | `no` | A name/value mapping of the HTTP headers to use, if any. | -| body | `any` | `no` | The HTTP request body, if any. | -| output | `string` | `no` | The http call's output format.
*Supported values are:*
*- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any.*
*- `content`, which outputs the content of [http response](#http-response), possibly deserialized.*
*- `response`, which outputs the [http response](#http-response).*
*Defaults to `content`.* | +| Name | Type | Required | Description | +| :------- | :---------------------: | :------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| method | `string` | `yes` | The HTTP request method. | +| endpoint | [`endpoint`](#endpoint) | `yes` | An URI or an object that describes the HTTP endpoint to call. | +| headers | `map` | `no` | A name/value mapping of the HTTP headers to use, if any. | +| body | `any` | `no` | The HTTP request body, if any. | +| output | `string` | `no` | The http call's output format.
_Supported values are:_
_- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any._
_- `content`, which outputs the content of [http response](#http-response), possibly deserialized._
_- `response`, which outputs the [http response](#http-response)._
_Defaults to `content`._ | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: call: http with: @@ -379,22 +378,22 @@ The [OpenAPI Call](#openapi-call) enables workflows to interact with external se ###### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| document | [`externalResource`](#external-resource) | `yes` | The OpenAPI document that defines the operation to call. | -| operationId | `string` | `yes` | The id of the OpenAPI operation to call. | -| arguments | `map` | `no` | A name/value mapping of the parameters, if any, of the OpenAPI operation to call. | -| authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the OpenAPI operation. | -| output | `string` | `no` | The OpenAPI call's output format.
*Supported values are:*
*- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any.*
*- `content`, which outputs the content of [http response](#http-response), possibly deserialized.*
*- `response`, which outputs the [http response](#http-response).*
*Defaults to `content`.* | +| Name | Type | Required | Description | +| :------------- | :--------------------------------------: | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| document | [`externalResource`](#external-resource) | `yes` | The OpenAPI document that defines the operation to call. | +| operationId | `string` | `yes` | The id of the OpenAPI operation to call. | +| arguments | `map` | `no` | A name/value mapping of the parameters, if any, of the OpenAPI operation to call. | +| authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the OpenAPI operation. | +| output | `string` | `no` | The OpenAPI call's output format.
_Supported values are:_
_- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any._
_- `content`, which outputs the content of [http response](#http-response), possibly deserialized._
_- `response`, which outputs the [http response](#http-response)._
_Defaults to `content`._ | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: call: openapi with: @@ -406,25 +405,26 @@ do: #### Composite - Serves as a pivotal orchestrator within workflow systems, enabling the seamless integration and execution of multiple subtasks to accomplish complex operations. By encapsulating and coordinating various subtasks, this task type facilitates the efficient execution of intricate workflows. +Serves as a pivotal orchestrator within workflow systems, enabling the seamless integration and execution of multiple subtasks to accomplish complex operations. By encapsulating and coordinating various subtasks, this task type facilitates the efficient execution of intricate workflows. ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| execute.sequentially | [`map[string, task][]`](#task) | `no` | The tasks to perform sequentially.
*Required if `execute.concurrently` has not been set, otherwise ignored.*
*If set, must contains **at least** two [`tasks`](#task).* | -| execute.concurrently | [`map[string, task][]`](#task) | `no` | The tasks to perform concurrently.
*Required if `execute.sequentially` has not been set, otherwise ignored.*
*If set, must contains **at least** two [`tasks`](#task).* | -| execute.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.
*Ignored if `execute.sequentially` has been set. Defaults to `false`.*
*Must **not** be set if the [`tasks`](#task) are executed sequentially.* | +| Name | Type | Required | Description | +| :------------------- | :----------------------------: | :------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| execute.sequentially | [`map[string, task][]`](#task) | `no` | The tasks to perform sequentially.
_Required if `execute.concurrently` has not been set, otherwise ignored._
_If set, must contains **at least** two [`tasks`](#task)._ | +| execute.concurrently | [`map[string, task][]`](#task) | `no` | The tasks to perform concurrently.
_Required if `execute.sequentially` has not been set, otherwise ignored._
_If set, must contains **at least** two [`tasks`](#task)._ | +| execute.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.
_Ignored if `execute.sequentially` has been set. Defaults to `false`._
_Must **not** be set if the [`tasks`](#task) are executed sequentially._ | ##### Examples -*Executing tasks sequentially:* +_Executing tasks sequentially:_ + ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: execute: sequentially: @@ -432,7 +432,7 @@ do: call: http with: method: post - endpoint: + endpoint: uri: https://fake-booking-agency.com/hotels/book authentication: fake-booking-agency-oauth2 body: @@ -443,33 +443,34 @@ do: call: http with: method: post - endpoint: + endpoint: uri: https://fake-booking-agency.com/flights/book authentication: fake-booking-agency-oauth2 body: departure: - date: '01/01/26' - time: '07:25:00' + date: "01/01/26" + time: "07:25:00" from: airport: BRU city: Zaventem country: Belgium arrival: - date: '01/01/26' - time: '11:12:00' + date: "01/01/26" + time: "11:12:00" to: airport: LIS city: Lisbon country: Portugal ``` -*Executing tasks concurrently:* +_Executing tasks concurrently:_ + ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: execute: concurrently: @@ -497,18 +498,18 @@ Allows workflows to publish events to event brokers or messaging systems, facili ##### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| emit.event | [`event`](#event) | `yes` | Defines the event to emit. | +| Name | Type | Required | Description | +| :--------- | :---------------: | :------: | :------------------------- | +| emit.event | [`event`](#event) | `yes` | Defines the event to emit. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: emit: event: @@ -520,8 +521,8 @@ do: firstName: Cruella lastName: de Vil items: - - breed: dalmatian - quantity: 101 + - breed: dalmatian + quantity: 101 ``` #### For @@ -530,22 +531,22 @@ Allows workflows to iterate over a collection of items, executing a defined set ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| for.each | `string` | `no` | The name of the variable used to store the current item being enumerated.
Defaults to `item`. | -| for.in | `string` | `yes` | A [runtime expression](#runtime-expressions) used to get the collection to enumerate. | -| for.at | `string` | `no` | The name of the variable used to store the index of the current item being enumerated.
Defaults to `index`. | -| while | `string` | `no` | A [runtime expression](#runtime-expressions) that represents the condition, if any, that must be met for the iteration to continue. | -| do | [`task`](#task) | `yes` | The task to perform for each item in the collection. | +| Name | Type | Required | Description | +| :------- | :-------------: | :------: | :---------------------------------------------------------------------------------------------------------------------------------- | +| for.each | `string` | `no` | The name of the variable used to store the current item being enumerated.
Defaults to `item`. | +| for.in | `string` | `yes` | A [runtime expression](#runtime-expressions) used to get the collection to enumerate. | +| for.at | `string` | `no` | The name of the variable used to store the index of the current item being enumerated.
Defaults to `index`. | +| while | `string` | `no` | A [runtime expression](#runtime-expressions) that represents the condition, if any, that must be met for the iteration to continue. | +| do | [`task`](#task) | `yes` | The task to perform for each item in the collection. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: for: each: pet @@ -559,39 +560,39 @@ do: with: type: com.fake.petclinic.pets.checkup.completed.v2 output: - to: '.pets + [{ "id": $pet.id }]' + to: '.pets + [{ "id": $pet.id }]' ``` #### Listen -Provides a mechanism for workflows to await and react to external events, enabling event-driven behavior within workflow systems. +Provides a mechanism for workflows to await and react to external events, enabling event-driven behavior within workflow systems. ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| listen.to | [`eventConsumptionStrategy`](#event-consumption-strategy) | `yes` | Configures the event(s) the workflow must listen to. | +| Name | Type | Required | Description | +| :-------- | :-------------------------------------------------------: | :------: | :--------------------------------------------------- | +| listen.to | [`eventConsumptionStrategy`](#event-consumption-strategy) | `yes` | Configures the event(s) the workflow must listen to. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: listen: to: any: - - with: - type: com.fake-hospital.vitals.measurements.temperature - data: - temperature: ${ .temperature > 38 } - - with: - type: com.fake-hospital.vitals.measurements.bpm - data: - temperature: ${ .bpm < 60 or .bpm > 100 } + - with: + type: com.fake-hospital.vitals.measurements.temperature + data: + temperature: ${ .temperature > 38 } + - with: + type: com.fake-hospital.vitals.measurements.bpm + data: + temperature: ${ .bpm < 60 or .bpm > 100 } ``` #### Raise @@ -600,18 +601,18 @@ Intentionally triggers and propagates errors. By employing the "Raise" task, wor ##### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| raise.error | [`error`](#error) | `yes` | Defines the error to raise. | +| Name | Type | Required | Description | +| :---------- | :---------------: | :------: | :-------------------------- | +| raise.error | [`error`](#error) | `yes` | Defines the error to raise. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: execute: sequentially: @@ -645,21 +646,21 @@ Provides the capability to execute external [containers](#container-process), [s ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| run.container | [`container`](#container-process) | `no` | The definition of the container to run.
*Required if `script`, `shell` and `workflow` have not been set.* | -| run.script | [`script`](#script-process) | `no` | The definition of the script to run.
*Required if `container`, `shell` and `workflow` have not been set.* | -| run.shell | [`shell`](#shell-process) | `no` | The definition of the shell command to run.
*Required if `container`, `script` and `workflow` have not been set.* | -| run.workflow | [`workflow`](#workflow-process) | `no` | The definition of the workflow to run.
*Required if `container`, `script` and `shell` have not been set.* | +| Name | Type | Required | Description | +| :------------ | :-------------------------------: | :------: | :------------------------------------------------------------------------------------------------------------------- | +| run.container | [`container`](#container-process) | `no` | The definition of the container to run.
_Required if `script`, `shell` and `workflow` have not been set._ | +| run.script | [`script`](#script-process) | `no` | The definition of the script to run.
_Required if `container`, `shell` and `workflow` have not been set._ | +| run.shell | [`shell`](#shell-process) | `no` | The definition of the shell command to run.
_Required if `container`, `script` and `workflow` have not been set._ | +| run.workflow | [`workflow`](#workflow-process) | `no` | The definition of the workflow to run.
_Required if `container`, `script` and `shell` have not been set._ | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: execute: sequentially: @@ -693,22 +694,22 @@ Enables the execution of external processes encapsulated within a containerized ###### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| image | `string` | `yes` | The name of the container image to run | -| command | `string` | `no` | The command, if any, to execute on the container | -| ports | `map` | `no` | The container's port mappings, if any | -| volumes | `map` | `no` | The container's volume mappings, if any | -| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | +| Name | Type | Required | Description | +| :---------- | :------: | :------: | :--------------------------------------------------------------------------------------------------- | +| image | `string` | `yes` | The name of the container image to run | +| command | `string` | `no` | The command, if any, to execute on the container | +| ports | `map` | `no` | The container's port mappings, if any | +| volumes | `map` | `no` | The container's volume mappings, if any | +| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: run: container: @@ -721,21 +722,21 @@ Enables the execution of custom scripts or code within a workflow, empowering wo ###### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| language | `string` | `yes` | The language of the script to run | -| code | `string` | `no` | The script's code.
*Required if `source` has not been set.* | -| source | [externalResource](#external-resource) | `no` | The script's resource.
*Required if `code` has not been set.* | -| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | +| Name | Type | Required | Description | +| :---------- | :------------------------------------: | :------: | :--------------------------------------------------------------------------------------------------- | +| language | `string` | `yes` | The language of the script to run | +| code | `string` | `no` | The script's code.
_Required if `source` has not been set._ | +| source | [externalResource](#external-resource) | `no` | The script's resource.
_Required if `code` has not been set._ | +| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: run: script: @@ -750,20 +751,20 @@ Enables the execution of shell commands within a workflow, enabling workflows to ###### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| command | `string` | `yes` | The shell command to run | -| arguments | `map` | `no` | A list of the arguments of the shell command to run | -| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | +| Name | Type | Required | Description | +| :---------- | :------: | :------: | :--------------------------------------------------------------------------------------------------- | +| command | `string` | `yes` | The shell command to run | +| arguments | `map` | `no` | A list of the arguments of the shell command to run | +| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: run: shell: @@ -776,20 +777,20 @@ Enables the invocation and execution of nested workflows within a parent workflo ###### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| name | `string` | `yes` | The name of the workflow to run | -| version | `string` | `yes` | The version of the workflow to run. Defaults to `latest` | -| input | `any` | `no` | The data, if any, to pass as input to the workflow to execute. The value should be validated against the target workflow's input schema, if specified | +| Name | Type | Required | Description | +| :------ | :------: | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | `string` | `yes` | The name of the workflow to run | +| version | `string` | `yes` | The version of the workflow to run. Defaults to `latest` | +| input | `any` | `no` | The data, if any, to pass as input to the workflow to execute. The value should be validated against the target workflow's input schema, if specified | ###### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: run: workflow: @@ -804,9 +805,9 @@ A task used to set data. ##### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| set | `object` | `yes` | A name/value mapping of the data to set. | +| Name | Type | Required | Description | +| :--- | :------: | :------: | :--------------------------------------- | +| set | `object` | `yes` | A name/value mapping of the data to set. | ##### Examples @@ -815,7 +816,7 @@ document: dsl: 1.0.0-alpha1 namespace: default name: set - version: '0.1.0' + version: "0.1.0" do: set: shape: circle @@ -829,18 +830,18 @@ Enables conditional branching within workflows, allowing them to dynamically sel ##### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| switch | [`case[]`](#switch-case) | `yes` | A name/value map of the cases to switch on | +| Name | Type | Required | Description | +| :----- | :----------------------: | :------: | :----------------------------------------- | +| switch | [`case[]`](#switch-case) | `yes` | A name/value map of the cases to switch on | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: execute: sequentially: @@ -878,11 +879,11 @@ do: Defines a switch case, encompassing of a condition for matching and an associated action to execute upon a match. -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| name | `string` | `no` | The name of the case, if any. | -| when | `string` | `no` | A runtime expression used to determine whether or not the case matches.
*If not set, the case will be matched by default if no other case match.*
*Note that there can be only one default case, all others **MUST** set a condition.* -| then | [`flowDirective`](#flow-directive) | `yes` | The flow directive to execute when the case matches. | +| Name | Type | Required | Description | +| :--- | :--------------------------------: | :------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| name | `string` | `no` | The name of the case, if any. | +| when | `string` | `no` | A runtime expression used to determine whether or not the case matches.
_If not set, the case will be matched by default if no other case match._
_Note that there can be only one default case, all others **MUST** set a condition._ | +| then | [`flowDirective`](#flow-directive) | `yes` | The flow directive to execute when the case matches. | #### Try @@ -890,19 +891,19 @@ Serves as a mechanism within workflows to handle errors gracefully, potentially ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| try | [`task`](#task) | `yes` | The task(s) to perform. | -| catch | [`catch`](#catch) | `yes` | Configures the errors to catch and how to handle them. | +| Name | Type | Required | Description | +| :---- | :---------------: | :------: | :----------------------------------------------------- | +| try | [`task`](#task) | `yes` | The task(s) to perform. | +| catch | [`catch`](#catch) | `yes` | Configures the errors to catch and how to handle them. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: try: call: http @@ -931,14 +932,14 @@ Defines the configuration of a catch clause, which a concept used to catch error ###### Properties -| Name | Type | Required | Description | -|:--|:---:|:---:|:---| -| errors | [`errorFilter`](#retry) | `no` | The definition of the errors to catch | -| as | `string` | `no` | The name of the runtime expression variable to save the error as. Defaults to 'error'. | -| when | `string`| `no` | A runtime expression used to determine whether or not to catch the filtered error | -| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to catch the filtered error | -| retry | [`retryPolicy`](#retry) | `no` | The retry policy to use, if any, when catching errors | -| do | [`task`](#task) | `no` | The definition of the task to run when catching an error | +| Name | Type | Required | Description | +| :--------- | :---------------------: | :------: | :------------------------------------------------------------------------------------- | +| errors | [`errorFilter`](#retry) | `no` | The definition of the errors to catch | +| as | `string` | `no` | The name of the runtime expression variable to save the error as. Defaults to 'error'. | +| when | `string` | `no` | A runtime expression used to determine whether or not to catch the filtered error | +| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to catch the filtered error | +| retry | [`retryPolicy`](#retry) | `no` | The retry policy to use, if any, when catching errors | +| do | [`task`](#task) | `no` | The definition of the task to run when catching an error | #### Wait @@ -946,18 +947,18 @@ Allows workflows to pause or delay their execution for a specified period of tim ##### Properties -| Name | Type | Required | Description| -|:--|:---:|:---:|:---| -| wait | `string`
[`duration`](#duration) | `yes` | The amount of time to wait.
If a `string`, must be a valid [ISO 8601](#) duration expression. | +| Name | Type | Required | Description | +| :--- | :---------------------------------: | :------: | :----------------------------------------------------------------------------------------------- | +| wait | `string`
[`duration`](#duration) | `yes` | The amount of time to wait.
If a `string`, must be a valid [ISO 8601](#) duration expression. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: wait: seconds: 10 @@ -967,12 +968,12 @@ do: Flow Directives are commands within a workflow that dictate its progression. -| Directive | Description | -| --------- | ----------- | +| Directive | Description | +| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `"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. | -| `"exit"` | Halts the current branch's execution, potentially terminating the entire workflow if the current task resides within the main branch. | -| `"end"` | Provides a graceful conclusion to the workflow execution, signaling its completion explicitly. | -| `string` | Continues the workflow at the task with the specified name | +| `"exit"` | Halts the current branch's execution, potentially terminating the entire workflow if the current task resides within the main branch. | +| `"end"` | Provides a graceful conclusion to the workflow execution, signaling its completion explicitly. | +| `string` | Continues the workflow at the task with the specified name | ### External Resource @@ -980,11 +981,11 @@ Defines an external resource. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| name | `string` | `no` | The name, if any, of the defined resource. | -| uri | `string` | `yes` | The URI at which to get the defined resource. | -| authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when fecthing the resource. | +| Property | Type | Required | Description | +| -------------- | :---------------------------------: | :------: | ------------------------------------------------------------------------------------------------------- | +| name | `string` | `no` | The name, if any, of the defined resource. | +| uri | `string` | `yes` | The URI at which to get the defined resource. | +| authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when fecthing the resource. | ##### Examples @@ -1003,22 +1004,22 @@ Defines the mechanism used to authenticate users and workflows attempting to acc #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| basic | [`basicAuthentication`](#basic-authentication) | `no` | The `basic` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | -| bearer | [`bearerAuthentication`](#bearer-authentication) | `no` | The `bearer` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | -| certificate | [`certificateAuthentication`](#certificate-authentication) | `no` | The `certificate` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | -| digest | [`digestAuthentication`](#digest-authentication) | `no` | The `digest` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | -| oauth2 | [`oauth2`](#oauth2-authentication) | `no` | The `oauth2` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | +| Property | Type | Required | Description | +| ----------- | :--------------------------------------------------------: | :------: | ------------------------------------------------------------------------------------------------------------------------- | +| basic | [`basicAuthentication`](#basic-authentication) | `no` | The `basic` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | +| bearer | [`bearerAuthentication`](#bearer-authentication) | `no` | The `bearer` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | +| certificate | [`certificateAuthentication`](#certificate-authentication) | `no` | The `certificate` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | +| digest | [`digestAuthentication`](#digest-authentication) | `no` | The `digest` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | +| oauth2 | [`oauth2`](#oauth2-authentication) | `no` | The `oauth2` authentication scheme to use, if any.
Required if no other property has been set, otherwise ignored. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" use: secrets: usernamePasswordSecret: {} @@ -1029,7 +1030,7 @@ do: call: http with: method: get - endpoint: + endpoint: uri: https://secured.fake.com/sample authentication: sampleBasicFromSecret ``` @@ -1040,19 +1041,19 @@ Defines the fundamentals of a 'basic' authentication. ##### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| username | `string` | `yes` | The username to use. | -| password | `string` | `yes` | The password to use. | +| Property | Type | Required | Description | +| -------- | :------: | :------: | -------------------- | +| username | `string` | `yes` | The username to use. | +| password | `string` | `yes` | The password to use. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" use: authentication: sampleBasic: @@ -1063,7 +1064,7 @@ do: call: http with: method: get - endpoint: + endpoint: uri: https://secured.fake.com/sample authentication: sampleBasic ``` @@ -1074,23 +1075,23 @@ Defines the fundamentals of a 'bearer' authentication ##### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| token | `string` | `yes` | The bearer token to use. | +| Property | Type | Required | Description | +| -------- | :------: | :------: | ------------------------ | +| token | `string` | `yes` | The bearer token to use. | ##### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" do: call: http with: method: get - endpoint: + endpoint: uri: https://secured.fake.com/sample authentication: bearer: @@ -1099,28 +1100,26 @@ do: #### Certificate Authentication - #### Digest Authentication - #### OAUTH2 Authentication Defines the fundamentals of an 'oauth2' authentication ##### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| authority | `string` | `yes` | The URI that references the OAuth2 authority to use. | -| grant | `string` | `yes` | The grant type to use. -| client.id | `string` | `yes` | The client id to use. | -| client.secret | `string` | `no` | The client secret to use, if any. | -| scopes | `string[]` | `no` | The scopes, if any, to request the token for. | -| audiences | `string[]` | `no` | The audiences, if any, to request the token for. | -| username | `string` | `no` | The username to use. Used only if the grant type is `Password`. | -| password | `string` | `no` | The password to use. Used only if the grant type is `Password`. | -| subject | [`oauth2Token`](#oauth2-token) | `no` | The security token that represents the identity of the party on behalf of whom the request is being made. | -| actor | [`oauth2Token`](#oauth2-token) | `no` | The security token that represents the identity of the acting party. | +| Property | Type | Required | Description | +| ------------- | :----------------------------: | :------: | --------------------------------------------------------------------------------------------------------- | +| authority | `string` | `yes` | The URI that references the OAuth2 authority to use. | +| grant | `string` | `yes` | The grant type to use. | +| client.id | `string` | `yes` | The client id to use. | +| client.secret | `string` | `no` | The client secret to use, if any. | +| scopes | `string[]` | `no` | The scopes, if any, to request the token for. | +| audiences | `string[]` | `no` | The audiences, if any, to request the token for. | +| username | `string` | `no` | The username to use. Used only if the grant type is `Password`. | +| password | `string` | `no` | The password to use. Used only if the grant type is `Password`. | +| subject | [`oauth2Token`](#oauth2-token) | `no` | The security token that represents the identity of the party on behalf of whom the request is being made. | +| actor | [`oauth2Token`](#oauth2-token) | `no` | The security token that represents the identity of the acting party. | ##### Examples @@ -1134,7 +1133,7 @@ do: call: http with: method: get - endpoint: + endpoint: uri: https://secured.fake.com/sample authentication: oauth2: @@ -1153,10 +1152,10 @@ Represents the definition of an OAUTH2 token ###### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| token | `string` | `yes` | The security token to use to use. | -| type | `string` | `yes` | The type of security token to use. | +| Property | Type | Required | Description | +| -------- | :------: | :------: | ---------------------------------- | +| token | `string` | `yes` | The security token to use to use. | +| type | `string` | `yes` | The type of security token to use. | ### Extension @@ -1166,16 +1165,17 @@ Extensions enable the execution of tasks prior to those they extend, offering th #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| extend | `string` | `yes` | The type of task to extend
Supported values are: `call`, `composite`, `emit`, `extension`, `for`, `listen`, `raise`, `run`, `set`, `switch`, `try`, `wait` and `all` | -| when | `string` | `no` | A runtime expression used to determine whether or not the extension should apply in the specified context | -| before | [`task`](#task) | `no` | The task to execute, if any, before the extended task | -| after | [`task`](#task) | `no` | The task to execute, if any, after the extended task | +| Property | Type | Required | Description | +| -------- | :-------------: | :------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| extend | `string` | `yes` | The type of task to extend
Supported values are: `call`, `composite`, `emit`, `extension`, `for`, `listen`, `raise`, `run`, `set`, `switch`, `try`, `wait` and `all` | +| when | `string` | `no` | A runtime expression used to determine whether or not the extension should apply in the specified context | +| before | [`task`](#task) | `no` | The task to execute, if any, before the extended task | +| after | [`task`](#task) | `no` | The task to execute, if any, after the extended task | #### Examples -*Perform logging before and after any non-extension task is run:* +_Perform logging before and after any non-extension task is run:_ + ```yaml document: dsl: '1.0.0-alpha1' @@ -1207,13 +1207,14 @@ do: endpoint: https://fake.com/sample ``` -*Intercept HTTP calls to 'https://mocked.service.com' and mock its response:* +_Intercept HTTP calls to 'https://mocked.service.com' and mock its response:_ + ```yaml -document: - dsl: '1.0.0-alpha1' +document: + dsl: "1.0.0-alpha1" namespace: test name: sample-workflow - version: '0.1.0' + version: "0.1.0" use: extensions: - mockService: @@ -1241,13 +1242,13 @@ Defines the [Problem Details RFC](https://datatracker.ietf.org/doc/html/rfc7807) #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| type | `string` | `yes` | A URI reference that identifies the [`error`](#error) type.
For cross-compatibility concerns, it is strongly recommended to use [Standard Error Types](#standard-error-types) whenever possible.
Runtimes **MUST** ensure that the property has been set when raising or escalating the [`error`](#error). | -| status | `integer` | `yes` | The status code generated by the origin for this occurrence of the [`error`](#error).
For cross-compatibility concerns, it is strongly recommended to use [HTTP Status Codes](https://datatracker.ietf.org/doc/html/rfc7231#section-6) whenever possible.
Runtimes **MUST** ensure that the property has been set when raising or escalating the [`error`](#error). | -| instance | `string` | `yes` | A [JSON Pointer](https://datatracker.ietf.org/doc/html/rfc6901) used to reference the component the [`error`](#error) originates from.
Runtimes **MUST** set the property when raising or escalating the [`error`](#error). Otherwise ignore. | -| title | `string` | `no` | A short, human-readable summary of the [`error`](#error). | -| detail | `string` | `no` | A human-readable explanation specific to this occurrence of the [`error`](#error). | +| Property | Type | Required | Description | +| -------- | :-------: | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| type | `string` | `yes` | A URI reference that identifies the [`error`](#error) type.
For cross-compatibility concerns, it is strongly recommended to use [Standard Error Types](#standard-error-types) whenever possible.
Runtimes **MUST** ensure that the property has been set when raising or escalating the [`error`](#error). | +| status | `integer` | `yes` | The status code generated by the origin for this occurrence of the [`error`](#error).
For cross-compatibility concerns, it is strongly recommended to use [HTTP Status Codes](https://datatracker.ietf.org/doc/html/rfc7231#section-6) whenever possible.
Runtimes **MUST** ensure that the property has been set when raising or escalating the [`error`](#error). | +| instance | `string` | `yes` | A [JSON Pointer](https://datatracker.ietf.org/doc/html/rfc6901) used to reference the component the [`error`](#error) originates from.
Runtimes **MUST** set the property when raising or escalating the [`error`](#error). Otherwise ignore. | +| title | `string` | `no` | A short, human-readable summary of the [`error`](#error). | +| detail | `string` | `no` | A human-readable explanation specific to this occurrence of the [`error`](#error). | #### Examples @@ -1261,18 +1262,18 @@ status: 503 Standard error types serve the purpose of categorizing errors consistently across different runtimes, facilitating seamless migration from one runtime environment to another. -| Type | Status¹ | Description | -|------|:-------:|-------------| -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/configuration](#) | `400` | Errors resulting from incorrect or invalid configuration settings, such as missing or misconfigured environment variables, incorrect parameter values, or configuration file errors. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/validation](#) | `400` | Errors arising from validation processes, such as validation of input data, schema validation failures, or validation constraints not being met. These errors indicate that the provided data or configuration does not adhere to the expected format or requirements specified by the workflow. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/expression](#) | `400` | Errors occurring during the evaluation of runtime expressions, such as invalid syntax or unsupported operations. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/authentication](#) | `401` | Errors related to authentication failures. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/authorization](#) | `403` | Errors related to unauthorized access attempts or insufficient permissions to perform certain actions within the workflow. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/timeout](#) | `408` | Errors caused by timeouts during the execution of tasks or during interactions with external services. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/communication](#) | `500` | Errors encountered while communicating with external services, including network errors, service unavailable, or invalid responses. | -| [https://https://serverlessworkflow.io/spec/1.0.0/errors/runtime](#) | `500` | Errors occurring during the runtime execution of a workflow, including unexpected exceptions, errors related to resource allocation, or failures in handling workflow tasks. These errors typically occur during the actual execution of workflow components and may require runtime-specific handling and resolution strategies. | +| Type | Status¹ | Description | +| --------------------------------------------------------------------------- | :-----: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/configuration](#) | `400` | Errors resulting from incorrect or invalid configuration settings, such as missing or misconfigured environment variables, incorrect parameter values, or configuration file errors. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/validation](#) | `400` | Errors arising from validation processes, such as validation of input data, schema validation failures, or validation constraints not being met. These errors indicate that the provided data or configuration does not adhere to the expected format or requirements specified by the workflow. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/expression](#) | `400` | Errors occurring during the evaluation of runtime expressions, such as invalid syntax or unsupported operations. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/authentication](#) | `401` | Errors related to authentication failures. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/authorization](#) | `403` | Errors related to unauthorized access attempts or insufficient permissions to perform certain actions within the workflow. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/timeout](#) | `408` | Errors caused by timeouts during the execution of tasks or during interactions with external services. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/communication](#) | `500` | Errors encountered while communicating with external services, including network errors, service unavailable, or invalid responses. | +| [https://https://serverlessworkflow.io/spec/1.0.0/errors/runtime](#) | `500` | Errors occurring during the runtime execution of a workflow, including unexpected exceptions, errors related to resource allocation, or failures in handling workflow tasks. These errors typically occur during the actual execution of workflow components and may require runtime-specific handling and resolution strategies. | -¹ *Default value. The `status code` that best describe the error should always be used.* +¹ _Default value. The `status code` that best describe the error should always be used._ ### Event Consumption Strategy @@ -1280,11 +1281,11 @@ Represents the configuration of an event consumption strategy. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| all | [`eventFilter[]`](#event-filter) | `no` | Configures the workflow to wait for all defined events before resuming execution.
*Required if `any` and `one` have not been set.* | -| any | [`eventFilter[]`](#event-filter) | `no` | Configures the workflow to wait for any of the defined events before resuming execution.
*Required if `all` and `one` have not been set.* | -| one | [`eventFilter`](#event-filter) | `no` | Configures the workflow to wait for the defined event before resuming execution.
*Required if `all` and `any` have not been set.* | +| Property | Type | Required | Description | +| -------- | :------------------------------: | :------: | -------------------------------------------------------------------------------------------------------------------------------------------- | +| all | [`eventFilter[]`](#event-filter) | `no` | Configures the workflow to wait for all defined events before resuming execution.
_Required if `any` and `one` have not been set._ | +| any | [`eventFilter[]`](#event-filter) | `no` | Configures the workflow to wait for any of the defined events before resuming execution.
_Required if `all` and `one` have not been set._ | +| one | [`eventFilter`](#event-filter) | `no` | Configures the workflow to wait for the defined event before resuming execution.
_Required if `all` and `any` have not been set._ | ### Event Filter @@ -1292,10 +1293,10 @@ An event filter is a mechanism used to selectively process or handle events base #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| with | `object` | `yes` | A name/value mapping of the attributes filtered events must define. Supports both regular expressions and runtime expressions. | -| correlate | [`map[string, correlation]`](#correlation) | `no` | A name/definition mapping of the correlations to attempt when filtering events. | +| Property | Type | Required | Description | +| --------- | :----------------------------------------: | :------: | ------------------------------------------------------------------------------------------------------------------------------ | +| with | `object` | `yes` | A name/value mapping of the attributes filtered events must define. Supports both regular expressions and runtime expressions. | +| correlate | [`map[string, correlation]`](#correlation) | `no` | A name/definition mapping of the correlations to attempt when filtering events. | ### Correlation @@ -1303,10 +1304,10 @@ A correlation is a link between events and data, established by mapping event at #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| from | `string` | `yes` | A runtime expression used to extract the correlation value from the filtered event. | -| expect | `string` | `no` | A constant or a runtime expression, if any, used to determine whether or not the extracted correlation value matches expectations.
If not set, the first extracted value will be used as the correlation's expectation. | +| Property | Type | Required | Description | +| -------- | :------: | :------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| from | `string` | `yes` | A runtime expression used to extract the correlation value from the filtered event. | +| expect | `string` | `no` | A constant or a runtime expression, if any, used to determine whether or not the extracted correlation value matches expectations.
If not set, the first extracted value will be used as the correlation's expectation. | ### Retry @@ -1314,42 +1315,42 @@ The Retry is a fundamental concept in the Serverless Workflow DSL, used to defin #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| when | `string` | `no` | A a runtime expression used to determine whether or not to retry running the task, in a given context. | -| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to retry running the task, in a given context. | -| limit | [`retry`](#retry-limit) | `no` | The limits, if any, to impose to the retry policy. | -| backoff | [`backoff`](#backoff) | `no` | The backoff strategy to use, if any. | -| jitter | [`jitter`](#jitter) | `no` | The parameters, if any, that control the randomness or variability of the delay between retry attempts. | +| Property | Type | Required | Description | +| ---------- | :---------------------: | :------: | ------------------------------------------------------------------------------------------------------- | +| when | `string` | `no` | A a runtime expression used to determine whether or not to retry running the task, in a given context. | +| exceptWhen | `string` | `no` | A runtime expression used to determine whether or not to retry running the task, in a given context. | +| limit | [`retry`](#retry-limit) | `no` | The limits, if any, to impose to the retry policy. | +| backoff | [`backoff`](#backoff) | `no` | The backoff strategy to use, if any. | +| jitter | [`jitter`](#jitter) | `no` | The parameters, if any, that control the randomness or variability of the delay between retry attempts. | #### Retry Limit The definition of a retry policy. -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| attempt.count | `integer` | `no` | The maximum attempts count. | -| attempt.duration | [`duration`](#duration) | `no` | The duration limit, if any, for all retry attempts. | -| duration | [`duration`](#duration) | `no` | The maximum duration, if any, during which to retry a given task. | +| Property | Type | Required | Description | +| ---------------- | :---------------------: | :------: | ----------------------------------------------------------------- | +| attempt.count | `integer` | `no` | The maximum attempts count. | +| attempt.duration | [`duration`](#duration) | `no` | The duration limit, if any, for all retry attempts. | +| duration | [`duration`](#duration) | `no` | The maximum duration, if any, during which to retry a given task. | #### Backoff The definition of a retry backoff strategy. -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| constant | `object` | `no` | The definition of the constant backoff to use, if any.
*Required if `exponential` and `linear` are not set, otherwise ignored.* | -| exponential | `object` | `no` | The definition of the exponential backoff to use, if any.
*Required if `constant` and `linear` are not set, otherwise ignored.* | -| linear | `object` | `no` | The definition of the linear backoff to use, if any.
*Required if `constant` and `exponential` are not set, otherwise ignored.* | +| Property | Type | Required | Description | +| ----------- | :------: | :------: | ---------------------------------------------------------------------------------------------------------------------------------- | +| constant | `object` | `no` | The definition of the constant backoff to use, if any.
_Required if `exponential` and `linear` are not set, otherwise ignored._ | +| exponential | `object` | `no` | The definition of the exponential backoff to use, if any.
_Required if `constant` and `linear` are not set, otherwise ignored._ | +| linear | `object` | `no` | The definition of the linear backoff to use, if any.
_Required if `constant` and `exponential` are not set, otherwise ignored._ | #### Jitter Represents the definition of the parameters that control the randomness or variability of a delay, typically between retry attempts -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| from | [`duration`](#duration) | `yes` | The minimum duration of the jitter range. | -| to | [`duration`](#duration) | `yes` | The maximum duration of the jitter range. | +| Property | Type | Required | Description | +| -------- | :---------------------: | :------: | ----------------------------------------- | +| from | [`duration`](#duration) | `yes` | The minimum duration of the jitter range. | +| to | [`duration`](#duration) | `yes` | The maximum duration of the jitter range. | #### Examples @@ -1367,10 +1368,10 @@ When set, runtimes must validate input data against the defined schema, unless d #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| schema | [`schema`](#schema) | `no` | The [`schema`](#schema) used to describe and validate input data.
*Even though the schema is not required, it is strongly encouraged to document it, whenever feasible.* | -| from | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to filter and/or mutate the workflow/task input. | +| Property | Type | Required | Description | +| -------- | :------------------: | :------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| schema | [`schema`](#schema) | `no` | The [`schema`](#schema) used to describe and validate input data.
_Even though the schema is not required, it is strongly encouraged to document it, whenever feasible._ | +| from | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to filter and/or mutate the workflow/task input. | #### Examples @@ -1382,7 +1383,7 @@ schema: properties: petId: type: string - required: [ petId ] + required: [petId] from: .order.pet ``` @@ -1396,11 +1397,11 @@ When set, runtimes must validate output data against the defined schema, unless #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| schema | [`schema`](#schema) | `no` | The [`schema`](#schema) used to describe and validate output data.
*Even though the schema is not required, it is strongly encouraged to document it, whenever feasible.* | -| from | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to filter and/or mutate the workflow/task output. | -| to | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to update the context, using both output and context data. | +| Property | Type | Required | Description | +| -------- | :------------------: | :------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| schema | [`schema`](#schema) | `no` | The [`schema`](#schema) used to describe and validate output data.
_Even though the schema is not required, it is strongly encouraged to document it, whenever feasible._ | +| from | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to filter and/or mutate the workflow/task output. | +| to | `string`
`object` | `no` | A [runtime expression](#runtime-expressions), if any, used to update the context, using both output and context data. | #### Examples @@ -1412,10 +1413,10 @@ schema: properties: petId: type: string - required: [ petId ] + required: [petId] from: - petId: '${ .pet.id }' -to: '.petList += [ . ]' + petId: "${ .pet.id }" +to: ".petList += [ . ]" ``` ### Schema @@ -1424,15 +1425,16 @@ Describes a data schema. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| format | `string` | `yes` | The schema format.
*Supported values are:*
*- `json`, which indicates the [JsonSchema](https://json-schema.org/) format.* | -| document | `object` | `no` | The inline schema document.
*Required if `resource` has not been set, otherwise ignored.* | -| resource | [`externalResource`](#external-resource) | `no` | The schema external resource.
*Required if `document` has not been set, otherwise ignored.* | +| Property | Type | Required | Description | +| -------- | :--------------------------------------: | :------: | ------------------------------------------------------------------------------------------------------------------------------- | +| format | `string` | `yes` | The schema format.
_Supported values are:_
_- `json`, which indicates the [JsonSchema](https://json-schema.org/) format._ | +| document | `object` | `no` | The inline schema document.
_Required if `resource` has not been set, otherwise ignored._ | +| resource | [`externalResource`](#external-resource) | `no` | The schema external resource.
_Required if `document` has not been set, otherwise ignored._ | #### Examples -*Example of an inline JsonSchema:* +_Example of an inline JsonSchema:_ + ```yaml format: json document: @@ -1444,10 +1446,11 @@ document: type: string lastName: type: string - required: [ id, firstName, lastName ] + required: [id, firstName, lastName] ``` -*Example of a JsonSchema based on an external resource:* +_Example of a JsonSchema based on an external resource:_ + ```yaml format: json resource: @@ -1460,18 +1463,18 @@ Defines a workflow or task timeout. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| after | [`duration`](#duration) | `yes` | The duration after which the workflow or task times out. | +| Property | Type | Required | Description | +| -------- | :---------------------: | :------: | -------------------------------------------------------- | +| after | [`duration`](#duration) | `yes` | The duration after which the workflow or task times out. | #### Examples ```yaml document: - dsl: '1.0.0-alpha1' + dsl: "1.0.0-alpha1" namespace: default name: sample - version: '0.1.0' + version: "0.1.0" do: wait: seconds: 60 @@ -1486,17 +1489,18 @@ Defines a duration. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| Days | `integer` | `no` | Number of days, if any. | -| Hours | `integer` | `no` | Number of hours, if any. | -| Minutes | `integer` | `no`| Number of minutes, if any. | -| Seconds | `integer` | `no`| Number of seconds, if any. | -| Milliseconds | `integer` | `no`| Number of milliseconds, if any. | +| Property | Type | Required | Description | +| ------------ | :-------: | :------: | ------------------------------- | +| Days | `integer` | `no` | Number of days, if any. | +| Hours | `integer` | `no` | Number of hours, if any. | +| Minutes | `integer` | `no` | Number of minutes, if any. | +| Seconds | `integer` | `no` | Number of seconds, if any. | +| Milliseconds | `integer` | `no` | Number of milliseconds, if any. | #### Examples -*Example of a duration of 2 hours, 15 minutes and 30 seconds:* +_Example of a duration of 2 hours, 15 minutes and 30 seconds:_ + ```yaml hours: 2 minutes: 15 @@ -1509,12 +1513,12 @@ Describes an HTTP response. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| request | [`request`](#http-request) | `yes` | The HTTP request associated with the HTTP response. | -| statusCode | `integer` | `yes` | The HTTP response status code. | -| headers | `map[string, string]` | `no` | The HTTP response headers, if any. | -| content | `any` | `no` | The HTTP response content, if any.
*If the request's content type is one of the following, should contain the deserialized response content. Otherwise, should contain the base-64 encoded response content, if any.*| +| Property | Type | Required | Description | +| ---------- | :------------------------: | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| request | [`request`](#http-request) | `yes` | The HTTP request associated with the HTTP response. | +| statusCode | `integer` | `yes` | The HTTP response status code. | +| headers | `map[string, string]` | `no` | The HTTP response headers, if any. | +| content | `any` | `no` | The HTTP response content, if any.
_If the request's content type is one of the following, should contain the deserialized response content. Otherwise, should contain the base-64 encoded response content, if any._ | #### Examples @@ -1539,11 +1543,11 @@ Describes an HTTP request. #### Properties -| Property | Type | Required | Description | -|----------|:----:|:--------:|-------------| -| method | `string` | `yes` | The request's method. | -| uri | `uri` | `yes` | The request's URI. | -| headers | `map[string, string]` | `no` | The HTTP request headers, if any. | +| Property | Type | Required | Description | +| -------- | :-------------------: | :------: | --------------------------------- | +| method | `string` | `yes` | The request's method. | +| uri | `uri` | `yes` | The request's URI. | +| headers | `map[string, string]` | `no` | The HTTP request headers, if any. | #### Examples @@ -1552,4 +1556,4 @@ method: get uri: https://petstore.swagger.io/v2/pet/1 headers: Content-Type: application/json -``` \ No newline at end of file +```