Skip to content

While loops

A while loop keeps running its body indefinitely until something stops it — either a manual cancel or an early-stop condition tripping.

Left alone, the loop keeps running. There are three ways to stop it:

  • Cancel it manually.
  • An early stop/break configured on the loop itself.
  • An early stop configured on one of its steps.

A running flow can be cancelled from the flow page — reachable whether the flow was triggered manually or from the Runs page.

Early stop/Break lets you define a predicate expression, checked at the end of (or before) a step, that decides whether the loop should stop there.

Each step in the loop can carry its own early-stop condition: the step’s result is checked against the predicate, and if it matches, the flow (and by extension the loop) stops right after that step.

When enabled, a failed iteration doesn’t stop the loop — it just moves on to the next one.

When enabled, every iteration runs on the same worker. For languages that support it (TypeScript and Python), the loop also reuses a single runner process across iterations rather than starting a fresh one each time, cutting out the cold-start cost between them. It’s the same mechanism dedicated workers use, just scoped to how long this loop runs rather than kept alive permanently.

Click Test an iteration to run a single pass of the loop and see its result without running the whole loop.

Covered above.

A flow can pause and wait for a resume or cancel event before continuing — most commonly used for approval steps, though nothing stops you from using it for other kinds of human-in-the-loop pauses.

A step can also just pause for a fixed duration instead of waiting on an external event.

Mocking (pinning a result) lets you iterate on a flow faster while building it: a mocked step returns its pinned value immediately, skipping the real computation entirely.

Once the flow finishes, this step’s logs, arguments, and results are deleted from Orvanta rather than kept around.