Skip to content

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

PropertyDescriptionDefault
LabelDisplay name for the loop on the canvas.Loop
Max IterationsMaximum number of times the loop can execute before forcing an exit. Safety limit to prevent infinite loops.50

Advanced Settings

PropertyDescriptionDefault
Exit ConditionAn optional expression using {{variable}} syntax. The loop exits when this condition evaluates to true.Empty
Route to Exit on MaxIf enabled, routes to the Exit handle when max iterations are reached. If disabled, the conversation ends with a message.true
Max Iterations MessageMessage shown when max iterations are reached and the conversation ends (only used when "Route to Exit on Max" is disabled).Empty

Handles

HandleDirectionDescription
InputInReceives execution from the previous node
ContinueOutLoop back -- connect to the nodes that should repeat
ExitOutBreak out of the loop -- connect to the nodes that run after the loop ends

How It Works

  1. Execution enters the loop node.
  2. If the exit condition is set and evaluates to true, execution follows the Exit handle.
  3. If max iterations have been reached, execution follows the Exit handle (or ends the conversation, depending on configuration).
  4. Otherwise, execution follows the Continue handle, and the loop count increments.
                    ┌────────────────────────────────┐
                    │                                │
[Previous Node] → [Loop] ──Continue──→ [Process] ───┘

                    └──Exit──→ [After Loop]
imageLoop node config panel showing the label field, max iterations input, optional exit condition expression, and Route to Exit on Max toggle
Loop node configuration panel
imageLoop 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
Loop flow pattern on canvas showing continue and exit paths

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.

OmniBots AI Bot Platform