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 variable: Loop through each item in an array from context (e.g., {{context.inputs.orders}})
  • A static number: Loop a fixed number of times by specifying a number directly (e.g., 5)

Parameters

ParameterTypeRequiredDescription
variable_overstringYesThe array to iterate over, or a number for fixed iterations
variable_current_itemstringYesVariable name to store the current item (accessible via context.runtime)
variable_current_indexstringYesVariable name to store the current index (accessible via context.runtime)

Examples

Loop Over Input Array

Process each item from an input array:
{
  "id": "abc123",
  "name": "Process each order",
  "action": "LOOP",
  "parameters": {
    "variable_over": "{{context.inputs.orders}}",
    "variable_current_item": "current_order",
    "variable_current_index": "order_index"
  }
}
Then access the current item in subsequent nodes:
{
  "id": "def456",
  "name": "Navigate to order",
  "action": "NAVIGATE",
  "parameters": {
    "url": "https://app.example.com/orders/{{context.runtime.current_order.id}}"
  }
}

Loop Body Return

The last node in the loop body should connect back to the loop node to continue iteration:
{
  "edges": {
    "last-loop-body-node-id": {
      "to": "loop-node-id"
    }
  }
}

Notes

  • The loop automatically increments the index and updates the current item on each iteration
  • 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