Skip to main content

Loops

What this page is — loop containers in the workflow builder: the three loop types, where a loop gets its rounds from, the {{loop.…}} values available inside it, the per-round modifiers for dates and numbers, the rules for steps inside a loop, and what deleting a loop does.

What it is for — doing the same piece of work several times in one run: one post per day for a week, one description per selected product line, one event per session.

The problem it solves — without a loop you either run the workflow seven times, re-typing the form each time, or build seven near-identical steps that drift apart as people edit them. A loop keeps one copy of the steps and runs it once per round, with the round's own date, number or item filled in. The cost of that convenience is that every AI step inside is charged once per round — a loop is the easiest way to multiply a bill by mistake.

Route: /org/ai-workflow-build → a workflow → Add Loop Container · Permission to add or change loops: Change your organisation's workflows: input form, steps, wiring, conditions and loops.


1. Anatomy of a loop​

A loop is a container in the step list. It has its own settings and holds its own steps; the steps inside it run top to bottom, then start again for the next round, until every round is done. Then the workflow carries on with whatever follows the loop.

The loop's card shows its name, its type, and the value it repeats over, for example {{loop.item}} ← {{inputs.days_count}}. The pencil icon (Edit Container) opens its settings; the bin icon (Delete Container) deletes it. Below the header are its steps and an Add Step to Loop button.

Figure 1 — 1 Name, type and loop value, 2 Edit Container, 3 Delete Container, 4 Add Step to Loop.
TermMeaning
RoundOne pass through the loop's steps
Loop sourceThe input-form field that decides how many rounds there are and what each one is about
Loop valueWhat the current round is working on — available as {{loop.item}}
ModifierA value calculated fresh each round, such as a date that moves forward one day

2. Why you would use it​

  • One design, many outputs. Seven posts from one set of steps, all following the same rules.
  • Dates that move by themselves. A modifier turns one start date into a schedule.
  • The person running it decides the size. A number field or a multi-select in the form sets the number of rounds per run.
  • Easier maintenance. Improve the step inside the loop once; every round benefits.

3. Adding and configuring a loop​

Select Add Loop Container. A loop called New Loop is added and opened for editing. Its settings change as you type and are kept when you save the workflow.

SettingWhat to enter
Container NameWhat the loop does, e.g. Write one post per day
Loop TypeNumeric Range (Count), Iterate over List (ForEach) or Multi-Select Options — section 4
Loop Source (Global Input Key)The input-form field the rounds come from. Only fields of the matching type are offered
Counter VariableLeave it as item — see the note below
Start ValueNumeric Range only: the number the first round gets. Default 1
DescriptionOptional notes for other builders
Variable Modifiers (Per Iteration)Optional values recalculated each round — section 6
Keep the counter variable as item

The current round's value is always available as {{loop.item}}. If you rename the counter, the wiring selector offers {{loop. followed by your new name, but that value is not filled in when the workflow runs and the input arrives empty. Keep the default item.

Figure 2 — Loop settings with one per-round modifier: (1) the loop's name, (2) what it repeats over, (3) values that change each round, (4) add a step inside.

4. The three loop types​

Loop typeLoop source must beRounds{{loop.item}} in each round
Numeric Range (Count)A Number fieldThe number entered, e.g. 7Start Value, then +1 each round: 1, 2 … 7
Multi-Select OptionsA Multi Select fieldOne per option tickedThe ticked option's text
Iterate over List (ForEach)A Loop Item (Internal) fieldOne per valueThe value
Iterate over List does not receive its values at present

A Loop Item (Internal) field is hidden from the person running the workflow, and its values are not passed to the run, so a loop of this type stops at its first round with a failed to resolve loop source message. Use Multi-Select Options instead: add a Multi Select field with the values as its options, and say in the workflow's How to use text which ones to tick.

Limits that apply to every type: a loop must have at least one round — a number of 0 or a multi-select with nothing ticked stops the run — and at most 1,000 rounds.


5. Values available inside a loop​

When you wire a step inside a loop, the selector adds a Loop Context group and a Current Loop Iteration group to the usual sources.

ValueIn round 1In round 3Use it for
{{loop.item}}The first valueThe third valueWhat this round is about
{{loop.index}}02Counting from zero, e.g. Event Index in a calendar-event step
{{loop.iteration}}13Human-readable numbering: Day 3
{{loop.index_1}}13Same as iteration
{{loop. + modifier name + }}Initial valueValue after two stepsDates or amounts that move each round

{{loop.…}} values exist only inside the loop. Check reports Uses a {{loop…}} value outside a loop. if a main-workflow step uses one.

Results of steps inside the loop. Step numbers restart at 1 inside a loop, and {{steps.1.draft}} there means the current round's result from the loop's own step 1. Two consequences:

  • If the main workflow also has a step 1 that has already run, that main step is read instead. Place a loop whose steps pass results to each other at the start of the workflow.
  • Steps after the loop cannot read results produced inside it. Save anything you need later from within the loop, for example with Save to Digital Asset.

6. Variable Modifiers (Per Iteration)​

Add Modifier adds a row: Var Name, Initial Value (chosen like any wiring source, usually an input-form field), Operation and Step. The result is available as {{loop. + name + }}. In round n (counting the first round as 0):

OperationCalculatesInitial 100, Step 10 → rounds 1, 2, 3
Add NumberInitial + n × Step100, 110, 120
Multiply byInitial × (1 + Step × n)With Step 0.1: 100, 110, 120 — growth is not compounded
Add Days / Add Months / Add YearsInitial date moved n × Step units2026-11-02, 2026-11-03, 2026-11-04 with Add Days, Step 1
Subtract Number—Currently stops the run. Use Add Number with a negative Step instead

Date modifiers need a whole-number Step and an initial date written as 2026-11-02, a full date and time, 11/02/2026 or 2026/11/02; the result is always YYYY-MM-DD.


7. Steps inside a loop​

Add them with Add Step to Loop. A step inside a loop can be an AI Persona, Utility or External Tool step. Not allowed inside:

  • Human Review — not offered, and Check blocks publishing if one ends up there. Review before the loop, see Human review steps.
  • Another loop — loops cannot be nested.

Also inside a loop: the New persona shortcut is not available, steps switched off are skipped in every round, and a step's Conditions are not applied — the step runs in every round.

If any step fails in any round, the whole run pauses for error recovery. Retry starts the loop again from its first round, so rounds that had already succeeded run, and are charged, again.


8. Credits multiply per round​

Each AI step inside a loop is charged once per round. A loop of 7 rounds with two AI steps makes 14 AI calls; a retry after a failure in round 6 makes them again from round 1. Utilities inside the loop cost nothing. Budget as rounds × AI steps, and see Credits and cost.


9. Field reference​

FieldTypeRequiredValidation / source
Container NameTextYes, in practiceShown on the card and in the viewer
Loop TypeChoiceYesThree types, section 4
Loop SourceChoice of input-form fieldsYesNumber, Multi Select or Loop Item (Internal) fields, matching the type
Counter VariableTextYesKeep item
Start ValueNumberNoNumeric Range only; default 1
DescriptionTextNo—
Modifier Var NameTextPer modifierLetters, digits, underscores
Modifier Initial ValueWiring sourcePer modifierA number or a date
Modifier OperationChoicePer modifierSix operations, section 6
Modifier StepNumberPer modifierWhole number for date operations
Steps inside—At least one to publishA loop has no steps inside it. otherwise

10. Deleting a loop​

The bin icon asks Delete this loop? — The loop is removed and the steps inside it move to the main workflow. — with Delete loop to confirm.

A saved loop is deleted at once

For a loop that has already been saved, the deletion happens as soon as you confirm, not when you next save — and on a published workflow, new runs no longer include the loop. The moved steps exist only in your editor until you save, so save the workflow straight away to keep them.


11. Worked example​

A social-media manager wants a week of Instagram posts booked into the content calendar from one form.

  1. Input form: Days (Number), First day (Date), Calendar (Calendar Picker), Campaign theme (Text).
  2. Loop: Numeric Range (Count), source Days, counter item, start value 1. Modifier post_date: Initial Value First day, Add Days, Step 1.
  3. Inside, step 1, AI persona: writes the post for {{inputs.campaign_theme}}, day {{loop.iteration}}. Output key post.
  4. Inside, step 2, Save AI-Generated Calendar Event: title Instagram — Day {{loop.iteration}}, description {{steps.1.post}}, time {{loop.post_date}}, Event Index {{loop.index}}, calendar {{inputs.calendar}}.
  5. The loop is the first item in the workflow, so {{steps.1.post}} always means the loop's step 1.

With Days = 7 the run makes 7 AI calls and books 7 events on consecutive days, moving any that land on a non-working day.


12. Before this works​

  • The input form has a field of the type the loop needs — see Input form.
  • For dates, the start date field is a Date or Date & Time field.
  • The organisation has enough AI credits for rounds × AI steps.
  • Editing needs Change your organisation's workflows: input form, steps, wiring, conditions and loops.

13. Don't confuse this with…​

The Loop tab on a stepThe Loop / Variant Execution setting on an AI Persona or Utility step's Loop tab does not make the step repeat when the workflow runs. Use a loop container
Choosing a variantSome Orbit workflows produce alternatives and ask you to pick one in the console. That is not a loop
ConditionsDecide whether a step runs, not how many times — see Conditions

14. Troubleshooting​

SymptomLikely cause and fix
Loop Source offers nothingThe form has no field of the matching type. Add a Number or Multi Select field
The run stops with failed to resolve loop sourceAn Iterate over List loop, or a source field left empty. Switch to Multi-Select Options, or fill the field
The run stops with loop count must be > 0The number was 0, or nothing was ticked
An input built from {{loop.…}} arrives emptyThe counter was renamed; use {{loop.item}}
The run stops with unknown operationA Subtract Number modifier. Use Add Number with a negative Step
invalid date format or requires integer stepThe modifier's initial date or Step is not in a form section 6 accepts
An in-loop step got the wrong text from {{steps.N…}}A main-workflow step with the same number ran earlier. Move the loop to the start of the workflow
A step after the loop gets nothing from inside itResults inside a loop are not available afterwards. Save them inside the loop
Check says A loop has no steps inside it.Add a step to the loop or delete it
The bill is much higher than expectedRounds × AI steps, plus any retries. Reduce rounds or move AI work out of the loop

More in AI workflow troubleshooting.