Skip to content

Commit 2463bd5

Browse files
authored
Merge branch 'main' into feat-listen-any-events-until
2 parents cabc421 + e64b3dd commit 2463bd5

File tree

4 files changed

+42
-4
lines changed

4 files changed

+42
-4
lines changed

dsl-reference.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ Allows workflows to execute multiple subtasks concurrently, enabling parallel pr
609609
| Name | Type | Required | Description|
610610
|:--|:---:|:---:|:---|
611611
| fork.branches | [`map[string, task][]`](#task) | `no` | The tasks to perform concurrently. |
612-
| 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`. |
612+
| 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`.* |
613613

614614
##### Examples
615615

@@ -796,6 +796,7 @@ Enables the execution of external processes encapsulated within a containerized
796796
| Name | Type | Required | Description |
797797
|:--|:---:|:---:|:---|
798798
| image | `string` | `yes` | The name of the container image to run |
799+
| name | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to give specific name to the container. |
799800
| command | `string` | `no` | The command, if any, to execute on the container |
800801
| ports | `map` | `no` | The container's port mappings, if any |
801802
| volumes | `map` | `no` | The container's volume mappings, if any |
@@ -817,6 +818,11 @@ do:
817818
image: fake-image
818819
```
819820

821+
> [!NOTE]
822+
> 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.
823+
>
824+
> The Serverless Workflow specification recommends using the following convention: `{workflow.name}-{uuid}.{workflow.namespace}-{task.name}`
825+
820826
##### Script Process
821827

822828
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.
@@ -825,12 +831,21 @@ Enables the execution of custom scripts or code within a workflow, empowering wo
825831

826832
| Name | Type | Required | Description |
827833
|:--|:---:|:---:|:---|
828-
| language | `string` | `yes` | The language of the script to run |
834+
| 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/).* |
829835
| code | `string` | `no` | The script's code.<br>*Required if `source` has not been set.* |
830836
| source | [externalResource](#external-resource) | `no` | The script's resource.<br>*Required if `code` has not been set.* |
831837
| arguments | `map` | `no` | A list of the arguments, if any, of the script to run |
832838
| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured script process |
833839

840+
> [!WARNING]
841+
> 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).
842+
843+
**Supported languages**
844+
| Language | Version |
845+
|:-----------|:---------:|
846+
| `JavaScript` | [`ES2024`](https://tc39.es/ecma262/2024/) |
847+
| `Python` | [`3.13.x`](https://www.python.org/downloads/release/python-3131/) |
848+
834849
###### Examples
835850

836851
```yaml
@@ -1110,6 +1125,9 @@ Flow Directives are commands within a workflow that dictate its progression.
11101125
| `"end"` | Provides a graceful conclusion to the workflow execution, signaling its completion explicitly. |
11111126
| `string` | Continues the workflow at the task with the specified name |
11121127

1128+
> [!WARNING]
1129+
> Flow directives may only redirect to tasks declared within their own scope. In other words, they cannot target tasks at a different depth.
1130+
11131131
### External Resource
11141132

11151133
Defines an external resource.

dsl.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ Once the task has been executed, different things can happen:
183183
- `fault`: the task raised an uncaught error, which abruptly halts the workflow's execution and makes it transition to `faulted` [status phase](#status-phases).
184184
- `end`: the task explicitly and gracefully ends the workflow's execution.
185185

186+
> [!WARNING]
187+
> Flow directives may only redirect to tasks declared within their own scope. In other words, they cannot target tasks at a different depth.
188+
186189
### Data Flow
187190

188191
In Serverless Workflow DSL, data flow management is crucial to ensure that the right data is passed between tasks and to the workflow itself.
@@ -348,7 +351,8 @@ When the evaluation of an expression fails, runtimes **must** raise an error wit
348351
| workflow | [`workflowDescriptor`](#workflow-descriptor) | Describes the current workflow. |
349352
| runtime | [`runtimeDescriptor`](#runtime-descriptor) | Describes the runtime. |
350353

351-
⚠️ **Warning**: Use `$secrets` with caution: incorporating them in expressions or passing them as call inputs may inadvertently expose sensitive information.
354+
> [!WARNING]
355+
> Use `$secrets` with caution: incorporating them in expressions or passing them as call inputs may inadvertently expose sensitive information.
352356
353357
##### Runtime Descriptor
354358

@@ -407,7 +411,8 @@ The following table shows which arguments are available for each runtime express
407411
| Task `export.as` | Transformed task output | `$context` |||||||||
408412
| Workflow `output.as` | Last task's transformed output | Transformed workflow output || | || ||| |
409413

410-
⚠️ **Warning**: Use `$secrets` with caution: incorporating them in expressions or passing them as call inputs may inadvertently expose sensitive information.
414+
> [!WARNING]
415+
> Use `$secrets` with caution: incorporating them in expressions or passing them as call inputs may inadvertently expose sensitive information.
411416
412417
### Fault Tolerance
413418

examples/run-container-with-name.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
document:
2+
dsl: '1.0.0-alpha5'
3+
namespace: test
4+
name: run-container-with-name
5+
version: '0.1.0'
6+
do:
7+
- runContainer:
8+
run:
9+
container:
10+
image: hello-world
11+
name: ${ "hello-\(.workflow.document.name)-\(.task.name)-\(.workflow.id)" }

schema/workflow.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,10 @@ $defs:
622622
type: string
623623
title: ContainerImage
624624
description: The name of the container image to run.
625+
name:
626+
type: string
627+
title: ContainerName
628+
description: A runtime expression, if any, used to give specific name to the container.
625629
command:
626630
type: string
627631
title: ContainerCommand

0 commit comments

Comments
 (0)