Skip to main content
Version: Next 🚧

Gateways

A gateway controls how the process flow diverges and converges: it models decisions, forks, and joins by routing tokens along one or more sequence flows. A gateway performs no work of its own — a token passes through it immediately, and only the converging (joining) gateways ever make a token wait.

Gateways are rendered as a diamond; the marker inside indicates the type. Each type answers the routing question differently:

  • Diverging (one incoming, several outgoing flows) — which outgoing paths receive a token: exactly one (Exclusive), every path whose condition is true (Inclusive), all of them (Parallel), or the path of the first event to occur (Event-based).
  • Converging (several incoming, one outgoing flow) — whether to synchronize: pass each token through (Exclusive), wait for all incoming branches (Parallel), or wait for exactly the branches that are still active (Inclusive).

Types

Green icons are supported and link to their documentation.

GatewayIconDescription
ExclusiveExclusive GatewayRoutes the token down exactly one outgoing path — the first whose condition is true.
InclusiveInclusive GatewayActivates every outgoing path whose condition is true; as a join, waits for all branches that are still active.
ParallelParallel GatewayActivates all outgoing paths unconditionally; as a join, waits for a token on every incoming flow.
Event-basedEvent-Based GatewayRoutes the token along the path of whichever event occurs first, instead of evaluating data conditions.
Not yet supported

Complex gateway

Usage in BPMN

The routing decision is not configured on the gateway itself but on its outgoing sequence flows:

MarkupWhereDescription
bpmn:conditionExpressionoutgoing bpmn:sequenceFlowA FEEL expression prefixed with = that must evaluate to a boolean, e.g. = amount > 10000. Evaluated against the process instance variables.
default attributethe gateway elementReferences the fallback flow taken when no condition evaluates to true. The default flow itself carries no condition. See Default flow.

Rules shared by the condition-evaluating gateways (Exclusive and Inclusive):

  1. When a token arrives, the conditions of the outgoing flows are evaluated against the current process variables. Conditions must be written as =-prefixed FEEL expressions returning true or false.
  2. A flow without a condition expression is only followed when it is the gateway's single outgoing flow — with several outgoing flows, leave only the default flow unconditioned.
  3. If no condition matches and a default flow is defined, the default flow is taken.
  4. If no condition matches and there is no default flow, the token fails and an incident is recorded.

The Parallel gateway ignores conditions entirely, and the Event-based gateway replaces conditions with competing catch events.

XML example

The shared markup on a condition-evaluating gateway: two conditional flows evaluated in order and a default flow referenced by the gateway's default attribute:

<bpmn:exclusiveGateway id="Gateway_Amount" name="Amount?" default="Flow_Default">
<bpmn:incoming>Flow_In</bpmn:incoming>
<bpmn:outgoing>Flow_High</bpmn:outgoing>
<bpmn:outgoing>Flow_Medium</bpmn:outgoing>
<bpmn:outgoing>Flow_Default</bpmn:outgoing>
</bpmn:exclusiveGateway>

<bpmn:sequenceFlow id="Flow_High" sourceRef="Gateway_Amount" targetRef="Task_ManualReview">
<bpmn:conditionExpression>= amount > 10000</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_Medium" sourceRef="Gateway_Amount" targetRef="Task_StandardReview">
<bpmn:conditionExpression>= amount > 1000</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="Flow_Default" sourceRef="Gateway_Amount" targetRef="Task_AutoApprove" />