Blocks & Flow EditorCommon

counter loop

Repeat a flow path while a counter comparison evaluates to true

The counter loop block repeats the connected flow path while a counter variable satisfies a comparison against a termination value. When the comparison is false, the flow exits from the false output.

Bot Studio counter loop block on canvas Counter loop Initial, Stop, Increment, and operator configuration

Configuration

FieldDescription
NameOptional display label. Defaults to the counter expression if empty.
KeyCounter variable name (msg, flow, or global scope). Auto-generated if blank. Must be null, undefined, or empty on first entry.
InitialStarting value for the counter (number or property reference). Typically 0.
StopOperator and termination value. Loop continues while counter <operator> termination is true.
OperatorComparison: <, <=, >, >=, or ==.
TerminationValue to compare against (number or property reference).
IncrementAmount added to the counter each iteration (default 1).
Set counter variable to … when exitingReset counter to null, undefined, or empty string on exit — useful for nested loops.

Outputs

PortLabelDescription
LowertrueFires while the comparison is true — connect loop body here
UpperfalseFires when the comparison is false — loop finished

Notes

  • Example: Initial 0, Stop < 10, Increment 1 runs the body 10 times (0 through 9)
  • Wire the loop body back to the counter-loop input to increment and re-evaluate
  • Avoid modifying the counter or termination values inside the loop in ways that prevent exit
  • First entry requires the counter variable to be unset so Initial is applied
On this page

On this page