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

# Loop

> Iterate through a list of items, executing different actions for each item or after completion

Iterate through a list of items, executing different actions for each item or after completion. Has two output handles: 'loop' handle executes nodes FOR EACH item (nodes can access current item via \{\{loopNode.data}}) - only connect nodes that should process individual items here, 'done' handle executes nodes ONCE after loop completes - use this to continue to next workflow steps. IMPORTANT: Nodes connected to 'loop' handle should only connect to other nodes also connected to the same 'loop' handle. Never connect loop nodes to non-loop nodes. CRITICAL: Nested loops are NOT supported

|                     |                     |
| ------------------- | ------------------- |
| **App**             | Flow Control        |
| **Operation ID**    | `flow_control_loop` |
| **Type**            | Action              |
| **Connection**      | None                |
| **Credits per run** | Free                |

## Inputs

| Field           | Type                                          | Required | Default | Description                                                                                                                                                                                                                                                                                 |
| --------------- | --------------------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list`          | array (also accepts a comma-separated string) | No       | -       | The list to iterate over. This will be mainly the output of upstream nodes in the workflow. Don't worry about data conversion, it will be handled automatically based on the list type.                                                                                                     |
| `include_index` | boolean                                       | No       | -       | When enabled, downstream nodes can reference index outputs. and data becomes two keys: item and index. for example, \{\{loopNodeId\_\_data.item}} and \{\{loopNodeId\_\_data.index}}, when disabled, downstream nodes can only reference \{\{loopNodeId\_\_data}} which is the entire item. |

## Output

**Type**: `Dict | Any`

The default output is the entire item being processed in the loop. When 'include\_index' is enabled, returns a dict with 'item' and 'index' keys.
