UiPath Documentation
maestro
latest
false

Maestro user guide

Last updated May 13, 2026

Multi-instance markers

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 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 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

  1. Select a task on the canvas.

  2. In the element toolbar above the task, select Change element.

  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.

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

    This tells Maestro which collection to process. Without an Items value, the task runs once as a normal task, not once per element. Maestro 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.

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 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.

ScenarioExpressionWhere to use it
Marker applied directly to the taskiterator.itemIn the task's Inputs fields
Task runs inside a subprocess called from a multi-instance taskiterator[0].itemIn 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).

  • Outputs: Defines what each iteration returns. Select + Add new and give the output a name — for example, validationResult. Set it to the value your action returns. After all iterations complete, Maestro collects each iteration's output and makes it available through Update variables.

  • Update variables: Specifies which process variable stores the collected outputs after all iterations finish. Select Set variable value and choose the target variable — for example, vars.validationResults. The variable will contain one entry per iteration.

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.

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 and configure a Service task
  1. Add a Service task to the canvas and name it Validate invoice.
  2. Select the task, then in the element toolbar select Change element and choose Sequential multi-instance.
  3. In the Properties panel, expand Multi-instance.
  4. In Items, enter vars.invoiceList.
3. Configure the implementation

In the Action section, 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.

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, click 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.

5. Debug the process
  1. Select DebugDebug step-by-step.
  2. Maestro runs Validate invoice once per list item.

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

To run all items concurrently instead of sequentially, choose Parallel multi-instance in step 2. See also the fan-out example 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. Select the task, choose Change element, and select Parallel multi-instance.

  3. In the Multi-instance section, set Items to vars.invoiceIds.

  4. In the Inputs section, map iterator.item to the invoice ID parameter of your action — for example, set the invoiceId input to iterator.item.

  5. In the Outputs section, select + Add new and name the output — for example, validationResult. Set it to the value your action returns for each invoice.

  6. 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.

Runtime behavior

  1. Fan-out / fan-in: Maestro 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.

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.

Read Markers (BPMN Primer) for notation and conceptual guidance, and BPMN support for the full list of BPMN elements supported in Maestro.

Working in a subprocess or call activity? For variable scoping, input/output mappings, and End Event variables, read Subprocesses.

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated