Build

Branches and loops

Three steps repeat work (and a fourth, Try, keeps a run going after a failure): Loop repeats while a condition holds, Iterate steps run their body once per item of a collection, and Jump goes back to an earlier step. Each has a limit, and each limit is enforced.

The «Loop» step repeats the steps inside it while a condition is true, up to a maximum number of laps that you set (a new loop starts at 100; the highest you can enter is 500).

  • Before each lap the engine checks the limit, and then the condition. A loop with a maximum of N laps therefore succeeds only if the condition turns false after at most N-1 laps of the body. If the condition would only turn false after N laps, the step fails with "the loop exceeded the N laps allowed".
  • That failure ends the run as failed, with no automatic retry, unless the loop is inside a Try. Pressing Retry runs it again, which hits the same limit.
  • The loop does not have an item variable. The condition sees what the body produced in earlier laps; later laps overwrite same-named values, and the last value stays after the loop ends.
  • A wait inside the body parks the whole run; when it resumes, earlier laps are replayed from the record.
  • Each lap uses at least one of the 1000 steps a run may take, for the condition alone. A loop of 500 laps with three steps in its body would need 2000, so the run limit usually stops a loop before its own limit.
  • The loop step itself costs no credit; the steps in its body cost one per lap.

The first lap

On the first lap, a variable created inside the body does not exist yet. A condition "X is equal to true" is then false and the loop never starts; "X is not equal to true" is true and the loop runs; "has at least one item" fails the step. To stop a loop when a step inside it gives a result, compare with «is not equal to».

An Iterate step resolves a collection once, then runs its body once for each item. Inside the body, the item is a variable (the step's own value). The collection is read once and recorded, so a resumed run goes through the same items even if the data changed.

StepCollectionItem
«Iterate list»Any list in your workflow: the result of a search, a list field of a record.The item of the list
«Iterate attachments»The attachments of an email message (needs the message id).Id, file name, content type, size
«Iterate thread messages»The messages of an email thread.The message
«Iterate channel members»The members of a Slack channel.User id, name, real name, whether it is a bot
  • An empty collection is not an error: the body is skipped.
  • A collection of more than 500 items is rejected before the first one is processed: the run fails with "resolved more than 500 elements", and is not retried. It never processes only the first 500. Narrow the source (a filter, a date range) before iterating.
  • A search that returns a page of results gives you only that page.
  • Variables created in the body accumulate across items, and the last item's value stays.
  • Every step in the body counts towards the 1000 steps of the run, and costs credits for every item.

The email and Slack iterators are described in Integrations.

The «Jump to an earlier step» step sends the run back to an earlier step, for retry-style flows ("check again"). It has no condition of its own: put it inside a «Condition» to jump conditionally.

  • The target must be a step before the jump: an earlier step at the same level or any level above it, or a step that contains the jump. A step inside the branches of an earlier composite is not a valid target. Saving rejects a target that does not exist or is not earlier.
  • You set the maximum number of jumps (default 3, between 1 and 500). When they are used up, the run is not failed: it simply continues with the next step.
  • Each jump uses one of the 1000 steps of the run and costs no credit itself. The steps between the target and the jump run again on every pass; each one counts towards the 1000 steps and costs its own credit.
  • Variables made on the way are kept; the last pass wins.

The «Try» step is not a repeat but belongs with the other steps that hold a body. It has no fields: it runs the steps inside it, and if one fails the run goes on with the step after the Try instead of ending. Its outcome («Has failed» and «Error message») is what the next steps can read. A Try around a loop or an Iterate step catches the loop limit as a step failure, but not the 500-item limit of Iterate, which ends the run. In the run viewer, the step that failed inside shows as «Caught error». The details, the pattern and what it does not catch are in Errors and retries.

There is no maximum number of steps and no maximum nesting declared for a workflow. The one structural limit is that the stored definition cannot be more than 100 levels deep, counting every wrapper (each nested step adds a couple of levels).

LimitValueAt the limit
Laps of a Loop500 at most (default 100)The step fails, the run fails
Items of an Iterate step500The run fails before processing any item
Jumps of one Jump step500 at most (default 3)The run continues with the next step
Steps of a run1000The run fails, with no retry

All hard limits, with what happens at each, are in Limits and credits.

  • Build

    Conditions and operators

    A condition compares one variable with one value. The Condition step sends the run down one of two paths; the Switch step picks the first of several.

  • Run

    Limits and credits

    Each limit below is enforced by the engine. The last column says what happens when you reach it, because that is usually the question.

  • Build

    Data and expressions

    You do not write formulas in a workflow. You pick values from lists, and Filmo stores what you picked as a structured expression. This page explains what the picker offers and how the values behave when the run executes.