Station AcademyActivity referenceRPAi StationConsultingAurora Academy
Level 3 · Automation fundamentals

Loops

Repeat steps a fixed number of times, once for each item in a list, or while a condition holds, and leave a loop with Break or skip ahead with Continue.

Intermediate≈ 18 min (estimate)Windows, macOSWorkflow engine-tested
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 TypeRepeatsSettings
counta fixed number of timesCount
collectiononce for each item in a listCollection Variable (a list variable's name), Item Variable (default item)
conditionwhile a condition is trueCondition, for example count < 10 or status == "ready"
infiniteuntil a Break or until you stop the runnone

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.