Theme
Loop Node
The Loop node creates a controlled iteration structure within a flow. It has two output handles -- Continue (loop back) and Exit (break out) -- and enforces a configurable maximum iteration count to prevent infinite loops.
When to Use
- You want to repeat a set of nodes until a condition is met (e.g., retry collecting valid input).
- You need a controlled multi-turn conversation loop with a safety limit.
- You want to iterate over items in a list, processing each one through the same set of nodes.
- You need explicit loop control rather than manually connecting edges back to earlier nodes.
Configuration
| Property | Description | Default |
|---|---|---|
| Label | Display name for the loop on the canvas. | Loop |
| Max Iterations | Maximum number of times the loop can execute before forcing an exit. Safety limit to prevent infinite loops. | 50 |
Advanced Settings
| Property | Description | Default |
|---|---|---|
| Exit Condition | An optional expression using {{variable}} syntax. The loop exits when this condition evaluates to true. | Empty |
| Route to Exit on Max | If enabled, routes to the Exit handle when max iterations are reached. If disabled, the conversation ends with a message. | true |
| Max Iterations Message | Message shown when max iterations are reached and the conversation ends (only used when "Route to Exit on Max" is disabled). | Empty |
Handles
| Handle | Direction | Description |
|---|---|---|
| Input | In | Receives execution from the previous node |
| Continue | Out | Loop back -- connect to the nodes that should repeat |
| Exit | Out | Break out of the loop -- connect to the nodes that run after the loop ends |
How It Works
- Execution enters the loop node.
- If the exit condition is set and evaluates to true, execution follows the Exit handle.
- If max iterations have been reached, execution follows the Exit handle (or ends the conversation, depending on configuration).
- Otherwise, execution follows the Continue handle, and the loop count increments.
┌────────────────────────────────┐
│ │
[Previous Node] → [Loop] ──Continue──→ [Process] ───┘
│
└──Exit──→ [After Loop]Loop node config panel showing the label field, max iterations input, optional exit condition expression, and Route to Exit on Max toggle
Loop node on the flow builder canvas showing a Continue output handle connected back to upstream processing nodes and an Exit output handle connected to downstream nodes, forming a visible loop pattern
TIP
The Loop node is a silent routing node -- it does not send any message to the user. It immediately evaluates its condition and routes execution to the appropriate output handle.
WARNING
Always connect the Exit handle to a downstream node. If the exit handle is disconnected and the max iteration limit is reached, the conversation may end unexpectedly.
