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 throughDocumentation Index
Fetch the complete documentation index at: https://docs.cloudcruise.com/llms.txt
Use this file to discover all available pages before exploring further.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
variable_over | string | Yes | JSON string containing the array to iterate over, or a number for fixed iterations |
variable_current_item | string | Yes | Variable name to store the current item (accessible via context.runtime) |
variable_current_index | string | Yes | Variable name to store the current index (accessible via context.runtime) |
Examples
Loop Over Input Array
Process each item from an input array:Loop Body Return
The loop node usesloop_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_overis parsed as JSON at runtime, so arrays must be valid JSON strings- Arrays extracted during the loop are appended by default; use
overwriteArrayKeysin Extract Datamodel to replace - You can access the current index (0-based) using the
variable_current_indexvariable - Loops can be nested by using different variable names for each level

