Loops & Parallel

WorkflowsLoops & Parallel

Repeating the same steps across a whole collection is one of the most fundamental ideas in programming. Sim 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 concurrent batches

The Parallel block runs independent items concurrently, using a configurable batch size.

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.

Sequential or concurrent

  • Loop runs items sequentially: one finishes before the next begins. Use it when an iteration depends on the previous one or the calls need to stay in order.
  • Parallel runs independent items in concurrent batches. Set Batch Size from 1 to 20; larger collections run in successive batches. Choose a size that fits the service you are calling.

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 items concurrently in batches. 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.