Using the Loop Native Action
The Loop native action repeats child actions in a playbook. Use a forEach loop to iterate over an array, or a While loop to repeat while a condition is true.
This topic focuses on While loop timing inputs. Starting in Turbine 26.2.0, Delay and Duration are labeled and entered in seconds in the canvas UI.
Choose Your Path
I want to⦠| Start here |
|---|---|
Configure a While loop on the canvas | |
Understand Delay and Duration units | |
Confirm upgrade impact for existing playbooks | |
Use playbook expressions for timing |
Configure a While Loop
- Add a Loop action from the canvas Add panel.
- On the action details panel, set Type of loop to While.
- Click Edit Condition and define when the loop should continue.
- Click Configure to open the While loop inputs.
- Set delay (in seconds), duration (in seconds), and limit as needed.
- Add child actions on the loop entry branch and save the playbook.
Input | Description |
|---|---|
condition | Boolean expression that must be true for the loop to continue |
delay (in seconds) | Wait time before each iteration after the first |
duration (in seconds) | Maximum time the loop may run |
limit | Maximum number of iterations allowed |
Use limit and a well-defined condition together so a While loop cannot run indefinitely. Duration provides an additional time-based guardrail.
Delay and Duration Units (26.2.0)
Before Turbine 26.2.0, the While loop Delay and Duration fields accepted numeric values in milliseconds, but the canvas did not show the unit. Users often assumed seconds, which caused loops to wait or run much longer than intended.
Starting in 26.2.0:
Field | What you enter in the UI | What the playbook stores |
|---|---|---|
delay (in seconds) | Seconds (for example 2) | Milliseconds (for example 2000) |
duration (in seconds) | Seconds (for example 10) | Milliseconds (for example 10000) |
The canvas converts static numeric values when you open and save the While loop dialog:
- On load β stored milliseconds are divided by 1000 and shown as whole seconds in the UI.
- On save β whole-number seconds you enter are multiplied by 1000 before the playbook is saved.
The Turbine engine still evaluates Delay and Duration in milliseconds at run time.
Existing Playbooks After Upgrade
The 26.2.0 unit change is UI only. Playbook JSON and API payloads are not migrated to a new unit.
Stored value (unchanged) | What you see after upgrade | Run-time behavior |
|---|---|---|
delay = 2000 | 2 in delay (in seconds) | Still waits 2000 ms (2 seconds) between iterations |
duration = 10000 | 10 in duration (in seconds) | Still stops after 10000 ms (10 seconds) total loop time |
Existing customer playbooks keep the same timing after upgrade. The UI displays equivalent seconds for clarity; run time does not change unless you edit and save new values.
If you open a While loop, change Delay or Duration, and save, the UI saves your entry as seconds converted to milliseconds. Review timing after edits to avoid unintentionally longer or shorter waits.
Playbook Expressions
You can map delay, duration, or limit to playbook properties or expressions instead of static numbers.
Value type | UI behavior | Run-time behavior |
|---|---|---|
Static number | Shown and edited in seconds; converted to milliseconds on save | Engine uses stored milliseconds |
Expression or property reference | Passed through without seconds conversion in the dialog | Evaluated result is treated as milliseconds by the engine |
If you use an expression for delay or duration, supply or calculate values in milliseconds even though the field label says seconds. For example, to wait two seconds via a variable, the evaluated value must be 2000, not 2.
See Also
- Organizing Playbook in the CanvasOrganizing Playbook in the Canvas β canvas tools, loops, Group, and tool panel
- ComponentsComponents β loop nesting depth limits