Skip to content

Commit feb9ca9

Browse files
authored
Merge pull request serverlessworkflow#974 from matthias-pichler/matthias-pichler/rename-datetimedescriptor-966
Extract datetime descriptor
2 parents 16a331a + a65ef0c commit feb9ca9

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

dsl.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,27 @@ This argument contains information about the runtime executing the workflow.
302302
|:-----|:----:|:------------|:--------|
303303
| id | `string` | A unique id of the workflow execution. Now specific format is imposed | UUIDv4: `4a5c8422-5868-4e12-8dd9-220810d2b9ee`, ULID: `0000004JFGDSW1H037G7J7SFB9` |
304304
| definition | `map` | The workflow's definition as a parsed object | `{ "document": { ... }, "do": [...] }` |
305-
| input | `any` | The workflow's *raw* input (i.e *BEFORE* the `input.from` expression). For the result of `input.from` expression use the `$input` argument | - |
306-
| startedAt.iso8601 | `string` | The start time of the execution as a ISO 8601 date time string. It uses `T` as the date-time delimiter, either UTC (`Z`) or a time zone offset (`+01:00`). The precision can be either seconds, milliseconds or nanoseconds | `2022-01-01T12:00:00Z`, `2022-01-01T12:00:00.123456Z`, `2022-01-01T12:00:00.123+01:00` |
307-
| startedAt.epochMillis | `integer` | The start time of the execution as a integer value of milliseconds since midnight of 1970-01-01 UTC | `1641024000123` (="2022-01-01T08:00:00.123Z") |
308-
| startedAt.epochNanos | `integer` | The start time of the execution as a integer value of nanoseconds since midnight of 1970-01-01 UTC | `1641024000123456` (="2022-01-01T08:00:00.123456Z") |
305+
| input | `any` | The workflow's *raw* input (i.e *BEFORE* the `input.from` expression). For the result of `input.from` expression use the `$input` argument | |
306+
| startedAt | [`dateTimeDescriptor`](#datetime-descriptor) | The start time of the execution | |
307+
308+
##### Task Descriptor
309+
310+
| Name | Type | Description | Example |
311+
|:-----|:----:|:------------|:--------|
312+
| name | `string` | The task's name. | `getPet` |
313+
| reference | `string` | The task's reference. | `/do/2/myTask` |
314+
| definition | `map` | The tasks definition (specified under the name) as a parsed object | `{ "call": "http", "with": { ... } }` |
315+
| input | `any` | The task's *raw* input (i.e. *BEFORE* the `input.from` expression). For the result of `input.from` expression use the context of the runtime expression (for jq `.`) | |
316+
| output | `any` | The task's *raw* output (i.e. *BEFORE* the `output.as` expression). | |
317+
| startedAt | [`dateTimeDescriptor`](#datetime-descriptor) | The start time of the task | |
318+
319+
##### DateTime Descriptor
320+
321+
| Name | Type | Description | Example |
322+
|:-----|:----:|:------------|:--------|
323+
| iso8601 | `string` | The date time as a ISO 8601 date time string. It uses `T` as the date-time delimiter, either UTC (`Z`) or a time zone offset (`+01:00`). The precision can be either seconds, milliseconds or nanoseconds | `2022-01-01T12:00:00Z`, `2022-01-01T12:00:00.123456Z`, `2022-01-01T12:00:00.123+01:00` |
324+
| epoch.seconds | `integer` | The date time as a integer value of seconds since midnight of 1970-01-01 UTC (i.e. [the Unix Epoch](https://en.wikipedia.org/wiki/Unix_time)) | `1641024000` (="2022-01-01T08:00:00Z") |
325+
| epoch.milliseconds | `integer` | The date time as a integer value of milliseconds since midnight of 1970-01-01 UTC. This contains the *whole* timestamp, not just the millisecond portion | `1641024000123` (="2022-01-01T08:00:00.123Z") |
309326

310327
The following table shows which arguments are available for each runtime expression:
311328

@@ -319,19 +336,6 @@ The following table shows which arguments are available for each runtime express
319336
| Task `export.as` | Transformed task output | `$context` |||||||
320337
| Workflow `output.as` | Last task's transformed output | Transformed workflow output || | || ||
321338

322-
##### Task Descriptor
323-
324-
| Name | Type | Description | Example |
325-
|:-----|:----:|:------------|:--------|
326-
| name | `string` | The task's name. | `getPet` |
327-
| reference | `string` | The task's reference. | `/do/2/myTask` |
328-
| definition | `map` | The tasks definition (specified under the name) as a parsed object | `{ "call": "http", "with": { ... } }` |
329-
| input | `any` | The task's *raw* input (i.e. *BEFORE* the `input.from` expression). For the result of `input.from` expression use the context of the runtime expression (for jq `.`) | - |
330-
| output | `any` | The task's *raw* output (i.e. *BEFORE* the `output.as` expression). | - |
331-
| startedAt.iso8601 | `string` | The start time of the task as a ISO 8601 date time string. It uses `T` as the date-time delimiter, either UTC (`Z`) or a time zone offset (`+01:00`). The precision can be either seconds, milliseconds or nanoseconds | `2022-01-01T12:00:00Z`, `2022-01-01T12:00:00.123456Z`, `2022-01-01T12:00:00.123+01:00` |
332-
| startedAt.epochMillis | `integer` | The start time of the task as a integer value of milliseconds since midnight of 1970-01-01 UTC | `1641024000123` (="2022-01-01T08:00:00.123Z") |
333-
| startedAt.epochNanos | `integer` | The start time of the task as a integer value of nanoseconds since midnight of 1970-01-01 UTC | `1641024000123456` (="2022-01-01T08:00:00.123456Z") |
334-
335339
### Fault Tolerance
336340

337341
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

Comments
 (0)