Expand description
"loop" node — while-loop over an inline sub-flow.
Repeatedly executes a sub-flow until either a break_condition is satisfied
or max_iterations is reached. The last iteration’s collected output is
returned. Each iteration receives the previous one’s output as a variable,
enabling accumulation and chaining patterns.
§Config schema
{
"flow": { "nodes": [...], "edges": [...] },
"output_selector": "step.result",
"max_iterations": 10,
"break_condition": { "from": "step", "path": "done", "op": "eq", "value": true }
}| Field | Type | Required | Description |
|---|---|---|---|
flow | object | ✅ | Inline sub-flow definition ({ "nodes", "edges" }) |
output_selector | string | ✅ | Dot path into sub-flow outputs to collect each iteration ("node_id" or "node_id.field") |
max_iterations | integer | — | Safety cap (default 10, minimum 1) |
break_condition | Condition | — | If provided, the loop stops when this condition evaluates to true against the sub-flow’s outputs; without it the loop always runs max_iterations times |
§Variables injected into each iteration’s sub-flow
| Variable | Value |
|---|---|
iteration_index | 0-based iteration counter |
loop_output | The previous iteration’s collected output (null for the first iteration) |
§Output schema
{ "output": <last_output_selector_result>, "iterations": 3 }§Example — retry until success
{
"id": "retry",
"type": "loop",
"data": {
"max_iterations": 5,
"output_selector": "check.ok",
"break_condition": { "from": "check", "path": "ok", "op": "eq", "value": true },
"flow": {
"nodes": [
{ "id": "fetch", "type": "http-request", "data": { "url": "https://api.example.com/status" } },
{ "id": "check", "type": "if-else", "data": { "cases": [
{ "id": "ok", "conditions": [{ "from": "fetch", "path": "status", "op": "eq", "value": 200 }] }
]}}
],
"edges": [{ "source": "fetch", "target": "check" }]
}
}
}Structs§
- Loop
Node - Loop node — while-loop over a sub-flow.