> ## Documentation Index
> Fetch the complete documentation index at: https://docs.noclick.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Loops

> Run a chain of nodes once per item in a list with the Iteration node.

The Iteration node loops over a list. Everything connected to its **Loop Body** handle runs once per item, including nodes further down the chain, so you only connect the first node of the loop.

## Add a loop in one click

When a config field holds a reference to a list, like `{{sheets-1.values}}` or an indexed reference, a **Loop over each item** button appears under the field. Click it to drop an Iteration node already set to loop over that list and wired as the loop body, so you skip the manual setup.

The [Split Out](/logic/filter-merge) node comes ready to loop too: dropping it onto the canvas also adds a paired Iteration node wired to its output, so the list it produces fans out into per-item steps automatically.

## Configuration

| Field                   | What it does                                                                                |
| ----------------------- | ------------------------------------------------------------------------------------------- |
| **Items**               | Reference to the list to loop over, e.g. `{{sheets-1.values}}`                              |
| **First Row is Header** | Turns a 2D array (like spreadsheet rows) into objects keyed by the first row's column names |
| **Field Names**         | Comma-separated names to map plain arrays to objects when there is no header row            |
| **Concurrency**         | How many items to process in parallel, 1 (sequential) to 10                                 |

## Output handles

| Handle         | When it runs                         |
| -------------- | ------------------------------------ |
| **Loop Body**  | Once per item                        |
| **After Loop** | Once, after every iteration finishes |

## Referencing the current item

Inside the loop body, these variables resolve per iteration without any node ID prefix:

* `{{item}}`: the current item (or `{{item.name}}` for a field)
* `{{index}}`: 0-based position
* `{{row_number}}`: 1-based row number, adjusted when a header row is used
* `{{items}}` and `{{total}}`: the full list and its length

**Example:** Google Sheets read, then Iteration with **First Row is Header** on, then an email node in the loop body using `{{item.email}}` and `{{item.name}}`.

## Collected results

After the loop, the iteration node's output includes `collected_results`, a flat list with one entry per iteration. Nodes on **After Loop** reference it as `{{iteration-id.collected_results}}`.

By default the results come from the last node in the loop body. To pick a different node, connect that node's output back into the iteration node's input.

<Note>
  A failed iteration doesn't stop the loop. Its slot in `collected_results` carries an `_iteration_error` entry instead.
</Note>

## Next steps

* [Filter and merge](/logic/filter-merge)
* [Data references](/editor/data-references)
