Skip to content

Commit 1815db0

Browse files
docs: split do & fork in dsl
1 parent 51f786b commit 1815db0

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

dsl-reference.md

+20-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
+ [gRPC](#grpc-call)
1515
+ [HTTP](#http-call)
1616
+ [OpenAPI](#openapi-call)
17-
- [Composite](#composite)
17+
- [Do](#do)
18+
- [Fork](#fork)
1819
- [Emit](#emit)
1920
- [For](#for)
2021
- [Listen](#listen)
@@ -225,7 +226,8 @@ By breaking down the [workflow](#workflow) into manageable [tasks](#task), organ
225226
The Serverless Workflow DSL defines a list of [tasks](#task) that **must be** supported by all runtimes:
226227
227228
- [Call](#call), used to call services and/or functions.
228-
- [Composite](#composite), used to define a minimum of two subtasks to perform.
229+
- [Do](#do), used to define a minimum of two subtasks to perform in sequence.
230+
- [Fork](#fork), used to define a minimum of two subtasks to perform concurrently.
229231
- [Emit](#emit), used to emit [events](#event).
230232
- [For](#for), used to iterate over a collection of items, and conditionally perform a task for each of them.
231233
- [Listen](#listen), used to listen for an [event](#event) or more.
@@ -417,21 +419,18 @@ do:
417419
status: available
418420
```
419421

420-
#### Composite
422+
#### Do
421423

422-
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.
424+
Serves as a fundamental building block within workflows, enabling the sequential execution of multiple subtasks. By defining a series of subtasks to perform in sequence, the Do task facilitates the efficient execution of complex operations, ensuring that each subtask is completed before the next one begins.
423425

424426
##### Properties
425427

426428
| Name | Type | Required | Description|
427429
|:--|:---:|:---:|:---|
428-
| do | [`map[string, task][]`](#task) | `no` | The tasks to perform sequentially.<br>*Required if `fork` has not been set, otherwise ignored.*<br>*If set, must contains **at least** two [`tasks`](#task).* |
429-
| fork.branches | [`map[string, task][]`](#task) | `no` | The tasks to perform concurrently.<br>*Required if `do` has not been set, otherwise ignored.*<br>*If set, must contains **at least** two [`tasks`](#task).* |
430-
| 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>*Ignored if `do` has been set. Defaults to `false`.*<br>*Must **not** be set if the [`tasks`](#task) are executed sequentially.* |
430+
| do | [`map[string, task][]`](#task) | `no` | The tasks to perform sequentially.<br>*If set, must contains **at least** two [`tasks`](#task).* |
431431

432432
##### Examples
433433

434-
*Executing tasks sequentially:*
435434
```yaml
436435
document:
437436
dsl: '1.0.0-alpha1'
@@ -474,7 +473,19 @@ do:
474473
country: Portugal
475474
```
476475

477-
*Executing tasks concurrently:*
476+
#### Fork
477+
478+
Allows workflows to execute multiple subtasks concurrently, enabling parallel processing and improving the overall efficiency of the workflow. By defining a set of subtasks to perform concurrently, the Fork task facilitates the execution of complex operations in parallel, ensuring that multiple tasks can be executed simultaneously.
479+
480+
##### Properties
481+
482+
| Name | Type | Required | Description|
483+
|:--|:---:|:---:|:---|
484+
| fork.branches | [`map[string, task][]`](#task) | `no` | The tasks to perform concurrently.<br>*If set, must contains **at least** two [`tasks`](#task).* |
485+
| 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`. |
486+
487+
##### Examples
488+
478489
```yaml
479490
document:
480491
dsl: '1.0.0-alpha1'

dsl.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ Serverless Workflow DSL allows for defining reusable components that can be refe
101101
The Serverless Workflow DSL defines several default [task](dsl-reference.md#tasks) types that runtimes **must** implement:
102102

103103
- [Call](dsl-reference.md#call), used to call services and/or functions.
104-
- [Composite](dsl-reference.md#composite), used to define a minimum of two subtasks to perform.
104+
- [Do](dsl-reference.md#do), used to define a minimum of two subtasks to perform in sequence.
105+
- [Fork](dsl-reference.md#fork), used to define a minimum of two subtasks to perform in parallel.
105106
- [Emit](dsl-reference.md#emit), used to emit [events](dsl-reference.md#event).
106107
- [For](dsl-reference.md#for), used to iterate over a collection of items, and conditionally perform a task for each of them.
107108
- [Listen](dsl-reference.md#listen), used to listen for an [event](dsl-reference.md#event) or more.

0 commit comments

Comments
 (0)