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
@@ -311,7 +312,7 @@ The [AsyncAPI Call](#asyncapi-call) enables workflows to interact with external
311
312
| operation | `string` | `yes` | A reference to the AsyncAPI [operation](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationObject) to call.<br>*Used only in case the referenced document uses AsyncAPI `v3.0.0`.* |
312
313
| server | [`asyncApiServer`](#asyncapi-server) | `no` | An object used to configure to the [server](https://www.asyncapi.com/docs/reference/specification/v3.0.0#serverObject) to call the specified AsyncAPI [operation](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationObject) on.<br>If not set, default to the first [server](https://www.asyncapi.com/docs/reference/specification/v3.0.0#serverObject) matching the operation's channel. |
313
314
| protocol | `string` | `no` | The [protocol](https://www.asyncapi.com/docs/reference/specification/v3.0.0#definitionsProtocol) to use to select the target [server](https://www.asyncapi.com/docs/reference/specification/v3.0.0#serverObject). <br>Ignored if `server` has been set.<br>*Supported values are: `amqp`, `amqp1`, `anypointmq`, `googlepubsub`, `http`, `ibmmq`, `jms`, `kafka`, `mercure`, `mqtt`, `mqtt5`, `nats`, `pulsar`, `redis`, `sns`, `solace`, `sqs`, `stomp` and `ws`* |
314
-
| message | [`asyncApiMessage`](#asyncapi-message) | `no` | An object used to configure the message to publish using the target operation.<br>*Required if `subscription` has not been set.* |
315
+
| message | [`asyncApiMessage`](#asyncapi-outbound-message) | `no` | An object used to configure the message to publish using the target operation.<br>*Required if `subscription` has not been set.* |
315
316
| subscription | [`asyncApiSubscription`](#asyncapi-subscription) | `no` | An object used to configure the subscription to messages consumed using the target operation.<br>*Required if `message` has not been set.* |
316
317
| authentication | `string`<br>[`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the AsyncAPI operation. |
317
318
@@ -650,7 +651,19 @@ Provides a mechanism for workflows to await and react to external events, enabli
650
651
651
652
| Name | Type | Required | Description|
652
653
|:--|:---:|:---:|:---|
653
-
| listen.to | [`eventConsumptionStrategy`](#event-consumption-strategy) | `yes` | Configures the event(s) the workflow must listen to. |
654
+
| listen.to | [`eventConsumptionStrategy`](#event-consumption-strategy) | `yes` | Configures the [event(s)](https://cloudevents.io/) the workflow must listen to. |
655
+
| listen.read | `string` | `no` | Specifies how [events](https://cloudevents.io/) are read during the listen operation.<br>*Supported values are:*<br>*- `data`: Reads the [event's](https://cloudevents.io/) data.*<br>*- `envelope`: Reads the [event's](https://cloudevents.io/) envelope, including its [context attributes](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#context-attributes).*<br>*- `raw`: Reads the [event's](https://cloudevents.io/) raw data.*<br>*Defaults to `data`.*|
656
+
| foreach | [`subscriptionIterator`](#subscription-iterator) | `no` | Configures the iterator, if any, for processing each consumed [event](https://cloudevents.io/). |
657
+
658
+
> [!NOTE]
659
+
> A `listen` task produces a sequentially ordered array of all the [events](https://cloudevents.io/) it has consumed, and potentially transformed using `foreach.output.as`.
660
+
661
+
> [!NOTE]
662
+
> When `foreach` is set, the configured operations for a [events](https://cloudevents.io/) must complete before moving on to the next one. As a result, consumed [events](https://cloudevents.io/) should be stored in a First-In-First-Out (FIFO) queue while awaiting iteration.
663
+
664
+
> [!WARNING]
665
+
> [Events](https://cloudevents.io/) consumed by an `until` clause should not be included in the task's output. These [events](https://cloudevents.io/) are used solely to determine when the until condition has been met, and they do not contribute to the result or data produced by the task itself
666
+
654
667
655
668
##### Examples
656
669
@@ -2038,7 +2051,7 @@ do:
2038
2051
bar: baz
2039
2052
```
2040
2053
2041
-
### AsyncAPI Message
2054
+
### AsyncAPI Outbound Message
2042
2055
2043
2056
Configures an AsyncAPI message to publish.
2044
2057
@@ -2073,6 +2086,29 @@ do:
2073
2086
bar: baz
2074
2087
```
2075
2088
2089
+
### AsyncAPI Inbound Message
2090
+
2091
+
Configures an AsyncAPI message consumed by a subscription.
2092
+
2093
+
#### Properties
2094
+
2095
+
| Name | Type | Required | Description |
2096
+
|:-------|:------:|:----------:|:--------------|
2097
+
| payload | `object` | `no` | The message's payload, if any. |
2098
+
| headers | `object` | `no` | The message's headers, if any. |
2099
+
| correlationId | `string` | `no` | The message's correlation id, if any. |
2100
+
2101
+
#### Examples
2102
+
2103
+
```yaml
2104
+
payload:
2105
+
greetings: Hello, World!
2106
+
headers:
2107
+
foo: bar
2108
+
bar: baz
2109
+
correlationid: '123456'
2110
+
```
2111
+
2076
2112
### AsyncAPI Subscription
2077
2113
2078
2114
Configures a subscription to an AsyncAPI operation.
@@ -2081,8 +2117,15 @@ Configures a subscription to an AsyncAPI operation.
2081
2117
2082
2118
| Name | Type | Required | Description |
2083
2119
|:-------|:------:|:----------:|:--------------|
2084
-
| filter | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to filter consumed messages. |
2120
+
| filter | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to filter consumed [messages](#asyncapi-inbound-message). |
2085
2121
| consume | [`subscriptionLifetime`](#asyncapi-subscription-lifetime) | `yes` | An object used to configure the subscription's lifetime. |
2122
+
| foreach | [`subscriptionIterator`](#subscription-iterator) | `no` | Configures the iterator, if any, for processing each consumed [message](#asyncapi-inbound-message). |
2123
+
2124
+
> [!NOTE]
2125
+
> An AsyncAPI subscribe operation call produces a sequentially ordered array of all the [messages](#asyncapi-inbound-message) it has consumed, and potentially transformed using `foreach.output.as`.
2126
+
2127
+
> [!NOTE]
2128
+
> When `foreach` is set, the configured operations for a [message](#asyncapi-inbound-message) must complete before moving on to the next one. As a result, consumed [messages](#asyncapi-inbound-message) should be stored in a First-In-First-Out (FIFO) queue while awaiting iteration.
2086
2129
2087
2130
#### Examples
2088
2131
@@ -2115,7 +2158,7 @@ Configures the lifetime of an AsyncAPI subscription
2115
2158
#### Properties
2116
2159
2117
2160
| Name | Type | Required | Description |
2118
-
|:-------|:------:|:----------:|:--------------|
2161
+
|:-----|:----:|:--------:|:------------|
2119
2162
| amount | `integer` | `no` | The amount of messages to consume.<br>*Required if `while` and `until` have not been set.* |
2120
2163
| for | [`duration`](#duration) | `no` | The [`duration`](#duration) that defines for how long to consume messages. |
2121
2164
| while | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to determine whether or not to keep consuming messages.<br>*Required if `amount` and `until` have not been set.* |
@@ -2143,4 +2186,54 @@ do:
2143
2186
until: '${ ($context.messages | length) == 5 }'
2144
2187
for:
2145
2188
seconds: 10
2189
+
```
2190
+
2191
+
### Subscription Iterator
2192
+
2193
+
Configures the iteration over each item (event or message) consumed by a subscription. It encapsulates configuration for processing tasks, output formatting, and export behavior for every item encountered.
2194
+
2195
+
#### Properties
2196
+
2197
+
| Name | Type | Required | Description |
2198
+
|:-----|:----:|:--------:|:------------|
2199
+
| item | `string` | `no` | The name of the variable used to store the current item being enumerated.<br>*Defaults to `item`.* |
2200
+
| at | `string` | `no` | The name of the variable used to store the index of the current item being enumerated.<br>*Defaults to `index`.* |
2201
+
| do | [`map[string, task][]`](#task) | `no` | The tasks to perform for each consumed item. |
2202
+
| output | [`output`](#output) | `no` | An object, if any, used to customize the item's output and to document its schema. |
2203
+
| export | [`export`](#export) | `no` | An object, if any, used to customize the content of the workflow context. |
0 commit comments