For Of
Run the body for each item in a list.
Type
loop.for-of Block Loops
Folder
basic/loopsChannels
Any
Pipe
Value
Scope
Any
For Of walks a list and runs the callback body once per item. After the last item, the main path continues and the pipe holds every value the body returned.
Use For In for object keys. Use For for a numeric range.
Configure
| Setting | Description |
|---|---|
| Array | Context path to the list (args.*, pipe.*, named variables). Must be a list |
The Callback outlet must be connected to a Lambda block. If it is not connected, the run fails.
Handles
| Handle | Role |
|---|---|
| In (target) | Incoming connection |
| Out (source) | Continues after the loop finishes (main path, same scope) |
| Callback | New callback scope for each item. Connect to Lambda |
Inside the body (after Lambda), use:
| Path | Meaning |
|---|---|
args.index | Zero-based position in the list |
args.item | Current item |
End the body with a return. That returns from this callback, not from the whole workflow. The value is stored for this item. Continue skips the rest of this item. Break stops remaining items. An unconnected Out ends the main path after the loop.
Pipe schema
The next block on the main path reads this on the data pipe (pipe.value).
| Field | Type | Description |
|---|---|---|
| Results | list | Values returned for each item, in list order |