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
This document provides comprehensive definitions and detailed property tables for all the concepts discussed in the Serverless Workflow DSL. It serves as a reference guide, explaining the structure, components, and configurations available within the DSL. By exploring this document, users will gain a thorough understanding of how to define, configure, and manage workflows, including task definitions, flow directives, and state transitions. This foundational knowledge will enable users to effectively utilize the DSL for orchestrating serverless functions and automating processes.
@@ -430,6 +430,7 @@ The [HTTP Call](#http-call) enables workflows to interact with external services
430
430
| body | `any` | `no` | The HTTP request body, if any. |
431
431
| query | `map[string, any]` | `no` | A name/value mapping of the query parameters to use, if any. |
432
432
| output | `string` | `no` | The http call's output format.<br>*Supported values are:*<br>*- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any.*<br>*- `content`, which outputs the content of [http response](#http-response), possibly deserialized.*<br>*- `response`, which outputs the [http response](#http-response).*<br>*Defaults to `content`.* |
433
+
| redirect | `boolean` | `no` | Specifies whether redirection status codes (`300–399`) should be treated as errors.<br>*If set to `false`, runtimes must raise an error for response status codes outside the `200–299` range.*<br>*If set to `true`, they must raise an error for status codes outside the `200–399` range.*<br>*Defaults to `false`.* |
433
434
434
435
###### Examples
435
436
@@ -460,6 +461,7 @@ The [OpenAPI Call](#openapi-call) enables workflows to interact with external se
460
461
| parameters | `map` | `no` | A name/value mapping of the parameters, if any, of the OpenAPI operation to call. |
461
462
| authentication | [`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the OpenAPI operation. |
462
463
| output | `string` | `no` | The OpenAPI call's output format.<br>*Supported values are:*<br>*- `raw`, which output's the base-64 encoded [http response](#http-response) content, if any.*<br>*- `content`, which outputs the content of [http response](#http-response), possibly deserialized.*<br>*- `response`, which outputs the [http response](#http-response).*<br>*Defaults to `content`.* |
464
+
| redirect | `boolean` | `no` | Specifies whether redirection status codes (`300–399`) should be treated as errors.<br>*If set to `false`, runtimes must raise an error for response status codes outside the `200–299` range.*<br>*If set to `true`, they must raise an error for status codes outside the `200–399` range.*<br>*Defaults to `false`.* |
| fork.branches | [`map[string, task][]`](#task) | `no` | The tasks to perform concurrently. |
632
-
| fork.compete | `boolean` | `no` | Indicates whether or not the concurrent [`tasks`](#task) are racing against each other, with a single possible winner, which sets the composite task's output.Defaults to `false`. |
634
+
| fork.compete | `boolean` | `no` | Indicates whether or not the concurrent [`tasks`](#task) are racing against each other, with a single possible winner, which sets the composite task's output.<br>*If set to `false`, the task returns an array that includes the outputs from each branch, preserving the order in which the branches are declared.*<br>*If to `true`, the task returns only the output of the winning branch.*<br>*Defaults to `false`.* |
633
635
634
636
##### Examples
635
637
@@ -816,10 +818,12 @@ Enables the execution of external processes encapsulated within a containerized
816
818
| Name | Type | Required | Description |
817
819
|:--|:---:|:---:|:---|
818
820
| image | `string` | `yes` | The name of the container image to run |
821
+
| name | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to give specific name to the container. |
819
822
| command | `string` | `no` | The command, if any, to execute on the container |
820
823
| ports | `map` | `no` | The container's port mappings, if any |
821
824
| volumes | `map` | `no` | The container's volume mappings, if any |
822
825
| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process |
826
+
| lifetime | [`containerLifetime`](#container-lifetime) | `no` | An object used to configure the container's lifetime. |
823
827
824
828
###### Examples
825
829
@@ -836,6 +840,11 @@ do:
836
840
image: fake-image
837
841
```
838
842
843
+
> [!NOTE]
844
+
> When a `container process` is executed, runtime implementations are recommended to follow a predictable naming convention for the container name. This can improve monitoring, logging, and container lifecycle management.
845
+
>
846
+
> The Serverless Workflow specification recommends using the following convention: `{workflow.name}-{uuid}.{workflow.namespace}-{task.name}`
847
+
839
848
##### Script Process
840
849
841
850
Enables the execution of custom scripts or code within a workflow, empowering workflows to perform specialized logic, data processing, or integration tasks by executing user-defined scripts written in various programming languages.
@@ -844,12 +853,21 @@ Enables the execution of custom scripts or code within a workflow, empowering wo
844
853
845
854
| Name | Type | Required | Description |
846
855
|:--|:---:|:---:|:---|
847
-
| language | `string` | `yes` | The language of the script to run |
856
+
| language | `string` | `yes` | The language of the script to run.<br>*Supported values are: [`js`](https://tc39.es/ecma262/2024/) and [`python`](https://www.python.org/downloads/release/python-3131/).* |
848
857
| code | `string` | `no` | The script's code.<br>*Required if `source` has not been set.* |
849
858
| source | [externalResource](#external-resource) | `no` | The script's resource.<br>*Required if `code` has not been set.* |
850
859
| arguments | `map` | `no` | A list of the arguments, if any, of the script to run |
851
860
| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured script process |
852
861
862
+
> [!WARNING]
863
+
> To ensure cross-compatibility, Serverless Workflow strictly limits the versions of supported scripting languages. These versions may evolve with future releases. If you wish to use a different version of a language, you may do so by utilizing the [`container process`](#container-process).
> Flow directives may only redirect to tasks declared within their own scope. In other words, they cannot target tasks at a different depth.
1535
+
1515
1536
### External Resource
1516
1537
1517
1538
Defines an external resource.
@@ -2320,6 +2341,16 @@ This has the following limitations compared to runtime expressions:
2320
2341
uri: https://petstore.swagger.io/v2/pet/{petId}
2321
2342
```
2322
2343
2344
+
### Container Lifetime
2345
+
2346
+
Configures the lifetime of a container.
2347
+
2348
+
#### Properties
2349
+
2350
+
| Property | Type | Required | Description |
2351
+
|----------|:----:|:--------:|-------------|
2352
+
| cleanup | `string` | `yes` | The cleanup policy to use.<br>*Supported values are:<br>- `always`: the container is deleted immediately after execution.<br>-`never`: the runtime should never delete the container.<br>-`eventually`: the container is deleted after a configured amount of time after its execution.*<br>*Defaults to `never`.* |
2353
+
| after | [`duration`](#duration) | `no` | The [`duration`](#duration), if any, after which to delete the container once executed.<br>*Required if `cleanup` has been set to `eventually`, otherwise ignored.* |
2323
2354
### Process Result
2324
2355
2325
2356
Describes the result of a process.
@@ -2338,13 +2369,17 @@ Describes the result of a process.
Copy file name to clipboardExpand all lines: dsl.md
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -221,6 +221,9 @@ Once the task has been executed, different things can happen:
221
221
-`fault`: the task raised an uncaught error, which abruptly halts the workflow's execution and makes it transition to `faulted`[status phase](#status-phases).
222
222
-`end`: the task explicitly and gracefully ends the workflow's execution.
223
223
224
+
> [!WARNING]
225
+
> Flow directives may only redirect to tasks declared within their own scope. In other words, they cannot target tasks at a different depth.
226
+
224
227
### Data Flow
225
228
226
229
In Serverless Workflow DSL, data flow management is crucial to ensure that the right data is passed between tasks and to the workflow itself.
@@ -386,6 +389,8 @@ When the evaluation of an expression fails, runtimes **must** raise an error wit
386
389
| workflow |[`workflowDescriptor`](#workflow-descriptor)| Describes the current workflow. |
387
390
| runtime |[`runtimeDescriptor`](#runtime-descriptor)| Describes the runtime. |
388
391
392
+
> [!WARNING]
393
+
> Use `$secrets` with caution: incorporating them in expressions or passing them as call inputs may inadvertently expose sensitive information.
389
394
390
395
##### Runtime Descriptor
391
396
@@ -444,6 +449,9 @@ The following table shows which arguments are available for each runtime express
> Use `$secrets` with caution: incorporating them in expressions or passing them as call inputs may inadvertently expose sensitive information.
454
+
447
455
### Fault Tolerance
448
456
449
457
Serverless Workflow is designed with resilience in mind, acknowledging that errors are an inevitable part of any system. The DSL provides robust mechanisms to identify, describe, and handle errors effectively, ensuring the workflow can recover gracefully from failures.
0 commit comments