Flow control

Loop Block

Loop repeats connected Blocks by item, count, pagination, or scrolling mode and exposes iteration variables while it runs.

At a glance

Modes
For each, count, paginate, scroll
Variables
{{current_item}} and {{loop_counter}}
Zero items
Skips the body
Error handle
Yes

What it does

Loop repeats a section of a Flow. In for-each mode it iterates over a list variable; in count mode it repeats a fixed number of times.

Pagination and scroll modes are for pages where more content appears by clicking a next button or scrolling.

Use it when

  • Run the same Blocks for each item in a list.
  • Click through paginated result pages.
  • Scroll until new items stop appearing.

Do not use it when

  • A single Block can already handle the repeated content.
  • The repeated path changes shape on every iteration.
  • You do not have a reliable end condition for pagination or scrolling.

Settings

Loop settings depend on mode. For-each uses a list variable; count uses a number; paginate and scroll use page behavior settings.

Loop mode

Required: Yes
Variables
No
Description
Choose for each, count, paginate, or scroll.

List variable

Required: For for-each mode
Variables
Variable name
Description
List to iterate over. The current item is available inside the loop.

Count

Required: For count mode
Variables
No
Description
Number of times to repeat the loop body.

Next selector

Required: For paginate mode
Variables
Yes
Description
Selector for the next-page control.

Scroll settings

Required: For scroll mode
Variables
Selectors can use variables
Description
Controls scroll target, item watching, and stop conditions.

Outputs

Loop exposes iteration variables while the loop body runs.

{{current_item}}any

Current list item in for-each mode, unless renamed.

{{loop_counter}}number

Current iteration counter, unless renamed.

Example Flow

Use Loop when the same group of Blocks should run repeatedly with changing input.

  1. Create or extract a list.
  2. Loop over the list or page state.
  3. Use iteration variables inside the loop body.

Errors and fixes

Start with symptoms visible in the editor or Inspector, then check the earliest Block that produced the wrong page state, variable, or output.

The loop body never runs.

Check
Check whether the list is empty, count is zero, or the stop condition is already met.
Fix
Inspect the loop input variable and mode settings.

The loop never ends.

Check
Check pagination, scroll, and max iteration settings.
Fix
Add a page limit, item cap, or reliable stop condition.

Local and cloud runs

Local and cloud runtimes support the same loop modes, but defaults and pagination limits should be checked when changing loop behavior.