Blocks & Flow EditorCommon
while loop
Repeat flow execution while a condition expression evaluates to true
The while loop block repeats the connected path while a condition expression evaluates to true. When the condition is false (or max iterations exceeded), the flow exits from the false output.
Configuration
| Field | Description |
|---|---|
| Name | Optional display label. Defaults to the condition expression if empty. |
| Condition | JavaScript-like expression evaluated each iteration. Can reference msg, and use flow.get("key") / global.get("key"). Loop continues while this returns true. |
| Break out after N times | Safety limit — exit the loop after the specified number of iterations even if the condition is still true (default 10000). Prevents infinite loops. |
| Key | Variable storing the current loop count (msg, flow, or global). Required when the iteration limit is enabled. Auto-generated if blank. |
Outputs
| Port | Label | Description |
|---|---|---|
| Lower | true | Fires while condition is true — connect loop body here |
| Upper | false | Fires when condition is false or iteration limit reached |
Notes
- Ensure the condition eventually becomes false, or enable the iteration limit
- Access flow context:
flow.get("retries") < 5 - Combine with delay blocks inside the loop when polling external systems
- Modifying condition variables incorrectly inside the loop can cause infinite execution