Control the run
Loop
Repeats a group of steps for each record, a set number of times, or while or until a condition holds.
Nodes › LogicOpen in Neblex
- Good for
- Repeating several steps
- Role
- Works on the records in a flow
- Find it in
- Nodes › Logic
When to use it
- Page through an API until there is no next page.
- Several steps should run per item, each with its own outcome.
- A check should repeat until a status changes, within a maximum you set.
Reach for something else when
SplitWhen you only need one record per list item.Run another flowWhen the repeated steps are reused by other flows too.
Example
Repeat a request while the response has a next cursor, carrying the cursor into the next round.
How it works
- Settings
- Iteration: For each record [default], Repeat a fixed number of times, While a condition holds, Until a condition holds. Collection path (optional) loops over a list inside each record. Repeat count. Maximum iterations [100] for while/until. Condition. Next iteration input (JSON mapping) for repeat/while/until, using
output,stateandindex. Output: Collect body results [default] or Counts only. If a body fails: Stop the Loop [default] or Continue with the next iteration. - Body
- Click Edit body on the node to build the steps that repeat. Inside the body the mapper offers loop values (index, current item, state, input) and Code sees
loop_index,loop_item,loop_stateandloop_input. Loops can be nested up to 8 levels. - Output
- Collect: the combined results of the body's last steps. Counts only:
{completed, succeeded, failed, canceled}. With Continue, a failed iteration adds{"iteration": n, "status": "failed"}. A while/until loop that reaches its maximum while the condition still holds fails, so it can never spin forever. - Example
- Page through an API: Repeat while
next_cursorexists, carrying{"cursor": output.0.next_cursor}to the next iteration.
Add it to a flow
- Open the flow from Build › Workflows.
- Open Nodes and find Loop under Logic, or search for it. Click it or drag it onto the canvas.
- Drag from the previous step's output handle to its input, then open its settings with ✎ Edit.
- Run the flow and click the step to see the records it received and produced.
More in Control the run
Run another flowRuns another flow as a reusable sub-flow and continues with its result.Nodes › LogicWaitPauses for a set time before passing records on.Nodes › LogicWait for eventPauses the run until a matching event arrives, then continues with its data.Nodes › LogicSet valueSaves a named value that later steps in the same run can read.Nodes › LogicAssert Data QualityChecks the batch against your rules and stops with precise details when one fails.Nodes › LogicValidate RecordsChecks each record against a JSON Schema and tags it valid or invalid.Nodes › Logic