From 6a102e3dd7ac64ace32b5b89d4bc3a1862182fef Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Thu, 9 Jan 2025 12:49:45 +0100 Subject: [PATCH 01/12] Add documentation about workflow and task lifecycle events Closes #1030 Signed-off-by: Charles d'Avernas --- dsl-reference.md | 404 +++++++++++++++++++++++++++++++++++++++++++++++ dsl.md | 52 +++++- 2 files changed, 449 insertions(+), 7 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index 78e9f8c2..4df6ff98 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -30,6 +30,27 @@ - [Try](#try) - [Wait](#wait) + [Flow Directive](#flow-directive) + + [Lifecycle Events](#lifecycle-events) + - [Workflow Lifecycle Events](#workflow-lifecycle-events) + + [Workflow Started](#workflow-started-event) + + [Workflow Suspended](#workflow-suspended-event) + + [Workflow Resumed](#workflow-resumed-event) + + [Workflow Correlation Started](#workflow-correlation-started-event) + + [Workflow Correlation Completed](#workflow-correlation-completed-event) + + [Workflow Cancelled](#workflow-cancelled-event) + + [Workflow Faulted](#workflow-faulted-event) + + [Workflow Completed](#workflow-completed-event) + + [Workflow Status Changed](#workflow-status-changed-event) + - [Task Lifecycle Events](#task-lifecycle-events) + + [Task Created](#task-created-event) + + [Task Started](#task-started-event) + + [Task Suspended](#task-suspended-event) + + [Task Resumed](#task-resumed-event) + + [Task Retried](#task-retried-event) + + [Task Cancelled](#task-cancelled-event) + + [Task Faulted](#task-faulted-event) + + [Task Completed](#task-completed-event) + + [Task Status Changed](#task-status-changed-event) + [External Resource](#external-resource) + [Authentication](#authentication) - [Basic](#basic-authentication) @@ -1106,6 +1127,389 @@ Flow Directives are commands within a workflow that dictate its progression. | `"end"` | Provides a graceful conclusion to the workflow execution, signaling its completion explicitly. | | `string` | Continues the workflow at the task with the specified name | +### Lifecycle Events + +Lifecycle events are [cloud events](https://github.com/cloudevents/spec) used to notify users and external services about key state changes in workflows and tasks. + +#### Workflow Lifecycle Events + +##### Workflow Started Event + +The data carried by the cloud event that notifies that a workflow has started. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| name | `string` | `yes` | The qualified name of the workflow that has started. | +| definition | [`workflowDefinitionReference`](#workflow-definition-reference) | `yes` | An an object that describes the definition of the workflow that has started. | +| startedAt | `dateTime` | `yes` | The date and time at which the workflow has started. | + +###### Examples + +```yaml +name: orderPetWorkflow-ix7iryakiem8j.samples +definition: + name: orderPetWorkflow + namespace: samples + version: '1.0.0' +startedAt: '2024-07-26T16:59:57-05:00' +``` + +##### Workflow Suspended Event + +The data carried by the cloud event that notifies that the execution of a workflow has been suspended. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| name | `string` | `yes` | The qualified name of the workflow that has been suspended. | +| suspendedAt | `dateTime` | `yes` | The date and time at which the workflow has been suspended. | + +###### Examples + +```yaml +name: orderPetWorkflow-ix7iryakiem8j.samples +suspendedAt: '2024-07-26T16:59:57-05:00' +``` + +##### Workflow Resumed Event + +The data carried by the cloud event that notifies that notifies that a workflow has been resumed. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| name | `string` | `yes` | The qualified name of the workflow that has been resumed. | +| resumedAt | `dateTime` | `yes` | The date and time at which the workflow has been resumed. | + +###### Examples + +```yaml +name: orderPetWorkflow-ix7iryakiem8j.samples +resumedAt: '2024-07-26T16:59:57-05:00' +``` + +##### Workflow Correlation Started Event + +The data carried by the cloud event that notifies that a workflow has started correlating events. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| name | `string` | `yes` | The qualified name of the workflow that has started correlating events. | +| startedAt | `dateTime` | `yes` | The date and time at which the workflow has started correlating events. | + +###### Examples + +```yaml +name: orderPetWorkflow-ix7iryakiem8j.samples +startedAt: '2024-07-26T16:59:57-05:00' +``` + +##### Workflow Correlation Completed Event + +The data carried by the cloud event that notifies that a workflow has completed correlating events. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| name | `string` | `yes` | The qualified name of the workflow that has completed correlating events. | +| completedAt | `dateTime` | `yes` | The date and time at which the workflow has completed correlating events. | +| correlationKeys | `map` | `no` | A key/value mapping, if any, of the resolved correlation keys. | + +###### Examples + +```yaml +name: orderPetWorkflow-ix7iryakiem8j.samples +completedAt: '2024-07-26T16:59:57-05:00' +correlationKeys: + petId: xt84hj202q14s + orderId: '0a7f8581-acb9-4133-a378-0460c98ea60c' +``` + +##### Workflow Cancelled Event + +The data carried by the cloud event that notifies that notifies that a workflow has been cancelled. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| name | `string` | `yes` | The qualified name of the workflow that has been cancelled. | +| cancelledAt | `dateTime` | `yes` | The date and time at which the workflow has been cancelled. | + +###### Examples + +```yaml +name: orderPetWorkflow-ix7iryakiem8j.samples +cancelledAt: '2024-07-26T16:59:57-05:00' +``` + +##### Workflow Faulted Event + +The data carried by the cloud event that notifies that notifies that a workflow has faulted. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| name | `string` | `yes` | The qualified name of the workflow that has faulted. | +| faultedAt | `dateTime` | `yes` | The date and time at which the workflow has faulted. | +| error | [`error`](#error) | `yes` | The error that has cause the workflow to fault. | + +###### Examples + +```yaml +name: orderPetWorkflow-ix7iryakiem8j.samples +faultedAt: '2024-07-26T16:59:57-05:00' +error: + type: https://serverlessworkflow.io/spec/1.0.0/errors/communication + title: Service Not Available + status: 503 +``` + +##### Workflow Completed Event + +The data carried by the cloud event that notifies that notifies that a workflow ran to completion. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| name | `string` | `yes` | The qualified name of the workflow ran to completion. | +| completedAt | `dateTime` | `yes` | The date and time at which the workflow ran to completion. | +| output | `map` | `no` | The workflow's output, if any. | + +###### Examples + +```yaml +name: orderPetWorkflow-ix7iryakiem8j.samples +completedAt: '2024-07-26T16:59:57-05:00' +output: + orderId: '0a7f8581-acb9-4133-a378-0460c98ea60c' + petId: xt84hj202q14s + status: placed +``` + +##### Workflow Status Changed Event + +The data carried by the cloud event that notifies that notifies that the status phase of a workflow has changed. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| name | `string` | `yes` | The qualified name of the workflow which's status phase has changed. | +| updatedAt | `dateTime` | `yes` | The date and time at which the workflow's status phase has changed. | +| status | `string` | The workflow's current [status phase](https://github.com/serverlessworkflow/specification/blob/main/dsl.md#status-phases). | + +###### Examples + +```yaml +name: orderPetWorkflow-ix7iryakiem8j.samples +updatedAt: '2024-07-26T16:59:57-05:00' +status: completed +``` + +#### Task Lifecycle Events + +##### Task Created Event + +The data carried by the cloud event that notifies that a task has been created. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| workflow | `string` | `yes` | The qualified name of the workflow the task that has been created belongs to. | +| task | `uri` | `yes` | A JSON Pointer that references the task that has been created. | +| createdAt | `dateTime` | `yes` | The date and time at which the task has been created. | + +###### Examples + +```yaml +workflow: orderPetWorkflow-ix7iryakiem8j.samples +task: '/do/1/initialize' +createdAt: '2024-07-26T16:59:57-05:00' +``` + +##### Task Started Event + +The data carried by the cloud event that notifies that a task has started. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| workflow | `string` | `yes` | The qualified name of the workflow the task that has started belongs to. | +| task | `uri` | `yes` | A JSON Pointer that references the task that has started. | +| startedAt | `dateTime` | `yes` | The date and time at which the task has started. | + +###### Examples + +```yaml +workflow: orderPetWorkflow-ix7iryakiem8j.samples +task: '/do/1/initialize' +startedAt: '2024-07-26T16:59:57-05:00' +``` + +##### Task Suspended Event + +The data carried by the cloud event that notifies that the execution of a task has been suspended. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| workflow | `string` | `yes` | The qualified name of the workflow the task that has been suspended belongs to. | +| task | `uri` | `yes` | A JSON Pointer that references the task that has been suspended. | +| suspendedAt | `dateTime` | `yes` | The date and time at which the task has been suspended. | + +###### Examples + +```yaml +workflow: orderPetWorkflow-ix7iryakiem8j.samples +task: '/do/1/initialize' +suspendedAt: '2024-07-26T16:59:57-05:00' +``` + +##### Task Resumed Event + +The data carried by the cloud event that notifies that notifies that a task has been resumed. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| workflow | `string` | `yes` | The qualified name of the workflow the task that has been resumed belongs to. | +| task | `uri` | `yes` | A JSON Pointer that references the task that has been resumed. | +| resumedAt | `dateTime` | `yes` | The date and time at which the task has been resumed. | + +###### Examples + +```yaml +workflow: orderPetWorkflow-ix7iryakiem8j.samples +task: '/do/1/initialize' +resumedAt: '2024-07-26T16:59:57-05:00' +``` + +##### Task Retried Event + +The data carried by the cloud event that notifies that notifies that a task is being retried. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| workflow | `string` | `yes` | The qualified name of the workflow the task that is being retried belongs to. | +| task | `uri` | `yes` | A JSON Pointer that references the task that is being retried. | +| retriedAt | `dateTime` | `yes` | The date and time at which the task has been retried. | + +###### Examples + +```yaml +workflow: orderPetWorkflow-ix7iryakiem8j.samples +task: '/do/1/initialize' +retriedAt: '2024-07-26T16:59:57-05:00' +``` + +##### Task Cancelled Event + +The data carried by the cloud event that notifies that notifies that a task has been cancelled. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| workflow | `string` | `yes` | The qualified name of the workflow the task that has been cancelled belongs to. | +| task | `uri` | `yes` | A JSON Pointer that references the task that has been cancelled. | +| cancelledAt | `dateTime` | `yes` | The date and time at which the task has been cancelled. | + +###### Examples + +```yaml +workflow: orderPetWorkflow-ix7iryakiem8j.samples +task: '/do/1/initialize' +cancelledAt: '2024-07-26T16:59:57-05:00' +``` + +##### Task Faulted Event + +The data carried by the cloud event that notifies that notifies that a task has faulted. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| workflow | `string` | `yes` | The qualified name of the workflow the task that has faulted belongs to. | +| task | `uri` | `yes` | A JSON Pointer that references the task that has faulted. | +| faultedAt | `dateTime` | `yes` | The date and time at which the task has faulted. | +| error | [`error`](#error) | `yes` | The error that has cause the task to fault. | + +###### Examples + +```yaml +workflow: orderPetWorkflow-ix7iryakiem8j.samples +task: '/do/1/initialize' +faultedAt: '2024-07-26T16:59:57-05:00' +error: + type: https://serverlessworkflow.io/spec/1.0.0/errors/communication + title: Service Not Available + status: 503 +``` + +##### Task Completed Event + +The data carried by the cloud event that notifies that notifies that a task ran to completion. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| workflow | `string` | `yes` | The qualified name of the workflow the task that ran to completion belongs to. | +| task | `uri` | `yes` | A JSON Pointer that references the task that ran to completion. | +| completedAt | `dateTime` | `yes` | The date and time at which the task ran to completion. | +| output | `map` | `no` | The task's output, if any. | + +###### Examples + +```yaml +workflow: orderPetWorkflow-ix7iryakiem8j.samples +task: '/do/1/initialize' +completedAt: '2024-07-26T16:59:57-05:00' +output: + orderId: '0a7f8581-acb9-4133-a378-0460c98ea60c' + petId: xt84hj202q14s + status: placed +``` + +##### Task Status Changed Event + +The data carried by the cloud event that notifies that notifies that the status phase of a task has changed. + +###### Properties + +| Name | Type | Required | Description| +|:--|:---:|:---:|:---| +| workflow | `string` | `yes` | The qualified name of the workflow the task which's status phase has changed belongs to. | +| task | `uri` | `yes` | A JSON Pointer that references the task which's status phase has changed. | +| updatedAt | `dateTime` | `yes` | The date and time at which the task's status phase has changed. | +| status | `string` | The task's current [status phase](https://github.com/serverlessworkflow/specification/blob/main/dsl.md#status-phases). | + +###### Examples + +```yaml +workflow: orderPetWorkflow-ix7iryakiem8j.samples +task: '/do/1/initialize' +updatedAt: '2024-07-26T16:59:57-05:00' +status: completed +``` + ### External Resource Defines an external resource. diff --git a/dsl.md b/dsl.md index fe44f3ad..6a5503d4 100644 --- a/dsl.md +++ b/dsl.md @@ -9,6 +9,9 @@ - [Concepts](#concepts) + [Workflow](#workflow) - [Status Phases](#status-phases) + - [Lifecycle Events](#lifecycle-events) + + [Workflow Lifecycle Events](#workflow-lifecycle-events) + + [Task Lifecycle Events](#task-lifecycle-events) - [Components](#components) + [Task](#task) - [Scheduling](#scheduling) @@ -91,21 +94,56 @@ Additionally, workflows may optionally accept inputs and produce outputs, allowi #### Status Phases -Workflows in the Serverless Workflow DSL can exist in several phases, each indicating the current state of the workflow execution. These phases include: +Both workflows and tasks in the Serverless Workflow DSL can exist in several phases, each indicating the current state of the workflow/task execution. These phases include: | Phase | Description | | --- | --- | -| `pending` | The workflow has been initiated and is pending execution. | -| `running` | The workflow is currently in progress. | -| `waiting` | The workflow execution has been paused or halted temporarily and is waiting for something to happen. | -| `cancelled` | The workflow execution has been terminated before completion. | -| `faulted` | The workflow execution has encountered an error. | -| `completed` | The workflow execution has successfully finished all tasks. | +| `pending` | The workflow/task has been initiated and is pending execution. | +| `running` | The workflow/task is currently in progress. | +| `waiting` | The workflow/task execution is temporarily paused, awaiting either inbound event(s) or a specified time interval as defined by a [`wait`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#wait) task. | +| `suspended` | The workflow/task execution has been manually paused by a user and will remain halted until explicitly resumed. | +| `cancelled` | The workflow/task execution has been terminated before completion. | +| `faulted` | The workflow/task execution has encountered an error. | +| `completed` | The workflow/task ran to completion. | Additionally, the flow of execution within a workflow can be controlled using [directives*](dsl-reference.md#flow-directive), which provide instructions to the workflow engine on how to manage and handle specific aspects of workflow execution. \**To learn more about flow directives and how they can be utilized to control the execution and behavior of workflows, please refer to [Flow Directives](dsl-reference.md#flow-directive).* +#### Lifecycle Events + +Lifecycle [cloud events](https://github.com/cloudevents/spec) standardize notifications for key state changes in workflows and tasks—such as start, suspend, resume, cancel, fault, complete, and status change. These events carry consistent information like IDs, status transitions, timestamps, and relevant metadata, enabling users to reliably respond to updates, enhancing interoperability and simplifying integration across different implementations. + +Runtimes are expected to publish these events upon state changes. While using the [HTTP protocol binding](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/bindings/http-protocol-binding.md) with [structured content mode](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/bindings/http-protocol-binding.md#32-structured-content-mode) is recommended, other transports adhering to the [CloudEvents](https://github.com/cloudevents/spec) specification may be used. + +##### Workflow Lifecycle Events + +| Type | Data | Description | +|:----:|:----:|:------------| +|
`io.serverlessworkflow.workflow.started.v1`
| [`workflowStartedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#workflow-started-event) | Notifies about the start of a workflow. | +|
`io.serverlessworkflow.workflow.suspended.v1`
| [`workflowSupsendedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#workflow-suspended-event) | Notifies about suspending a workflow execution. | +|
`io.serverlessworkflow.workflow.resumed.v1`
| [`workflowResumedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#workflow-resumed-event) | Notifies about resuming a workflow execution. | +|
`io.serverlessworkflow.workflow.correlation-started.v1`
| [`workflowCorrelationStartedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#workflow-correlation-started-event) | Notifies about a workflow starting to correlate events. | +|
`io.serverlessworkflow.workflow.correlation-completed.v1`
| [`workflowCorrelationCompletedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#workflow-correlation-completed-event) | Notifies about a workflow completing an event correlation. | +|
`io.serverlessworkflow.workflow.cancelled.v1`
| [`workflowCancelledEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#workflow-cancelled-event) | Notifies about the cancellation of a workflow execution. | +|
`io.serverlessworkflow.workflow.faulted.v1`
| [`workflowFaultedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#workflow-faulted-event) | Notifies about a workflow being faulted. | +|
`io.serverlessworkflow.workflow.completed.v1`
| [`workflowCompletedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#workflow-completed-event) | Notifies about the completion of a workflow execution. | +|
`io.serverlessworkflow.workflow.status-changed.v1`
| [`workflowStatusChangedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#workflow-status-changed-event) | Notifies about the change of a workflow's status phase. | + +##### Task Lifecycle Events + +| Type | Data | Description | +|:----:|:----:|:------------| +|
`io.serverlessworkflow.task.created.v1`
| [`taskCreatedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#task-created-event) | Notifies about the creation of a task. | +|
`io.serverlessworkflow.task.started.v1`
| [`taskStartedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#task-started-event) | Notifies about the start of a task. | +|
`io.serverlessworkflow.task.suspended.v1`
| [`taskSuspendedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#task-suspended-event) | Notifies about suspending a task's execution. | +|
`io.serverlessworkflow.task.resumed.v1`
| [`taskResumedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#task-resumed-event) | Notifies about resuming a task's execution. | +|
`io.serverlessworkflow.task.retried.v1`
| [`taskRetriedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#task-retried-event) | Notifies about retrying a task's execution. | +|
`io.serverlessworkflow.task.cancelled.v1`
| [`taskCancelledEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#task-cancelled-event) | Notifies about the cancellation of a task's execution. | +|
`io.serverlessworkflow.task.faulted.v1`
| [`taskFaultedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#task-faulted-event) | Notifies about a task being faulted. | +|
`io.serverlessworkflow.task.completed.v1`
| [`taskCompletedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#task-completed-event) | Notifies about the completion of a task's execution. | +|
`io.serverlessworkflow.task.status-changed.v1`
| [`taskStatusChangedEvent`](https://github.com/serverlessworkflow/specification/blob/main/dsl-reference.md#task-status-changed-event) | Notifies about the change of a task's status phase. | + #### Components Serverless Workflow DSL allows for defining reusable components that can be referenced across the workflow. These include: From 5221ef3777821e547bc738fb5e251138ca2faafa Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Thu, 9 Jan 2025 12:57:12 +0100 Subject: [PATCH 02/12] Add the missing `workflowDefinitionReference` object Signed-off-by: Charles d'Avernas --- dsl-reference.md | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index 4df6ff98..4ffbc9f6 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -80,6 +80,7 @@ + [AsyncAPI Server](#asyncapi-server) + [AsyncAPI Message](#asyncapi-message) + [AsyncAPI Subscription](#asyncapi-subscription) + + [Workflow Definition Reference](#workflow-definition-reference) ## Abstract @@ -326,7 +327,7 @@ 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](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationObject) to call. | | channel | `string` | `yes` | The name of the channel on which to perform the operation. The operation to perform is defined by declaring either `message`, in which case the [channel](https://v2.asyncapi.com/docs/reference/specification/v2.6.0#channelItemObject)'s `publish` operation will be executed, or `subscription`, in which case the [channel](https://v2.asyncapi.com/docs/reference/specification/v2.6.0#channelItemObject)'s `subscribe` operation will be executed.
*Used only in case the referenced document uses AsyncAPI `v2.6.0`.* | | operation | `string` | `yes` | A reference to the AsyncAPI [operation](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationObject) to call.
*Used only in case the referenced document uses AsyncAPI `v3.0.0`.* | @@ -2376,7 +2377,7 @@ Configures the target server of an AsyncAPI operation. #### Properties | Name | Type | Required | Description | -|:-------|:------:|:----------:|:--------------| +|:-----|:----:|:--------:|:------------| | name | `string` | `yes` | The name of the [server](https://www.asyncapi.com/docs/reference/specification/v3.0.0#serverObject) to call the specified AsyncAPI operation on. | | variables | `object` | `no` | The target [server's variables](https://www.asyncapi.com/docs/reference/specification/v3.0.0#serverVariableObject), if any. | @@ -2414,7 +2415,7 @@ Configures an AsyncAPI message to publish. #### Properties | Name | Type | Required | Description | -|:-------|:------:|:----------:|:--------------| +|:-----|:----:|:--------:|:------------| | payload | `object` | `no` | The message's payload, if any. | | headers | `object` | `no` | The message's headers, if any. | @@ -2449,7 +2450,7 @@ Configures a subscription to an AsyncAPI operation. #### Properties | Name | Type | Required | Description | -|:-------|:------:|:----------:|:--------------| +|:-----|:----:|:--------:|:------------| | filter | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to filter consumed messages. | | consume | [`subscriptionLifetime`](#asyncapi-subscription-lifetime) | `yes` | An object used to configure the subscription's lifetime. | @@ -2484,7 +2485,7 @@ Configures the lifetime of an AsyncAPI subscription #### Properties | Name | Type | Required | Description | -|:-------|:------:|:----------:|:--------------| +|:-----|:----:|:--------:|:------------| | amount | `integer` | `no` | The amount of messages to consume.
*Required if `while` and `until` have not been set.* | | for | [`duration`](#duration) | `no` | The [`duration`](#duration) that defines for how long to consume messages. | | while | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to determine whether or not to keep consuming messages.
*Required if `amount` and `until` have not been set.* | @@ -2512,4 +2513,24 @@ do: until: '${ ($context.messages | length) == 5 }' for: seconds: 10 +``` + +### Workflow Definition Reference + +References a workflow definition. + +#### Properties + +| Name | Type | Required | Description | +|:-----|:----:|:--------:|:------------| +| name | `string` | `yes` | The name of the referenced workflow definition. | +| namespace | `string` | `yes` | The namespace of the referenced workflow definition. | +| version | `string` | `yes` | The semantic version of the referenced workflow definition. | + +#### Examples + +```yaml +name: greet +namespace: samples +version: '0.1.0-rc2' ``` \ No newline at end of file From faac51695b3e49d9a0ff1c808c3b4ff2598d033e Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Thu, 9 Jan 2025 16:26:13 +0100 Subject: [PATCH 03/12] Update dsl-reference.md Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> --- dsl-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index 4ffbc9f6..b03685ab 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1143,7 +1143,7 @@ The data carried by the cloud event that notifies that a workflow has started. | Name | Type | Required | Description| |:--|:---:|:---:|:---| | name | `string` | `yes` | The qualified name of the workflow that has started. | -| definition | [`workflowDefinitionReference`](#workflow-definition-reference) | `yes` | An an object that describes the definition of the workflow that has started. | +| definition | [`workflowDefinitionReference`](#workflow-definition-reference) | `yes` | An object that describes the definition of the workflow that has started. | | startedAt | `dateTime` | `yes` | The date and time at which the workflow has started. | ###### Examples From 38dea37e47e1c550d0ccc7f58ce14bd06e0c0456 Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Thu, 9 Jan 2025 16:26:26 +0100 Subject: [PATCH 04/12] Update dsl-reference.md Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> --- dsl-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index b03685ab..5d9fa7de 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1276,7 +1276,7 @@ error: ##### Workflow Completed Event -The data carried by the cloud event that notifies that notifies that a workflow ran to completion. +The data carried by the cloud event that notifies that a workflow ran to completion. ###### Properties From 273d09a67ec608185907055c2cdada901090570f Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Thu, 9 Jan 2025 16:26:32 +0100 Subject: [PATCH 05/12] Update dsl-reference.md Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> --- dsl-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index 5d9fa7de..a42f7167 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1299,7 +1299,7 @@ output: ##### Workflow Status Changed Event -The data carried by the cloud event that notifies that notifies that the status phase of a workflow has changed. +The data carried by the cloud event that notifies that the status phase of a workflow has changed. ###### Properties From 4fe63d2405fbc062e5e215b4d4914e70f93d6ac7 Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Thu, 9 Jan 2025 16:27:05 +0100 Subject: [PATCH 06/12] Update dsl-reference.md Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> --- dsl-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index a42f7167..046a42af 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1235,7 +1235,7 @@ correlationKeys: ##### Workflow Cancelled Event -The data carried by the cloud event that notifies that notifies that a workflow has been cancelled. +The data carried by the cloud event that notifies that a workflow has been canceled. ###### Properties From 81cd84d6ad700c366fa69616e39fbfb08a696416 Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Thu, 9 Jan 2025 16:27:17 +0100 Subject: [PATCH 07/12] Update dsl-reference.md Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> --- dsl-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index 046a42af..51dea55f 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1253,7 +1253,7 @@ cancelledAt: '2024-07-26T16:59:57-05:00' ##### Workflow Faulted Event -The data carried by the cloud event that notifies that notifies that a workflow has faulted. +The data carried by the cloud event that notifies that a workflow has faulted. ###### Properties From 4ba44d23250327b684c8d3465cdc713ef5a8c956 Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Thu, 9 Jan 2025 16:27:26 +0100 Subject: [PATCH 08/12] Update dsl-reference.md Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> --- dsl-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index 51dea55f..ad02545f 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1421,7 +1421,7 @@ retriedAt: '2024-07-26T16:59:57-05:00' ##### Task Cancelled Event -The data carried by the cloud event that notifies that notifies that a task has been cancelled. +The data carried by the cloud event that notifies that a task has been canceled. ###### Properties From ef4049884257a1d24041099c3c4c9192c6a37ef1 Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Thu, 9 Jan 2025 16:27:33 +0100 Subject: [PATCH 09/12] Update dsl-reference.md Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> --- dsl-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index ad02545f..a3c7f691 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1441,7 +1441,7 @@ cancelledAt: '2024-07-26T16:59:57-05:00' ##### Task Faulted Event -The data carried by the cloud event that notifies that notifies that a task has faulted. +The data carried by the cloud event that notifies that a task has been faulted. ###### Properties From 1e47ca718649b45f3b781b9a4176bb0aa4033e58 Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Thu, 9 Jan 2025 16:27:47 +0100 Subject: [PATCH 10/12] Update dsl-reference.md Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> --- dsl-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index a3c7f691..4c48fc92 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1466,7 +1466,7 @@ error: ##### Task Completed Event -The data carried by the cloud event that notifies that notifies that a task ran to completion. +The data carried by the cloud event that notifies that a task ran to completion. ###### Properties From 7ac9dd5872e0b7a462b1742e32b67ebd8bb4e93b Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Thu, 9 Jan 2025 16:27:53 +0100 Subject: [PATCH 11/12] Update dsl-reference.md Co-authored-by: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> --- dsl-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index 4c48fc92..fdfc13ad 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1491,7 +1491,7 @@ output: ##### Task Status Changed Event -The data carried by the cloud event that notifies that notifies that the status phase of a task has changed. +The data carried by the cloud event that notifies that the status phase of a task has changed. ###### Properties From d601036996244b85f353e21591804571c4c9242c Mon Sep 17 00:00:00 2001 From: Charles d'Avernas Date: Fri, 10 Jan 2025 16:28:28 +0100 Subject: [PATCH 12/12] Change 'canceled' to 'cancelled', as requested by @fjtirado Signed-off-by: Charles d'Avernas --- dsl-reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsl-reference.md b/dsl-reference.md index f2ec5943..7b27cc2c 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -1254,7 +1254,7 @@ correlationKeys: ##### Workflow Cancelled Event -The data carried by the cloud event that notifies that a workflow has been canceled. +The data carried by the cloud event that notifies that a workflow has been cancelled. ###### Properties @@ -1440,7 +1440,7 @@ retriedAt: '2024-07-26T16:59:57-05:00' ##### Task Cancelled Event -The data carried by the cloud event that notifies that a task has been canceled. +The data carried by the cloud event that notifies that a task has been cancelled. ###### Properties