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

# LoopIteration - ComfyUI Built-in Node Documentation

> This node provides iteration metadata for loop-style workflows.

This node provides iteration metadata for loop-style workflows. It receives list-based inputs and passes through the first element of each list, so a loop can track the current index, whether it is the first or last step, the current list item, and any running iteration value. Cache behavior is controlled by the `reuse_cache` flag. This node is marked as developer-only.

## Inputs

| Parameter                 | Description                                                                                                                                                                                                                              | Data Type | Required | Range |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -------- | ----- |
| `iteration_index`         | The index of the current iteration, supplied as a list. The first element is passed through to the output.                                                                                                                               | INT       | Yes      | -     |
| `is_first`                | Indicates whether the current iteration is the first one, supplied as a list. The first element is passed through to the output.                                                                                                         | BOOLEAN   | Yes      | -     |
| `is_last`                 | Indicates whether the current iteration is the last one, supplied as a list. The first element is passed through to the output.                                                                                                          | BOOLEAN   | Yes      | -     |
| `list_item`               | The item taken from the list for this iteration. Optional; the first element is passed through to the output when provided, otherwise None is returned.                                                                                  | ANY       | No       | -     |
| `current_iteration_value` | The value carried by the current iteration. Optional; when provided, the full value is passed through to the output, otherwise None is returned.                                                                                         | ANY       | No       | -     |
| `reuse_cache`             | Controls whether the result may be reused from cache. When enabled, the node keeps a stable fingerprint so cached results can be reused. When disabled, a non-matching fingerprint is produced so the node runs again on each iteration. | BOOLEAN   | Yes      | -     |

Note: This node is list-input enabled, meaning each input is expected to arrive as a list and the node outputs only the first element of each list (except `current_iteration_value`, which is passed through as a list). It also accepts additional inputs beyond those listed here.

## Outputs

| Output Name               | Description                                                                                                        | Data Type |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------ | --------- |
| `iteration_index`         | The index of the current iteration.                                                                                | INT       |
| `is_first`                | Whether the current iteration is the first one.                                                                    | BOOLEAN   |
| `is_last`                 | Whether the current iteration is the last one.                                                                     | BOOLEAN   |
| `list_item`               | The item taken from the list for this iteration, or None when no item was provided.                                | ANY       |
| `current_iteration_value` | The value carried by the current iteration, or None when no value was provided. This output is returned as a list. | ANY       |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/LoopIteration/en.md)

***

**Source fingerprint (SHA-256):** `c7072f22bd382f567792d2ea7a30312c64d33c213551f8983c25cd7b95adc4fb`
