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
@@ -333,7 +334,7 @@ The [AsyncAPI Call](#asyncapi-call) enables workflows to interact with external
333
334
| 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`.* |
334
335
| 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. |
335
336
| 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`* |
336
-
| 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.* |
337
+
| 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.* |
337
338
| 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.* |
338
339
| authentication | `string`<br>[`authentication`](#authentication) | `no` | The authentication policy, or the name of the authentication policy, to use when calling the AsyncAPI operation. |
339
340
@@ -672,7 +673,19 @@ Provides a mechanism for workflows to await and react to external events, enabli
672
673
673
674
| Name | Type | Required | Description|
674
675
|:--|:---:|:---:|:---|
675
-
| listen.to | [`eventConsumptionStrategy`](#event-consumption-strategy) | `yes` | Configures the event(s) the workflow must listen to. |
676
+
| listen.to | [`eventConsumptionStrategy`](#event-consumption-strategy) | `yes` | Configures the [event(s)](https://cloudevents.io/) the workflow must listen to. |
677
+
| 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`.*|
678
+
| foreach | [`subscriptionIterator`](#subscription-iterator) | `no` | Configures the iterator, if any, for processing each consumed [event](https://cloudevents.io/). |
679
+
680
+
> [!NOTE]
681
+
> 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`.
682
+
683
+
> [!NOTE]
684
+
> 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.
685
+
686
+
> [!WARNING]
687
+
> [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
@@ -2004,7 +2015,7 @@ An event object typically includes details such as the event type, source, times
2004
2015
| subject | `string` | `no` | Describes the subject of the event in the context of the event producer. |
2005
2016
| datacontenttype | `string` | `no` | Content type of `data` value. If omitted, it implies the `data` is a JSON value conforming to the "application/json" media type. |
2006
2017
| dataschema | `string` | `no` | An URI formatted string, or [runtime expression](dsl.md#runtime-expressions), that identifies the schema that `data` adheres to. |
2007
-
| data | `object` | `no` | The event payload. |
2018
+
| data | `any` | `no` | The event payload. |
2008
2019
2009
2020
*Additional properties can be supplied, see the Cloud Events specification [documentation](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#extension-context-attributes) for more info.*
2010
2021
@@ -2445,7 +2456,7 @@ do:
2445
2456
bar: baz
2446
2457
```
2447
2458
2448
-
### AsyncAPI Message
2459
+
### AsyncAPI Outbound Message
2449
2460
2450
2461
Configures an AsyncAPI message to publish.
2451
2462
@@ -2480,16 +2491,46 @@ do:
2480
2491
bar: baz
2481
2492
```
2482
2493
2494
+
### AsyncAPI Inbound Message
2495
+
2496
+
Configures an AsyncAPI message consumed by a subscription.
2497
+
2498
+
#### Properties
2499
+
2500
+
| Name | Type | Required | Description |
2501
+
|:-------|:------:|:----------:|:--------------|
2502
+
| payload | `object` | `no` | The message's payload, if any. |
2503
+
| headers | `object` | `no` | The message's headers, if any. |
2504
+
| correlationId | `string` | `no` | The message's correlation id, if any. |
2505
+
2506
+
#### Examples
2507
+
2508
+
```yaml
2509
+
payload:
2510
+
greetings: Hello, World!
2511
+
headers:
2512
+
foo: bar
2513
+
bar: baz
2514
+
correlationid: '123456'
2515
+
```
2516
+
2483
2517
### AsyncAPI Subscription
2484
2518
2485
2519
Configures a subscription to an AsyncAPI operation.
2486
2520
2487
2521
#### Properties
2488
2522
2489
2523
| Name | Type | Required | Description |
2490
-
|:-----|:----:|:--------:|:------------|
2491
-
| filter | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to filter consumed messages. |
2524
+
|:-------|:------:|:----------:|:--------------|
2525
+
| filter | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions), if any, used to filter consumed [messages](#asyncapi-inbound-message). |
2492
2526
| consume | [`subscriptionLifetime`](#asyncapi-subscription-lifetime) | `yes` | An object used to configure the subscription's lifetime. |
2527
+
| foreach | [`subscriptionIterator`](#subscription-iterator) | `no` | Configures the iterator, if any, for processing each consumed [message](#asyncapi-inbound-message). |
2528
+
2529
+
> [!NOTE]
2530
+
> 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`.
2531
+
2532
+
> [!NOTE]
2533
+
> 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.
2493
2534
2494
2535
#### Examples
2495
2536
@@ -2552,18 +2593,68 @@ do:
2552
2593
seconds: 10
2553
2594
```
2554
2595
2596
+
### Subscription Iterator
2597
+
2598
+
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.
2599
+
2600
+
#### Properties
2601
+
2602
+
| Name | Type | Required | Description |
2603
+
|:-----|:----:|:--------:|:------------|
2604
+
| item | `string` | `no` | The name of the variable used to store the current item being enumerated.<br>*Defaults to `item`.* |
2605
+
| at | `string` | `no` | The name of the variable used to store the index of the current item being enumerated.<br>*Defaults to `index`.* |
2606
+
| do | [`map[string, task][]`](#task) | `no` | The tasks to perform for each consumed item. |
2607
+
| output | [`output`](#output) | `no` | An object, if any, used to customize the item's output and to document its schema. |
2608
+
| export | [`export`](#export) | `no` | An object, if any, used to customize the content of the workflow context. |
0 commit comments