Multi-Instance
An activity that runs once per element of a collection — BPMN’s for-each, with sequential or parallel execution.
What a multi-instance activity is
A multi-instance activity is an activity with three vertical bars (parallel) or three horizontal bars (sequential) at its bottom. It means "run this activity once per element of a collection". The collection is typically a list of items or records — the line items on an invoice, the approvers in a chain, the regions in a rollout.
Parallel multi-instance fires all iterations at once and waits for all (or a configurable subset) to finish before continuing. Sequential multi-instance runs them one at a time. The choice matters: parallel is faster but requires all iterations to be independent; sequential guarantees order but serialises the latency.
Completion conditions
Multi-instance activities support completion conditions — rules that decide when "enough" iterations have completed. The default is "all must complete". You can set "at least 1" (short-circuit on first success), "at least N" (quorum voting), or a custom expression. This is how you model approval chains where three of five approvers is enough, or parallel supplier bids where the first responder wins.
Multi-instance activities in LucidFlow
When the source document references a list ("for each line item", "notify each regional manager"), LucidFlow emits a multi-instance activity rather than duplicating the step. The cost dashboard scales the activity cost by the expected collection size, so a multi-instance "Look up tax rate" on a typical 20-line invoice is counted as 20× the per-iteration cost. Multi-instance activities are prime automation targets — the per-iteration cost is small, but the total is large and the work is mechanical.
Frequently asked questions
What is the difference between a multi-instance activity and a loop?
A loop re-runs the same activity until a condition holds — iteration count is dynamic, usually small, sequential. A multi-instance runs once per element of a known collection — iteration count is the collection size, and iterations can run in parallel.
How do I stop a parallel multi-instance once enough have completed?
Set a completion condition. When it evaluates to true, remaining instances are terminated. This is how "first three bids wins" or "quorum of approvers reached" is modelled cleanly.
Can sub-processes be multi-instance?
Yes, and it is often the cleanest pattern. A multi-instance sub-process encapsulates the per-iteration body — inputs, activities, outputs — and keeps the parent diagram readable.