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 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.