From 4b36282fdf3e3c596af0271f3152fd2c21e00b6f Mon Sep 17 00:00:00 2001 From: Ricardo Zanini Date: Thu, 23 Jul 2026 14:57:21 -0400 Subject: [PATCH 1/2] [Fix #1163] Allow inline arrays in for.in property The for.in property now accepts either a runtime expression (string) or an inline array of objects, making the schema more flexible for cases where the collection is known at definition time. Signed-off-by: Ricardo Zanini --- dsl-reference.md | 2 +- examples/for-inline-array.yaml | 20 ++++++++++++++++++++ schema/workflow.yaml | 10 ++++++++-- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 examples/for-inline-array.yaml diff --git a/dsl-reference.md b/dsl-reference.md index 23156db3..3407d847 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -688,7 +688,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` | `yes` | A [runtime expression](dsl.md#runtime-expressions) 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-array.yaml b/examples/for-inline-array.yaml new file mode 100644 index 00000000..5efda5b4 --- /dev/null +++ b/examples/for-inline-array.yaml @@ -0,0 +1,20 @@ +document: + dsl: '1.0.3' + namespace: test + name: for-inline-array-example + version: '0.1.0' +do: + - logColors: + for: + each: color + in: + - name: red + hex: '#FF0000' + - name: green + hex: '#00FF00' + - name: blue + hex: '#0000FF' + do: + - setProcessed: + set: + processed: '${ .processed + [$color] }' diff --git a/schema/workflow.yaml b/schema/workflow.yaml index a443ed50..248087c7 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -695,9 +695,15 @@ $defs: description: The name of the variable used to store the current item being enumerated. default: item in: - type: string title: ForIn - description: A runtime expression used to get the collection to enumerate. + description: A runtime expression or an inline array used to get the collection to enumerate. + oneOf: + - type: string + title: ForInExpression + - type: array + title: ForInInlineArray + items: + type: object at: type: string title: ForAt From 0a74479a48192952ec37117bffebdc88cf46f438 Mon Sep 17 00:00:00 2001 From: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> Date: Thu, 23 Jul 2026 15:28:07 -0400 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- dsl-reference.md | 2 +- schema/workflow.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dsl-reference.md b/dsl-reference.md index 3407d847..1343125a 100644 --- a/dsl-reference.md +++ b/dsl-reference.md @@ -688,7 +688,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 used to get the collection to enumerate. | +| 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.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/schema/workflow.yaml b/schema/workflow.yaml index 248087c7..c677fd2e 100644 --- a/schema/workflow.yaml +++ b/schema/workflow.yaml @@ -700,10 +700,13 @@ $defs: oneOf: - type: string title: ForInExpression + description: A runtime expression used to get the collection to enumerate. - type: array title: ForInInlineArray + description: An inline array of objects to enumerate. items: type: object + description: An item in the inline collection. at: type: string title: ForAt