Action Flow Control
For Loop
Executes a subgraph multiple times, once for each item in an array or for a specified number of iterations. The subgraph can access iteration data via the Get Iterator node.
Node IDForLoopAction
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Loop Type loop_type | enum | No | ForEach | ForEach iterates over array items, Range iterates a specified number of times. |
Items (ForEach) items | array_object | No | [] | Array of items to iterate over (used when Loop Type is ForEach). |
Start (Range) start | integer | No | 0 | Starting index for Range loop. |
End (Range) end | integer | No | 10 | Ending index for Range loop (exclusive). |
Step (Range) step | integer | No | 1 | Step increment for Range loop. |
Subgraph Path subgraph_path | file_picker | No | "" | Path to the subgraph file to execute for each iteration (e.g., './subgraphs/loop_body.json'). |
Collect Outputs collect_outputs | boolean | No | true | If true, collects all iteration outputs into an array. If false, only returns the last iteration's output. |
Aggregate By Key aggregate_by_key | boolean | No | false | If true, merges outputs by their identifier keys into arrays (e.g., multiple "png_files" outputs become one array). Only works when collect_outputs is true. |
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
Execute input0 | object | No | Trigger to start the loop execution. |
Outputs
| Output | Type | Identifier | Description |
|---|---|---|---|
Results output0 | object | results | The collected results from all iterations (if collect_outputs is true) or the final iteration result. |