Gateways and Sequence Flows
When a token leaves a node, the engine decides which outgoing sequence flows it takes. This page covers how that decision is made: conditions and default flows on any node, the four gateway types that split and merge tokens, what each one waits for at a join, and what validation rejects at deploy. For an introduction to the notation itself, see What is BPMN?.
| Symbol | Element | At a split | At a join |
|---|---|---|---|
| Exclusive gateway | One flow: the first condition that is true, else the default | Passes every token straight through | |
| Parallel gateway | Every outgoing flow | Waits for a token on every incoming flow | |
| Inclusive gateway | Every flow whose condition is true, else the default | Waits until no other token can still arrive | |
| Event-based gateway | The flow behind the first event that happens | Not used as a join | |
| Sequence flow | Carries the token to the next node | ||
| Conditional flow | Taken when its condition is true | ||
| Default flow | Taken when no other flow is |
Sequence flows
Sequence flows connect events, tasks, gateways and sub-processes within one process. A flow carries a token from its source to its target.
Attributes
| Attribute | Required | Notes |
|---|---|---|
id | yes | Unique flow identifier |
name | no | Display label |
sourceRef | yes | ID of the source node |
targetRef | yes | ID of the target node |
Conditions
A <conditionExpression> child holds a FEEL expression that is evaluated when the token leaves a node with more than one outgoing flow. The flow is taken when the expression returns true. Write it with a leading =, as every FEEL field in a process: the engine also reads a condition without one, but = is the canonical form.
<bpmn:sequenceFlow id="f1" name="price > 0" sourceRef="svc1" targetRef="task-success">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=price > 0</bpmn:conditionExpression>
</bpmn:sequenceFlow>
Conditions are evaluated on flows that leave:
- Exclusive (XOR) gateways, where the first matching flow in document order is taken.
- Inclusive (OR) gateways, where every matching flow is taken in parallel.
- Activities, where every matching flow is taken in parallel (an uncontrolled fork, BPMN 2.0 §13.2.1).
An activity evaluates the condition on its only outgoing flow too, and a false condition with no default raises an incident. Events take their outgoing flows without evaluating conditions.
Default flows
A node with several outgoing flows can mark one of them as the default with default="<flowId>". The default flow is taken only when no other outgoing flow is. The engine reads default on:
- exclusive and inclusive gateways
- tasks of every type (service, user, script, business rule, send, receive, manual, generic)
- embedded and ad-hoc sub-processes
- call activities
A default flow must not carry a <conditionExpression> of its own.
<!-- Exclusive gateway with a default -->
<bpmn:exclusiveGateway id="gw1" default="f-fallback">
<bpmn:outgoing>f-vip</bpmn:outgoing>
<bpmn:outgoing>f-fallback</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="f-vip" sourceRef="gw1" targetRef="task-vip">
<bpmn:conditionExpression>=tier = "vip"</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="f-fallback" sourceRef="gw1" targetRef="task-default" />
<!-- Service task with a default: the same routing without a separate gateway -->
<bpmn:serviceTask id="route" default="f-default">
<bpmn:extensionElements>
<quantum:taskDefinition type="route-task" />
</bpmn:extensionElements>
<bpmn:outgoing>f-route-vip</bpmn:outgoing>
<bpmn:outgoing>f-default</bpmn:outgoing>
</bpmn:serviceTask>
How outgoing flows are selected
When a token leaves a node with several outgoing flows, the engine evaluates them in two passes:
- Non-default flows. Each flow whose condition returns
trueemits a token. A flow without a<conditionExpression>counts as always true. The default flow is skipped in this pass. - Default fallback. If the first pass emitted no token and the node declares a default flow, the default emits one.
If neither pass emits a token, the node raises an incident and the instance waits there until an operator resolves it.
| Source node | Several non-default flows match | No non-default flow matches | Only an unconditional default |
|---|---|---|---|
| Exclusive gateway (XOR) | The first match in document order, the rest are skipped | The default if declared, otherwise an incident | The default |
| Inclusive gateway (OR) | Every match, in parallel | The default if declared, otherwise an incident | The default |
| Activity | Every match, in parallel (uncontrolled fork) | The default if declared, otherwise an incident | The default |
| Parallel gateway (AND) | Every outgoing flow, conditions are ignored | n/a | n/a |
Three-way example
A service task with three outgoing flows:
f-condwith the condition=x > 0, totask-positivef-uncondwith no condition, totask-alwaysf-default, declared asdefault, totask-fallback
<bpmn:serviceTask id="route" default="f-default">
<bpmn:extensionElements>
<quantum:taskDefinition type="route-task" />
</bpmn:extensionElements>
<bpmn:outgoing>f-cond</bpmn:outgoing>
<bpmn:outgoing>f-uncond</bpmn:outgoing>
<bpmn:outgoing>f-default</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="f-cond" sourceRef="route" targetRef="task-positive">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=x > 0</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="f-uncond" sourceRef="route" targetRef="task-always" />
<bpmn:sequenceFlow id="f-default" sourceRef="route" targetRef="task-fallback" />
x | f-cond (x > 0) | f-uncond (no condition) | f-default | Result |
|---|---|---|---|---|
5 | true, emits | always true, emits | skipped | Two parallel tokens: task-positive and task-always |
-1 | false | always true, emits | skipped | One token: task-always |
The default flow here can never fire: f-uncond emits on every visit, so the fallback pass never runs. The validator does not flag this on activities, so look for it in review. To make the default reachable, give f-uncond a condition that can be false, or remove it.
Sequence flow validation
| Check | Severity |
|---|---|
| Default flow ID isn't one of the source node's outgoing flows | Error |
Default flow carries a conditionExpression | Error |
| Start event has an incoming sequence flow | Error |
| End event has an outgoing sequence flow | Error |
| Intermediate catch event does not have exactly one outgoing sequence flow | Error |
| Boundary event (other than compensation) has no outgoing sequence flow | Error |
Activity marked isForCompensation="true" has incoming flows | Error |
Gateway attributes
| Attribute | Notes |
|---|---|
id | Required |
name | Optional |
default | Flow ID of the fallback flow taken when no condition matches (exclusive and inclusive only) |
gatewayDirection | Informational, not enforced |
A default flow must be one of the gateway's outgoing flows and must not carry a conditionExpression.
Exclusive gateway (XOR)
Takes exactly one outgoing flow at a split: the first flow whose condition is true, or the default when none is. Used as a join it merges alternative paths without waiting, so every incoming token passes straight through.


Behavior
| Scenario | Behavior |
|---|---|
| Split with conditions | Flows are evaluated in document order. The first true wins and the flows after it are not evaluated |
Split with no match and a default | The default flow is taken |
Split with no match and no default | Incident on the gateway |
| Join | Pass-through, every incoming token advances |
Example
<bpmn:exclusiveGateway id="gw-route" name="Amount?" default="flow-auto">
<bpmn:incoming>f1</bpmn:incoming>
<bpmn:outgoing>flow-review</bpmn:outgoing>
<bpmn:outgoing>flow-auto</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:sequenceFlow id="flow-review" name="amount > 1000" sourceRef="gw-route" targetRef="review">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=amount > 1000</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="flow-auto" name="default" sourceRef="gw-route" targetRef="approve" />
Validation
| Check | Severity |
|---|---|
default doesn't match an outgoing flow | Error |
Default flow carries a conditionExpression | Error |
Non-default outgoing flow has no condition (when default is set) | Warning |
Several outgoing flows, no default, and a flow without a condition | Warning |
| Gateway with at most one incoming and one outgoing flow, so it neither merges nor splits | Error |
Parallel gateway (AND)
Splits into every outgoing flow at once, and joins by waiting for a token on every incoming flow.


Behavior
| Scenario | Behavior |
|---|---|
| Split | Every outgoing flow is activated. Conditions are not evaluated |
| Join | Waits until a token has arrived on every incoming flow, then emits a single outgoing token |
A condition on an outgoing flow is ignored, and deployment reports a warning.
Example
<bpmn:parallelGateway id="fork">
<bpmn:incoming>f1</bpmn:incoming>
<bpmn:outgoing>f2</bpmn:outgoing>
<bpmn:outgoing>f3</bpmn:outgoing>
</bpmn:parallelGateway>
<!-- ... tasks in parallel branches ... -->
<bpmn:parallelGateway id="join">
<bpmn:incoming>f2-done</bpmn:incoming>
<bpmn:incoming>f3-done</bpmn:incoming>
<bpmn:outgoing>f4</bpmn:outgoing>
</bpmn:parallelGateway>
Validation
| Check | Severity |
|---|---|
Outgoing flow carries a conditionExpression | Warning (the condition is ignored) |
| Gateway with at most one incoming and one outgoing flow, so it neither merges nor splits | Error |
Inclusive gateway (OR)
Takes every outgoing flow whose condition is true. The matching join waits for all of those branches, and only those.


Behavior
| Scenario | Behavior |
|---|---|
| Split | Every matching condition activates its flow in parallel. With no match the default fires, and with no match and no default the gateway raises an incident |
| Join | Waits for every branch that can still reach it, then merges branch variables into the parent scope and advances once |
When the join fires
The join does not count incoming flows. It fires when at least one token has arrived and no other token in the same scope can still reach it. In the diagram above:
smsOptIn | pushOptIn | Branches that run | The join fires |
|---|---|---|---|
true | true | Send SMS, Send push | When the slower of the two finishes |
true | false | Send SMS | As soon as Send SMS finishes |
false | false | Send email (default) | As soon as Send email finishes |
Because the rule is about reachability, it also holds when the split and join are not paired one to one: loops, nested gateways and branches that end early do not keep the join waiting for a token that can never come.
Example
<bpmn:inclusiveGateway id="gw-or" name="Channels?" default="flow-email">
<bpmn:incoming>f1</bpmn:incoming>
<bpmn:outgoing>flow-sms</bpmn:outgoing>
<bpmn:outgoing>flow-push</bpmn:outgoing>
<bpmn:outgoing>flow-email</bpmn:outgoing>
</bpmn:inclusiveGateway>
<bpmn:sequenceFlow id="flow-sms" sourceRef="gw-or" targetRef="send-sms">
<bpmn:conditionExpression>=smsOptIn</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="flow-push" sourceRef="gw-or" targetRef="send-push">
<bpmn:conditionExpression>=pushOptIn</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="flow-email" sourceRef="gw-or" targetRef="send-email" />
Validation
| Check | Severity |
|---|---|
default doesn't match an outgoing flow | Error |
Default flow carries a conditionExpression | Error |
Non-default outgoing flow has no condition (when default is set) | Warning |
Several outgoing flows, no default, and a flow without a condition | Warning |
| Gateway with at most one incoming and one outgoing flow, so it neither merges nor splits | Error |
Event-based gateway
Waits for the first of several events and takes the branch behind it. Each outgoing flow must lead directly to an intermediate catch event with a message, timer or signal trigger.


Attributes
| Attribute | Default | Notes |
|---|---|---|
instantiate | false | Not supported. Deployment fails with an error if set to true |
eventGatewayType | Exclusive | Only Exclusive (first event wins) is implemented. Parallel deploys without error but runs as Exclusive |
Behavior
| Scenario | Behavior |
|---|---|
| First event fires | The winning branch advances, every other branch is cancelled. A winning catch event without an output mapping writes the message or signal payload to the process variables, as a catch event on its own does |
| No event fires | The token waits indefinitely. Add a timer branch to bound the wait |
To let every event that fires advance its own branch, use a parallel gateway followed by separate catch events instead.
Example
<bpmn:eventBasedGateway id="gw-event" name="First to happen?">
<bpmn:incoming>f1</bpmn:incoming>
<bpmn:outgoing>flow-msg</bpmn:outgoing>
<bpmn:outgoing>flow-timer</bpmn:outgoing>
</bpmn:eventBasedGateway>
<bpmn:sequenceFlow id="flow-msg" sourceRef="gw-event" targetRef="catch-paid" />
<bpmn:intermediateCatchEvent id="catch-paid" name="Payment received">
<bpmn:incoming>flow-msg</bpmn:incoming>
<bpmn:outgoing>f-ship</bpmn:outgoing>
<bpmn:messageEventDefinition messageRef="Msg_Paid" />
</bpmn:intermediateCatchEvent>
<bpmn:sequenceFlow id="flow-timer" sourceRef="gw-event" targetRef="catch-timeout" />
<bpmn:intermediateCatchEvent id="catch-timeout" name="7 days">
<bpmn:incoming>flow-timer</bpmn:incoming>
<bpmn:outgoing>f-cancel</bpmn:outgoing>
<bpmn:timerEventDefinition>
<bpmn:timeDuration xsi:type="bpmn:tFormalExpression">P7D</bpmn:timeDuration>
</bpmn:timerEventDefinition>
</bpmn:intermediateCatchEvent>
Validation
| Check | Severity |
|---|---|
| Fewer than 2 outgoing flows | Error |
| No incoming flow | Error |
instantiate="true" set on the gateway | Error |
| Outgoing flow leads to a node that isn't an intermediate catch event | Error |
| Catch event trigger isn't message, signal, or timer | Error |
Outgoing flow carries a conditionExpression | Error |
FAQ
What's the difference between exclusive, parallel, and inclusive gateways in BPMN?
An exclusive (XOR) gateway takes exactly one outgoing flow at a split - the first whose condition returns true, or the default if none match. A parallel (AND) gateway takes every outgoing flow unconditionally, and at a join waits until a token has arrived on every incoming branch. An inclusive (OR) gateway takes every outgoing flow whose condition is true (or the default if none match), and its matching join waits until at least one branch has arrived and no other live token in scope can still reach it.
What happens at an exclusive gateway when no outgoing condition matches?
If the gateway has a default flow, the default flow is taken. If it has none, the gateway raises an incident and the instance waits there until an operator resolves it. Conditions are evaluated in the order the outgoing flows appear in the BPMN XML, and the first to return true wins.
What is a default flow in BPMN and when does it fire?
A default flow is the fallback outgoing flow, taken when no other outgoing flow of the node is. Declare it with default="<flowId>" on the source node. The flow itself must not carry a conditionExpression, and the validator rejects a default flow that has one. The engine reads default on exclusive and inclusive gateways, on every kind of task, on embedded and ad-hoc sub-processes, and on call activities.
Why might my default flow never fire?
A non-default outgoing flow without a conditionExpression counts as always true and emits a token on every visit. The default only fires when every non-default flow evaluates to false, so an unconditional sibling makes it unreachable. On exclusive and inclusive gateways the validator reports this combination as a warning.
Can a BPMN task have multiple outgoing flows with conditions?
Yes. An activity with several outgoing flows is an uncontrolled fork (BPMN 2.0 §13.2.1): every flow whose condition evaluates to true emits a token, so several matches fan out into parallel branches. Conditions plus a default flow on a task behave like an inclusive gateway, which lets you route from a task without a separate gateway node. When no condition matches and there is no default, the task raises an incident. For exactly one path, use an exclusive gateway.
What happens to a sequence flow without a condition expression?
From a node with one outgoing flow, the flow is always taken. From a node with several outgoing flows it counts as always true on activities and inclusive gateways, so it emits a token on every visit. On parallel gateways that is the normal case, since they ignore conditions anyway. On an exclusive gateway an unconditional non-default flow wins every time it is reached, so any flow after it in document order is unreachable.
What's the difference between a sequence flow and a message flow in BPMN?
A sequence flow is the solid arrow that connects flow nodes within one process. It carries tokens at runtime and defines the order of execution. A message flow is a dashed arrow in a collaboration diagram between two participants, showing that one sends a message to the other. The modeler reads and writes message flows, but the engine does not act on them: message delivery happens through message throw events, send tasks, catch events, receive tasks and correlation.
What happens if a parallel gateway join receives a token on only some of its incoming flows?
The join waits. A parallel join fires once a token has arrived on every incoming sequence flow. If one branch never produces a token, for example because an upstream task failed and was not compensated, the join waits indefinitely. Use a timer boundary event on the surrounding scope to bound the wait.
How does an inclusive (OR) join decide when to fire?
The inclusive join fires as soon as at least one branch has arrived and no other live token in the enclosing scope can still reach the join without first passing through it. This reachability check handles loops, nested gateways and asymmetric splits. The join does not need to know which split created the incoming tokens, and tokens in parts of the process that cannot reach it do not keep it waiting.
What can come after an event-based gateway?
Each outgoing flow must lead directly to an intermediate catch event with a message, signal, or timer trigger. Tasks, gateways and other element types are rejected at deployment, and so are conditional, multiple and parallel-multiple catch events.
Can an event-based gateway start a process instance (`instantiate="true"`)?
No. The instantiating event gateway is not supported, and deployment fails with a validation error when instantiate is true. To start an instance from an event, use a message start event or a signal start event on the process.
Does QuantumBPM support the BPMN complex gateway?
No. The complex gateway is rejected at deployment by both the modeler and the engine. Most uses, such as continuing when 2 of 3 branches arrive, can be modeled with an exclusive or inclusive gateway and FEEL conditions on the outgoing flows, or with a script task that computes the routing decision.
Can an exclusive gateway be used as a join to merge multiple branches?
Yes. As a join, an exclusive gateway is a pass-through merge: every incoming token advances on its own, with no synchronisation. It is the standard way to bring alternative branches from an exclusive split back onto one path.