Branches, loops and waits
A plain flow runs its steps one after another. Some built-in nodes change that: they choose a route, repeat steps, pause, or end the run early. You'll find them all under Built-in in Add a step.
| Node | Use it to… |
|---|---|
| Path | Take different routes depending on the data. |
| Loop | Run the same steps once for each item in a list. |
| Stop | End a loop, or the whole run, early. |
| Wait | Pause for a while, until a time, or until someone calls back. |
| Sub Flow | Run another flow as one step and use its result. |
| Filter | Keep only the items of a list that match a condition. |
Branch with Path
A Path step splits the flow into branches. Each branch has its own steps and a Path Mode:
| Path Mode | The branch runs… |
|---|---|
| Based on Condition | When its conditions are true. |
| Always Run (bypass condition) | Every time. |
| Fallback (when no conditions match) | Only when no other branch matched. |
Every branch whose conditions are true runs, not just the first one. If you want "one or the other", make the conditions exclusive, or use one condition branch plus a Fallback. A Path can have only one Fallback branch, and can't have both Always Run and Fallback branches.
Writing conditions
A condition compares a Field, usually a reference to earlier data, with a Value using an Operator, for example:
Field
Form submitted.plan· Operator String: Equals · Valueenterprise
Conditions combine in two ways:
- Add (AND) adds a condition to the same group. Every condition in a group must be true.
- Add (OR) starts another group. The branch matches if any group is true.
The operators are grouped by the kind of value they compare:
| Kind | Operators |
|---|---|
| Any value | Exists, Does Not Exist, Is Empty, Is Not Empty |
| Text | Equals, Not Equals, Contains, Does Not Contain, In, Not In, Starts With, Does Not Start With, Ends With, Does Not End With, Matches Regex |
| Number | Equals, Not Equals, Greater Than, Less Than |
| Date | Equals, Not Equals, Before, After, Is Today, Is In Past, Is In Future |
| Yes / No | Is True, Is False |
Steps on a branch that didn't run have no output in that run. If a later step references them, see When a reference finds nothing.
For a walkthrough, see Branch on a condition.
Repeat with Loop
A Loop step runs the steps inside it once per item. Pick one of three actions:
| Action | Repeats over… | Current value |
|---|---|---|
| Loop Items | A list, such as the records found by an earlier step. | currentItem |
| Loop from Numbers | A range of numbers, such as 1 to 10. | currentValue |
| Loop Text | The parts of a piece of text. | currentPart |
For Loop Items, set Value to a reference to the list, with nothing else in the field, so the list stays a list. Maximum Iterations caps how many times the loop can run.
Inside the loop, steps read the current item from the Loop step's output. For example, Loop.currentItem.email is the email of the record being processed. The Loop step also outputs currentIndex (starting at 0), currentIteration (starting at 1), totalCount and allItems.
You can't put a loop directly inside another loop. If you need to, move the inner loop into a sub flow and call it from the outer loop.
For a walkthrough, see Loop over a list of items.
End early with Stop
A Stop step ends things early, and what it ends depends on where it is:
- Inside a loop, it exits the loop. The flow continues with the step after the loop.
- Outside a loop, it ends the whole run.
Put it on a Path branch to stop only in some cases, such as when a record already exists.
Pause with Wait
A Wait step holds the run, then carries on:
| Action | Pauses until… |
|---|---|
| Wait For | A set amount of time has passed, such as 30 minutes. |
| Wait Until | A specific date and time. |
| Wait For Webhook | Someone calls a URL that's unique to this run. |
Wait For Webhook suits approvals and replies from outside systems. Before the run reaches the Wait step, send its callback URL to whoever should resume the run. You'll find the URL under Execution in the $ list, as Callback URL for… the Wait step. It's only filled in when it's the whole value of a field, so to put it in a message, build the text in a Code step first. Pause a flow until someone responds shows the full pattern.
For walkthroughs, see Delay a step and Pause until someone responds.
Reuse steps with Sub Flow
When several flows need the same steps, build them once as a separate flow and call it:
- In the reusable flow, use the Start Sub Flow trigger and end with Return from Sub Flow, which sends the result back.
- In the calling flow, add a Sub Flow step with Call Sub Flow, pick the reusable flow and fill in its Input Parameters.
With the default Execution Mode, Wait for Completion, the calling flow pauses until the sub flow returns, and the returned values become the Sub Flow step's output. Choose Fire and Forget to start the sub flow and carry on straight away, when you don't need its result. See Call a subflow.
Keep only some items with Filter
A Filter step takes a list and keeps only the items that match your conditions. The steps after it get the shorter list. It's often simpler than a loop with a Path inside: filter first, then loop over what's left.