From bc25a36590c0c724be29880c2bec78ca166d0f7c Mon Sep 17 00:00:00 2001 From: Ricardo Zanini Date: Tue, 11 Aug 2026 12:26:12 -0400 Subject: [PATCH] [Fix #1186] Allow any type in for.in inline array Signed-off-by: Ricardo Zanini --- dsl-reference.md | 2 +- examples/for-inline-primitive-array.yaml | 17 +++++++++++++++++ schema/workflow.yaml | 3 +-- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 examples/for-inline-primitive-array.yaml diff --git a/dsl-reference.md b/dsl-reference.md index b79d734b..bf2f2519 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -689,7 +689,7 @@ Allows workflows to iterate over a collection of items, executing a defined set | Name | Type | Required | Description| |:--|:---:|:---:|:---| | for.each | `string` | `no` | The name of the variable used to store the current item being enumerated.
Defaults to `item`. | -| for.in | `string` \| `array` | `yes` | A [runtime expression](dsl.md#runtime-expressions) or an inline array of objects used to get the collection to enumerate. | +| for.in | `string` \| `array` | `yes` | A [runtime expression](dsl.md#runtime-expressions) or an inline array used to get the collection to enumerate. | | for.at | `string` | `no` | The name of the variable used to store the index of the current item being enumerated.
Defaults to `index`. | | while | `string` | `no` | A [runtime expression](dsl.md#runtime-expressions) that represents the condition, if any, that must be met for the iteration to continue. | | do | [`map[string, task]`](#task) | `yes` | The [task(s)](#task) to perform for each item in the collection. | diff --git a/examples/for-inline-primitive-array.yaml b/examples/for-inline-primitive-array.yaml new file mode 100644 index 00000000..eb2f8792 --- /dev/null +++ b/examples/for-inline-primitive-array.yaml @@ -0,0 +1,17 @@ +document: + dsl: '1.0.3' + namespace: test + name: for-inline-primitive-array-example + version: '0.1.0' +do: + - sumNumbers: + for: + each: number + in: + - 1 + - 2 + - 3 + do: + - add: + set: + sum: '${ .sum + $number }' diff --git a/schema/workflow.yaml b/schema/workflow.yaml index 88c92bd1..9f9d1b41 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -711,9 +711,8 @@ $defs: description: A runtime expression used to get the collection to enumerate. - type: array title: ForInInlineArray - description: An inline array of objects to enumerate. + description: An inline array to enumerate. items: - type: object description: An item in the inline collection. at: type: string