For In
Run the body for each key and value in an object.
Type
loop.for-in Block Loops
Folder
basic/loopsChannels
Any
Pipe
Value
Scope
Any
For In walks the keys of an object and runs the callback body once per key. After the last key, the main path continues and the pipe holds every value the body returned.
Use For Of for a list of items. Use For for a numeric range.
Configure
| Setting | Description |
|---|---|
| Object | Context path to the object (args.*, pipe.*, named variables). Must be a plain object, not 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 key. Connect to Lambda |
Inside the body (after Lambda), use:
| Path | Meaning |
|---|---|
args.index | Zero-based iteration count |
args.key | Current key (text) |
args.value | Value at that key |
End the body with a return. That returns from this callback, not from the whole workflow. The value is stored for this key. Continue skips the rest of this key. Break stops remaining keys. 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 key, in key order |