> For the complete documentation index, see [llms.txt](https://docs.appmixer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appmixer.com/connector-configuration/utils/controls/continueeach.md).

# Continue Each

### Overview

The **Continue Each Component** ends one pass of a sequential [Each](/connector-configuration/utils/controls/each.md) loop. **Each** (Sequential) → the steps for one item → **Continue Each** is the recommended way to build a loop in Appmixer; see [Building a Loop](/connector-configuration/utils/controls/each.md#building-a-loop).

It tells the **Each** component that the current item is done, so **Each** sends the next one. This keeps the items in order even when the steps in the loop take a varying amount of time. It can also add named values from the loop to the **Result** that **Each** emits on its `done` port once the loop is over, so you don't need Storage or [Join Each](/connector-configuration/utils/controls/joineach.md) to collect them.

### Usage

#### Input Parameters

| Parameter       | Type         | Description                                                                                                                                                                     |
| --------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `correlationId` | `string`     | Required. The `correlationId` of the **Each** component whose loop this component ends. It identifies the loop, so nested **Each** loops each need their own **Continue Each**. |
| `index`         | `number`     | Required. The `index` of the same **Each** component. It identifies the item that is done, so a repeated or late confirmation of another item is ignored.                       |
| `result`        | `expression` | Optional. **Add to Result**: rows of **Name** and **Value**. Each item adds one entry to the `result` of **Each**: an object with one field per row.                            |

#### Add to Result

Every row has two fields:

| Field     | Description                                                           |
| --------- | --------------------------------------------------------------------- |
| **Name**  | The name of the field in the result entry, for example `id`.          |
| **Value** | The value of the field, usually a variable of a step inside the loop. |

For example, with the rows `id` → *ID of the created record* and `status` → *Status of the created record*, the `done` port of **Each** emits:

```json
{
  "count": 3,
  "correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "result": [
    { "id": "1001", "status": "created" },
    { "id": "1002", "status": "created" },
    { "id": "1003", "status": "created" }
  ]
}
```

* A value that is empty for an item is added as `null`, so every entry has the same fields.
* An item that timed out in **Each** has `null` as its whole entry, so the entries always line up with the items.
* A row left completely empty is ignored. A row with a value but no name stops the component with an error.

#### Input Ports

| Port | Description                                             |
| ---- | ------------------------------------------------------- |
| `in` | Receives the message of the last step of one loop pass. |

#### Output Ports

| Port  | Description                                                                                      |
| ----- | ------------------------------------------------------------------------------------------------ |
| `out` | Fires after the item has been confirmed, so the flow can continue after the loop body if needed. |

#### Output Data for `out` Port

| Field           | Description                      |
| --------------- | -------------------------------- |
| `correlationId` | The correlation ID of the loop.  |
| `index`         | The index of the confirmed item. |

### Instructions

1. **Turn On Sequential in Each**
   * Open the **Each** component and turn on **Sequential**.
2. **Place Continue Each at the End of the Loop**
   * Connect it after the last step that has to finish before the next item starts.
3. **Map the Loop Variables**
   * Set **Correlation ID** and **Index** to the `correlationId` and `index` variables of the **Each** `item` port.
4. **Collect Results (Optional)**
   * Add a row to **Add to Result** for every value you want to keep, and give it a name.
   * Use `result` on the `done` port of **Each** to work with all the collected values after the loop, for example to send a summary.

### Notes

* **No Loop Waiting**: If no sequential **Each** loop is waiting for the Correlation ID (the **Each** is not in sequential mode, or the loop already finished), the component just continues the flow.
* **Duplicates Are Ignored**: If the loop body branches into two **Continue Each** components, or a confirmation arrives late for an item that already timed out, only the first confirmation of the current item counts.
* **Filtered Items**: An item that never reaches **Continue Each** (for example filtered out by a Condition) holds the loop until **Item Timeout** of **Each** runs out. Route such items to **Continue Each** as well if you do not want to wait.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.appmixer.com/connector-configuration/utils/controls/continueeach.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
