Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dsl-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br>Defaults to `item`. |
| for.in | `string` \| `array<object>` | `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. |
Comment thread
ricardozanini marked this conversation as resolved.
| for.at | `string` | `no` | The name of the variable used to store the index of the current item being enumerated.<br>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. |
Expand Down
17 changes: 17 additions & 0 deletions examples/for-inline-primitive-array.yaml
Original file line number Diff line number Diff line change
@@ -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 }'
Comment thread
ricardozanini marked this conversation as resolved.
Comment thread
ricardozanini marked this conversation as resolved.
3 changes: 1 addition & 2 deletions schema/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading