Loops
Repeat Automation steps for each item in a list and control what happens when an iteration fails.
A Loop repeats the same Automation steps once for each item in a list. Use it to apply the same workflow to several items without adding the steps again. This page shows you how to choose a list, use the current item, and handle failures.
Set up a Loop
Add a Loop in the Automation editor. You can use a list from an earlier Variable step or any other list value available in the run.
- In Items to Loop Over, open the list of dynamic values.
- Select the list you want to use.
- In Loop Variable Name, enter a name for the current item or keep the default, Current Item.
Add the steps you want to repeat inside the Loop.
Use the current item in a step
- Open the step inside the Loop that needs the current item.
- In the field where you want to use the item, open the list of dynamic values.
- Select Current Item, or select the name you set in Loop Variable Name.
The value changes to the next item on each iteration. Renaming it later preserves existing references, including those in nested Loops.
Check how the Loop runs
The Loop reads its input list once, when it starts. It runs one item at a time in list order, waiting for each iteration to finish before starting the next.
- If the list is empty, the Automation skips the inner steps and continues after the Loop.
- If Items to Loop Over doesn't resolve to a list, a Loop with inner steps fails.
- If the Loop has no inner steps, the Automation continues to the next step.
Carry values forward
To reuse a value across iterations, define it before the Loop and update it inside. Later iterations and steps after the Loop can use the updated value.
A value created only inside an iteration stays in that iteration. Current Item isn't available after the Loop, even for the last item.
Handle failures inside a Loop
A step failure stops the part of the Automation where it occurs. The Loop's Continue On Failure setting controls what happens after an iteration fails:
Setting | What happens |
|---|---|
Off | The Loop stops. Later iterations and steps after the Loop don't run. |
On | Later iterations and steps after the Loop can still run. The Loop result still records the failure. |
A Condition that doesn't match ends only the current iteration without a failure. Later iterations can still run, regardless of Continue On Failure.
Count step executions
Every step that runs inside each iteration counts separately toward the run's safety limit on step executions. Nested Loops multiply that count because the inner steps run again for each iteration of the outer Loop.
Common questions
How do I build a list for a loop using a Variable step?
Add a Variable step before the Loop and use a Filter to find the ideas you want to process. For example, find ideas that have been in the Rate Phase for more than seven days, then use that list in Items to Loop Over (Variable Steps).
How do I use a specific field from the current item in an expression?
In Dynamic Expressions, select the field you need under Current Item. For example, if the item is an idea, follow its owner to the owner's name if that field is available (Inserting Expressions).
How do I run different steps for different items in the same loop?
Add Paths inside the Loop to run different actions based on the current item. Set a condition for each path using a value from that item, then add the actions for that case (Paths).