- Before this lesson
- Conditions
- You will learn to
- Choose the right Loop Type
- Loop over a list with an item variable
- Use Break and Continue
- Avoid endless loops
- Sample files
- conditions-and-loops.station.json
Loop types
Loop has four Loop Type choices:
| Loop Type | Repeats | Settings |
|---|---|---|
| count | a fixed number of times | Count |
| collection | once for each item in a list | Collection Variable (a list variable's name), Item Variable (default item) |
| condition | while a condition is true | Condition, for example count < 10 or status == "ready" |
| infinite | until a Break or until you stop the run | none |
Children of the loop run once per repetition; then the workflow continues after the loop.
Lists
A collection loop needs a list. You get one from String Operation split, from List Files, from Parse Data on JSON, or by building it with List Add Item.
Break and Continue
- Break leaves the nearest loop immediately.
- Continue skips the rest of this repetition and starts the next one.
Both must be inside a loop, usually inside an If Condition.
The sample
conditions-and-loops.station.json counts from 1, reports odd or even, and leaves the loop at 7. Then it splits apple,pear,plum into a list and logs each fruit.
Activities in this lesson
Loop · Break · Continue · String Operation
Saved only in this browser.
Workflow engine-tested. The sample workflow was executed with the macOS Station engine (StationCore) without the user interface. UI steps are source-verified. Written against RPAi Station for macOS 0.1.0 (1) (RPAi_Station_2.0 @ port/macos 9864e96) and the Windows source (RPAi_Station_2.0 @ codex/native-station e68f16d). Reviewed 2026-11-30. UI labels may differ slightly in other versions; see versions and changes.