Looping blocks#

Drive a chain once per list item or a fixed number of times, then gather every answer back into one array.

Looping blocks run part of a flow once per item, then gather the answers back into one value. They come as a pair: For or Repeat drives the loop, and Collect catches what comes out the other end.

The pattern is always the same. The loop block emits one value at a time into a chain of ordinary blocks. Collect sits at the end of that chain and accumulates the results. Without a Collect, each pass through the loop is lost.

For#

The For block on the canvas

Iterates over a list. Connect an array to List, and connect something to Start to set the loop going. Each element leaves through Item in turn, so everything downstream runs once per element.

Use it when a block hands you a set of things and you need to process each one: addresses out of a log, files out of a batch, indicators out of an extraction.

Repeat#

The Repeat block on the canvas

Iterates a fixed number of times. Connect a number to Count and something to Start, and the loop counter leaves through Index on each pass.

Use it when a count drives the work rather than a collection, for example when you step through a fixed number of pages.

Collect#

The Collect block on the canvas

Gathers values into an array. The block accumulates every value that arrives on Item. When the loop finishes, the full array leaves through List and Finish fires.

Wire Finish into whatever should happen once, with the complete set, rather than once per item. That distinction is the point of the block: everything before Collect runs per item, everything after Finish runs once.