Skip to main content

Loop

Controlled node

Overview​

Repeat a workflow branch a fixed number of times.

Loop repeats a branch a chosen number of times. Use For Each instead when you already have a list of items to process.

Inputs​

InputTypeDescription
runEventStarts the loop.
timesNumberThe repeat count. Use a finite, non-negative whole number.

Outputs​

OutputTypeDescription
loopEventTriggers the repeated branch for each iteration.
indexNumberThe current iteration, starting at 0.
finishedEventContinues after all iterations have completed.

For times = 3, the branch runs with indexes 0, 1 and 2. A zero, negative, missing or non-numeric count skips the repeated branch and fires finished.

Wiring the loop​

Connect loop to the first action in the repeated branch. The loop waits for that branch to finish before moving to the next iteration. Connect finished to the action that should happen once afterward.

Do not connect the end of the branch back to run. Repetition is automatic; a connection back starts another loop rather than advancing the existing one.

Example​

  1. Connect Start to run and set times to 3.
  2. Connect loop to run on a Log node.
  3. Connect index to the Log node's message input.
  4. Connect finished to your next action.

This logs 0, 1 and 2, then continues. Loops are subject to workflow execution limits; use sensible counts and test repeated external actions carefully.