Loop

Repeat the blocks inside a workflow container sequentially.

Configuration

Loop Type
Select...
Loop Iterations
Enter loop iterations...
Shown when loopType is 'for'.
Collection Items
Enter collection items...
Shown when loopType is 'forEach'.
While Condition
Enter while condition...
Shown when loopType is one of 'while', 'doWhile'.

Input

ParameterTypeRequiredDescription
loopTypestringNofor, forEach, while, or doWhile.
iterationsnumberNoIteration count for For Loop; the editor allows 1–100. Shown when loopType is 'for'.
forEachItemsjsonNoNon-empty array or object for For Each; supports upstream references.
whileConditionstringNoBoolean expression for While or Do While. Shown when loopType is one of 'while', 'doWhile'.

Output

ParameterTypeDescription
loopIdstringLoop container ID.
currentIterationnumberOne-based during loop execution; completed For and For Each outputs use the final zero-based index.
maxIterationsnumberCount or collection length; condition-driven loops use the runtime sentinel Number.MAX_SAFE_INTEGER.
loopTypestringConfigured loop mode.
completedbooleanWhether the loop has finished.
resultsarrayChild outputs grouped by iteration after For or For Each completes; absent from While and Do While completion outputs.
messagestringLoop progress message.

Usage Instructions

For Loop repeats a configured number of times. For Each iterates over a non-empty array or object; object items are key/value pairs. While tests its condition before each iteration, and Do While always executes its first iteration. Conditions use the same expression evaluator as Condition blocks. While and Do While have no fixed iteration cap: provide a terminating condition and account for workflow timeout and execution limits. Connect the container start to its first child and the container end to the blocks that should run afterward. Completed For and For Each loops aggregate child outputs under results in iteration order; a single iteration can contain multiple child outputs. While and Do While completion outputs do not include that results array.

Notes

  • Category: blocks
  • Type: loop