AACFlow

Loops & Parallel

WorkflowsLoops & Parallel

Repeating the same steps across a whole collection is one of the most fundamental ideas in programming. AACFlow.io gives you two blocks for it: the Loop block and the Parallel block. They do the same job and differ only in how they run.

What you will learn

A container over a collection

Drop blocks inside a Loop or Parallel and hand it a collection; it runs those blocks once for every item.

Loop runs one at a time

The Loop block iterates sequentially, item by item in order, when each step can depend on the last.

Parallel runs all at once

The Parallel block runs every item concurrently, far faster when the items are independent.

A block that holds blocks

A Loop (or Parallel) is a container, a block you drop other blocks inside. You hand it a collection, and it runs whatever's inside once for every item in that collection, turning a single step into many.

Here's the shape of it: a container wrapping the blocks it repeats over the collection:

What each run knows

Inside the container, every iteration gets the current item to work on (and its index). That's how one lane of blocks becomes a run per lead, per row, or per file: the steps stay the same, the data changes each pass.

One at a time, or all at once

This is the whole difference between the two blocks:

  • Loop runs the items sequentially, one finishes before the next begins. Reach for it when each step builds on the last, or when you need to respect order or rate limits.
  • Parallel runs them all at once, every item concurrently. Reach for it when the items are independent; it's dramatically faster across a large collection.

Swapping the container

Because the two blocks share the same shape, you can swap a Loop for a Parallel (or back) without rewiring anything inside. Same logic, different execution, sequential or concurrent, chosen by which container you wrap it in.

Common Questions

Both repeat the blocks inside them over a collection. The Loop runs one item at a time in order; the Parallel block runs every item at once. The results collect the same way in both.
Through the container's references, such as the current item tag: each pass sees its own item, and downstream blocks read the collected results when the container finishes.
When passes depend on each other, when order matters, or when you want to control the pace of calls to an external service. Reach for Parallel when items are independent and speed matters.