# Iteration loop Node

### Overview

The Iteration Loop Node enables repetitive execution of a sequence of nodes over a collection of items. It creates an isolated execution context for each iteration, making it ideal for processing arrays of data, batch operations, or repetitive tasks.

Usage cost: 0 credit

### Configuration

#### Settings

1. **Iteration Control**
   * Iterator\*: Select array variable to iterate over
   * Maximum Iterations: Limit the number of iterations (0-10,000)
   * Output Collection: Select child node output to collect results
2. **Context Variables** Available in child nodes during iteration:
   * `current_item`: Current item being processed
   * `index`: Current iteration index (number)

#### Output Ports

* `output` (Any\[]): Array of collected outputs from iterations
  * When Output Collection is specified
  * Maintains order of iterations
  * Preserves original data types

### Best Practices

1. **Iterator Selection**
   * Verify array data structure
   * Consider data volume
2. **Performance Management**
   * Set appropriate iteration limits
   * Consider batch processing
   * Optimize child node operations
3. **Output Collection**
   * Choose relevant outputs
   * Plan data aggregation
   * Consider memory usage

### Common Issues

* Memory overflow from large collections
* Iteration limit exceeded
* Missing iterator variable


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.waterflai.ai/studio/studio-builders/flow-components-nodes/iteration-loop-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
