Skip to main content
The Loop node repeats a sequence of nodes for each item in an array or a specified number of times. This is essential for processing lists of data. All loop variables (current item and index) must be accessed through context.runtime (e.g., {{context.runtime.current_order}}). You can iterate over:
  • An array value: Loop through each item in a JSON array stored in variable_over (for example, the runtime value of {{context.inputs.orders}} serialized as JSON)
  • A static number: Loop a fixed number of times by specifying a number directly (e.g., 5)

Parameters

Examples

Loop Over Input Array

Process each item from an input array:
Then access the current item in subsequent nodes:

Loop Body Return

The loop node uses loop_not_done for the first node in the body and loop_done for the exit path. The last node in the loop body should connect back to the loop node with to so the loop can advance to the next item:

Notes

  • The loop automatically increments the index and updates the current item on each iteration
  • variable_over is parsed as JSON at runtime, so arrays must be valid JSON strings
  • Arrays extracted during the loop are appended by default; use overwriteArrayKeys in Extract Datamodel to replace
  • You can access the current index (0-based) using the variable_current_index variable
  • Loops can be nested by using different variable names for each level