- Introduction
- Getting started
- Process modeling
- Process implementation
- Debugging
- Simulating
- Publishing and upgrading agentic processes
- Common implementation scenarios
- Extracting and validating documents
- Process operations
- Process monitoring
- Process optimization
- Reference information
Maestro user guide
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.IEnumerableSystem.Data.DataTableNewtonsoft.Json.Linq.JArray- Types where
collectionDataTypestarts withList - Types where
collectionDataTypestarts withArray - 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
-
Select a task on the canvas.
-
In the element toolbar above the task, select Change element.
-
Choose Sequential multi-instance or Parallel multi-instance.
The marker appears at the bottom of the task shape.
-
In the Properties panel, expand Multi-instance.
-
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.
-
Optionally, expand Error handling and enable Retry on failure to retry individual item runs independently. For configuration options, see Element-level retries.
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.
| 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 |
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.invoiceIditerator.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) oriterator.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].itemto pass the whole current element, oriterator[0].item.propertyNameto pass a specific property.Example — if your list contains objects with an
idfield, add an entry in the Inputs section of the Properties panel:- Input field name:
currentItemId - Value:
iterator[0].item.id
Replace
.idwith the actual property name from your list objects. - Input field name:
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
- Open Data Manager.
- Create a variable:
- Name:
invoiceList - Type: Array of Objects or Array of Strings
- Default value:
["INV-001", "INV-002", "INV-003"]
- Name:
2. Add and configure a Service task
- Add a Service task to the canvas and name it Validate invoice.
- Select the task, then in the element toolbar select Change element and choose Sequential multi-instance.
- In the Properties panel, expand Multi-instance.
- 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.itemto pass the entire current element — for example, the string"INV-001"if your list contains strings. - Use
iterator.item.propertyNameto pass a specific property — for example,iterator.item.idif your list contains objects.
5. Debug the process
- Select Debug → Debug step-by-step.
- 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.
-
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. -
Add a Service task named Validate invoice. Select the task, choose Change element, and select Parallel multi-instance.
-
In the Multi-instance section, set Items to
vars.invoiceIds. -
In the Inputs section, map
iterator.itemto the invoice ID parameter of your action — for example, set theinvoiceIdinput toiterator.item. -
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. -
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
- Fan-out / fan-in: Maestro creates one activity instance per item and completes the group when all instances finish.
- Ordering: Guaranteed in Sequential mode; not guaranteed in Parallel mode.
- Concurrency: Parallel mode runs items concurrently, subject to platform limits and resource availability.
- Failures: Each item's result is independent. Define downstream logic to handle partial failures — for example, continue, retry, or stop based on a threshold.
- Observability: Each item run is tracked individually in the Execution trail, showing per-item status and outcomes.
Best practices
- Validate the collection before fan-out — check for empty, null, or excessively large lists.
- Keep per-item work short-lived and fault-tolerant. Add retries where appropriate.
- Aggregate only what you need. Large aggregations can affect performance and readability.
- 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.
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.
- Overview
- When to use multi-instance markers
- Supported collection types
- How to add a multi-instance marker
- Referencing the current item
- Reference the current item in a task
- Reference the current item inside a subprocess
- Examples
- Example: Validate a list of invoices
- Example: Fan-out and collect results
- Runtime behavior
- Best practices