# Multi-instance markers

> Configure multi-instance markers in Maestro Orchestrate to run a task once per item in a collection, sequentially or in parallel.

## Overview

Use markers to configure a task to run once for each element in a **List** variable, creating multiple sequential or parallel executions. Visit [Markers](https://docs.uipath.com/maestro/automation-suite/2.2610/user-guide/markers) in the BPMN Primer chapter for notation and conceptual guidance.

## When to use multi-instance markers

Use a multi-instance marker when you have a list of items and need to run the same task once for each one — for example:

- Validating each invoice in a list of invoice IDs
- Enriching a set of records by calling an external API per record
- Sending a notification to each recipient in a list

Without a marker, you would need to build a manual loop using sequence flows, which is harder to read and harder to track. A multi-instance marker keeps your process diagram clean and gives you per-item visibility in the Execution trail — each item's run appears separately, with its own status and output.

Use **Sequential** mode when order matters or each run depends on the previous one. Use **Parallel** mode when items are independent and you want faster throughput.

## Supported collection types

Maestro Orchestrate treats the following collection types as loopable for multi-instance execution. If your variable is one of these types, you can use it directly in the **Items** field:

- `System.Collections.Generic.List<T>`
- `System.Collections.Generic.IList<T>`
- `System.Collections.Generic.IEnumerable<T>`
- `System.Collections.IEnumerable`
- `System.Data.DataTable`
- `Newtonsoft.Json.Linq.JArray`
- Types where `collectionDataType` starts with `List`
- Types where `collectionDataType` starts with `Array`
- Primitive .NET arrays such as `int[]`, `string[]`, `bool[]`, `double[]`, `decimal[]`, `long[]`

Keep per-item work idempotent and short-lived. Use the **Outputs** and **Update variables** sections if you need to collect results into a single variable after all iterations finish.

## How to add a multi-instance marker

:::important
Configure the task's **Action** before converting it to multi-instance. The multi-instance configuration binds to the task's **Outputs** at the moment you apply the marker. If no action is selected at that point, the binding is tied to the task's default output placeholder rather than the action's actual output — and selecting an action afterwards does not refresh this binding. Each iteration then writes to an unbound output, producing `null` entries in the aggregated variable at runtime. If you already converted the task to multi-instance first, see [Aggregated variable contains nulls](#aggregated-variable-contains-nulls) for the unset and re-apply workaround.
:::

1. Select a **task** on the canvas and, in the **Properties panel**, configure its **Action**. Confirm that the **Outputs** section reflects the action you selected — for example, an agent action exposes a typed `response` output and an `Error` output. Continue only after the Outputs section matches the action.
2. In the element toolbar above the task, select **Iteration**.

   ![Element toolbar above a task in Maestro with the Select markers button highlighted.](https://dev-assets.cms.uipath.com/assets/images/maestro/iteration-parallel-56ebdc90.webp)

3. Choose **Sequential multi-instance** or **Parallel multi-instance**.

   The marker appears at the bottom of the task shape.

4. In the **Properties panel**, expand **Multi-instance**.

   ![Screenshot showing a task with the sequential multi-instance marker applied and the Properties panel open with the Multi-instance section expanded.](https://dev-assets.cms.uipath.com/assets/images/maestro/multi-instance-properties-panel-5600ebfb.webp)

5. In **Items**, select the list variable you want to iterate over — for example, `vars.invoiceList`.

   This tells Maestro Orchestrate which collection to process. Without an Items value, the task runs once as a normal task, not once per element. Maestro Orchestrate creates one execution per element in the list.

6. Optionally, expand **Error handling** and enable **Retry on failure** to retry individual item runs independently. For configuration options, see [Element-level retries](https://docs.uipath.com/maestro/automation-suite/2.2610/user-guide/properties-panel#element-level-retries).

## Result

The task is configured as a multi-instance marker and iterates once per element in the selected list variable. Each iteration runs sequentially or in parallel depending on the marker type chosen.

:::note
Multi-instance is supported only for tasks. The marker type you select (sequential or parallel) determines execution order.
:::

## Referencing the current item

The **Multi-instance** section only needs the Items list — that's where you tell Maestro Orchestrate which collection to iterate over. Iterator expressions go in a different place: the **Inputs** section of the task, where you map the current item to a specific input for each run.

The expression you use depends on whether the marker is applied directly to the task, or whether the task runs inside a subprocess called from a multi-instance task.

| Scenario | Expression | Where to use it |
|---|---|---|
| Marker applied directly to the task | `iterator.item` | In the task's **Inputs** fields |
| Task runs inside a subprocess called from a multi-instance task | `iterator[0].item` | In the subprocess task's **Inputs** fields |

:::note
The `[0]` in `iterator[0].item` refers to the outermost iterator scope when a task runs inside a subprocess. In standard single-level multi-instance, you will always use `[0]` — there is no `iterator[1]`.
:::

To pass the whole current element, use `iterator.item`. To pass a single property, use `iterator.item.propertyName`. Some examples:

- `iterator.item.invoiceId`
- `iterator.item.customer.email`
- `{ id: iterator.item.id, flags: ["recheck"] }`

### Reference the current item in a task

When the multi-instance marker is applied directly to a task, use `iterator.item` in the **Inputs** section of the Properties panel to pass the current element to each run.

#### Properties panel reference

- **Action:** Choose how the task runs — Integration Service action, agent action, or **None** for modeling only.
- **Inputs:** Shows the parameters defined by the selected action. For each parameter you want to populate with the current list item, set its value to `iterator.item` (to pass the whole element) or `iterator.item.propertyName` (to pass a specific property).

  ![Screenshot of the Inputs section in the Properties panel, showing a workflow input parameter mapped to iterator.item.](https://dev-assets.cms.uipath.com/assets/images/maestro/properties-service-task-00e995f0.webp)

- **Outputs:** Defines what each iteration returns. When an action is configured on the task, the action's outputs (typically `response`, plus `Error` for agent actions) appear here automatically, each bound to its source via the **Value** chip. To add an extra value per iteration on top of the action's outputs, select **+ Add new** and give it a name. If the entries listed here do not reflect what your action exposes — for example, the **Value** chip shows a generic placeholder type instead of the action's actual output type — see [Aggregated variable contains nulls](#aggregated-variable-contains-nulls).
- **Update variables:** Specifies which process variable stores the aggregated outputs after all iterations finish. Select **Set variable value** and choose the target variable — for example, `vars.validationResults`. The variable holds an array with one entry per iteration: an array of strings if each iteration returns a string, an array of objects if each iteration returns an object. In Sequential mode, the entries follow input order. In Parallel mode, the order matches iteration completion and is not guaranteed.

### Reference the current item inside a subprocess

When a task runs inside a subprocess that was called from a multi-instance task, the current item is not directly available as `iterator.item`. Instead, use `iterator[0].item` in the subprocess task's **Inputs** to access the element passed down from the parent multi-instance task.

![Screenshot of a Service task inside a subprocess with the Properties panel open, showing the iterator item expression entered in the Inputs field.](https://dev-assets.cms.uipath.com/assets/images/maestro/subprocess-properties-3fbf8456.webp)

#### Properties panel reference

- **Action:** Configure how the task interacts with the external system, API, or agent.
- **Inputs:** Add an input for each value the task needs. Set the value to `iterator[0].item` to pass the whole current element, or `iterator[0].item.propertyName` to pass a specific property.

  Example — if your list contains objects with an `id` field, add an entry in the **Inputs** section of the Properties panel:
  - **Input field name:** `currentItemId`
  - **Value:** `iterator[0].item.id`

  Replace `.id` with the actual property name from your list objects.

## Examples

### Example: Validate a list of invoices

This example shows how to configure a **Service task** to run once per invoice in a list.

#### 1. Prepare a list variable

1. Open **Data Manager**.
2. Create a variable:
   - **Name:** `invoiceList`
   - **Type:** Array of Objects or Array of Strings
   - **Default value:** `["INV-001", "INV-002", "INV-003"]`

#### 2. Add a Service task and configure the action

1. Add a **Service task** to the canvas and name it **Validate invoice**.
2. With the task selected, open the **Action** section in the Properties panel and configure which agent runs for each invoice:

   - **Action:** Select **Start and wait for agent**.
   - **Agent:** Select the agent responsible for validating invoices. The agent must already exist in your tenant — you can create one in [Agent Builder](https://docs.uipath.com/agent-builder).

   ![Screenshot of the Action section in the Properties panel showing Start and wait for agent selected with an agent configured.](https://dev-assets.cms.uipath.com/assets/images/maestro/agent-implementation-a84a9e65.webp)

3. Confirm the **Outputs** section reflects the agent action — the `response` output should appear with its actual output type, alongside `Error`. Continue only after this matches.

#### 3. Convert the task to multi-instance

1. With the task selected, open the element toolbar and select **Select markers** → **Sequential multi-instance**.
2. In the **Properties panel**, expand **Multi-instance** and set **Items** to `vars.invoiceList`.

#### 4. Map the current item to an input

After selecting your action, the **Inputs** section shows the parameters defined by that action — for example, the input arguments of your RPA workflow or the parameters of your agent.

For each parameter you want to populate with the current list item, select its value field and enter `iterator.item`:

- Use `iterator.item` to pass the entire current element — for example, the string `"INV-001"` if your list contains strings.
- Use `iterator.item.propertyName` to pass a specific property — for example, `iterator.item.id` if your list contains objects.

![Screenshot of the Inputs section in the Properties panel, showing a workflow input parameter mapped to iterator.item.](https://dev-assets.cms.uipath.com/assets/images/maestro/multi-instance-iterator-item-1f8e2ca3.webp)

#### 5. Debug the process

1. Select **Debug** → **Debug step-by-step**.
2. Maestro Orchestrate runs **Validate invoice** once per list item.

##### Result

The Execution trail shows one run per invoice, each labeled with its item value.

![Screenshot of the Maestro Execution trail showing three separate runs of a task, one for each item in the list.](https://dev-assets.cms.uipath.com/assets/images/maestro/sequential-multi-marker-c96f1f4a.webp)

To run all items concurrently instead of sequentially, choose **Parallel multi-instance** in step 2. See also the [fan-out example](#example-fan-out-and-collect-results) below.

### Example: Fan-out and collect results

**Scenario:** You receive a list of invoice IDs from an external API and need to validate each one independently, then use the aggregated results in a downstream step.

1. Make sure a list variable — for example, `vars.invoiceIds` — is populated by a previous step, such as a Service task that calls an external API.
2. Add a **Service task** named **Validate invoice** and, on the regular task, configure the **Action** that validates a single invoice. Confirm that the **Outputs** section reflects the action — the `response` entry should show the action's actual output type.
3. With the task selected, select **Select markers** → **Parallel multi-instance**.
4. In the **Multi-instance** section, set **Items** to `vars.invoiceIds`.
5. In the **Inputs** section, map `iterator.item` to the invoice ID parameter of your action — for example, set the `invoiceId` input to `iterator.item`.
6. In the **Outputs** section, verify that the action's `response` output is listed and bound to the action's result. If you need an additional aggregated value per iteration, select **+ Add new** and define it. If the listed outputs do not match what your action exposes, the marker was applied before the action was configured; see [Aggregated variable contains nulls](#aggregated-variable-contains-nulls).
7. In the **Update variables** section, select **Set variable value** and choose the variable to store the aggregated results — for example, `vars.validationResults`. After all iterations finish, this variable contains one entry per invoice — an array of strings if your action returns a string, or an array of objects if it returns an object.

#### Result

The multi-instance task runs once per invoice ID in parallel, and the aggregated results are collected into the configured variable after all iterations finish.

   ![Screenshot of the Properties panel showing the Outputs section with Add new and the Update variables section with a variable configured.](https://dev-assets.cms.uipath.com/assets/images/maestro/multi-instamnce-split-b6dde273.webp)

## Runtime behavior

1. **Fan-out / fan-in:** Maestro Orchestrate creates one activity instance per item and completes the group when all instances finish.
2. **Ordering:** Guaranteed in **Sequential** mode; not guaranteed in **Parallel** mode.
3. **Concurrency:** Parallel mode runs items concurrently, subject to platform limits and resource availability.
4. **Failures:** Each item's result is independent. Define downstream logic to handle partial failures — for example, continue, retry, or stop based on a threshold.
5. **Observability:** Each item run is tracked individually in the Execution trail, showing per-item status and outcomes.

## Troubleshooting

### Aggregated variable contains nulls

The aggregated variable produced by **Update variables** contains `null` for every iteration (for example, `[null, null, null]`) even though each iteration ran successfully.

This happens when the task was converted to multi-instance before its **Action** was selected. The multi-instance configuration is bound to the task's default output placeholder rather than the action's actual output, and selecting an action afterwards does not refresh this binding. Each iteration writes to an unbound output and the aggregator records `null`.

To fix an existing task:

1. In the element toolbar, select **Select markers** and remove the multi-instance marker to convert the task back to a regular task.
2. Confirm the action is selected and that the **Outputs** section reflects the action (for example, `response` typed by the action, plus `Error` for agent actions).
3. Re-apply the marker with **Select markers** → **Sequential multi-instance** or **Parallel multi-instance**.
4. In the **Outputs** section, verify the entries still match the action's outputs.

To prevent this on new tasks, always configure the **Action** before converting the task to multi-instance.

### Items input is ignored and the task runs once

The task runs a single time and the **Items** value is treated as a regular input.

This happens when the variable passed to **Items** is not one of the supported collection types. Check the variable's type in Data Manager against [Supported collection types](#supported-collection-types). If you defined the list as a plain string, convert it to **Array of Strings** or **Array of Objects**.

### Outputs entries do not reflect the action's outputs

The **Outputs** section does not show the entries you expect from the selected action — for example, an agent action should expose `response` and `Error`, but only a generic `response` placeholder appears.

The Outputs were captured before the action selection finished propagating. Unset the multi-instance marker via **Change element** → regular task, confirm the **Outputs** section reflects the action, then re-apply the marker.

## Best practices

1. Validate the collection before fan-out — check for empty, null, or excessively large lists.
2. Keep per-item work short-lived and fault-tolerant. Add retries where appropriate.
3. Aggregate only what you need. Large aggregations can affect performance and readability.
4. Make success criteria explicit. After the multi-instance task, add an **Exclusive gateway** that evaluates the aggregated output variable — for example, route to the next step only if the number of successful results meets your threshold.

:::note
Parallel multi-instance executes elements in batches of 50. If each item is a large or complex object — multiple key-value pairs or nested structures — keep the total collection size below 50 as well, since item size affects how many can be sustained concurrently.
:::

Read [Markers](https://docs.uipath.com/maestro/automation-suite/2.2610/user-guide/markers) (BPMN Primer) for notation and conceptual guidance, and [BPMN support](https://docs.uipath.com/maestro/automation-suite/2.2610/user-guide/bpmn-support) for the full list of BPMN elements supported in Maestro Orchestrate.

Working in a subprocess or call activity? For variable scoping, input/output mappings, and End Event variables, read [Subprocesses](https://docs.uipath.com/maestro/automation-suite/2.2610/user-guide/subprocess).
