Skip to main content
The Loop node repeats a section of the flow a configurable number of times. It maintains a counter variable and provides three exit paths: continue looping, exit on condition, or exit when max iterations are reached.

Behavior

  • Increments the counter variable on each iteration
  • Checks the exit condition (if configured) before each iteration
  • Routes to Loop to continue, Exit when the exit condition is met, or Max when max iterations are reached

Configuration

ParameterTypeDefaultRangeDescription
maxIterationsnumber31–100Maximum number of loop iterations
counterVariablestring"loop_count"Variable name that stores the current iteration number
exitConditionstring""Expression that, when truthy, triggers the Exit path
continueOnErrorbooleanfalseContinue looping even if a node in the loop body errors

Output handles

HandleDescription
LoopContinue to the next iteration — connect this to the first node in the loop body
ExitExit condition was met
MaxMaximum iterations reached

Use cases

Loop up to 3 times around an API Call node. On API.SUCCESS, take the Exit path. On API.ERROR, loop again. After 3 failures, the Max path plays an error message and ends the call.
Loop to collect multiple data points from the caller (e.g., “Enter item 1… Enter item 2…”). Use {{loop_count}} in the TTS text to indicate which item number.