While
Type
loop.whilebasic/loopsAny
Value
Any
While checks a condition (query) before each iteration. If it matches, it runs the callback body, then checks again. If it does not match, the main path continues. A missing or empty condition fails the run.
Use Do While when the body must run once before the condition is checked. Use For when the count is known up front.
Configure
| Setting | Description |
|---|---|
| Condition | Required query (AND/OR, rules, nested groups, Not), same builder as Condition. Left-side fields come from this block’s context, plus args.index for the upcoming iteration |
| Max iterations (optional) | Safety cap. Defaults to 1000. Must be greater than 0 |
The condition owns continue/stop. The body’s return is only collected on the pipe; it does not decide whether to loop again.
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 iteration. Connect to Lambda |
Inside the body (after Lambda), use:
| Path | Meaning |
|---|---|
args.index | Zero-based iteration count (0, 1, 2, …) |
End the body with a return to collect a value for this iteration. Continue skips the rest of this pass. Break stops the loop early. 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 from each iteration, in order |
Use case
- Keep retrying or polling while a variable or pipe value still matches a rule (status is
open, flag is true). - Cap with Max iterations so a still-true condition cannot run forever.
- Return a mapped result from the body (not
true/falsefor looping). Use Continue to skip the rest of this pass, or Break to stop from a nested branch.