Archyno
BPMNNotation reference

BPMN gateways

Rhombi, and the marker inside each one. A gateway never does work - it only decides how many of the outgoing paths carry a token, which turns out to be the thing every argument about a process is really about.

14 min readBPMN 2.03 of 7

The short answer

  • A gateway does no work. It is the only thing in BPMN that changes how many tokens are alive, and everything else about gateways follows from that.
  • Exclusive takes exactly one outgoing path, parallel takes all of them unconditionally, inclusive takes every path whose condition is true.
  • An event-based gateway decides nothing - it waits, and the first event to fire wins while the others are discarded.
  • Match every split with a merge of the same kind. Inclusive split into a parallel merge deadlocks; parallel split into an exclusive merge runs everything downstream twice.
A BPMN process using gateways. After a claim received start event, a parallel gateway splits into a check policy task and a check fraud task. A second parallel gateway joins them, then an exclusive gateway labelled covered splits into a settle task on the yes branch and a reject task on the no branch.
Two gateway kinds. The plus splits into paths that all run, and the matching plus waits for both; the cross picks exactly one branch and there is nothing to wait for afterwards.

01A gateway is a rule about tokens#

BPMN's execution model is a token moving through the diagram. A gateway is the only thing that changes how many tokens there are: a split can turn one token into several, a merge can turn several back into one. Everything else about gateways follows from that.

A note on the name. The spec says gateway; most people say gate, and search for gates. They are the same thing, and the diamond is the same diamond - but gateway is the word to use in a diagram title, because it is the one every BPMN tool and every reviewer will be reading for.

Two consequences worth holding onto. First, a gateway does no work - it evaluates conditions already computed, and if you want something checked, that is a task before the gateway. Second, a split usually needs a matching merge of the same kind, because whatever created extra tokens has to be undone or they run to the end separately.

02The five kinds#

ElementNotationWhat it means
Exclusive (XOR)rhombus with an X, or emptyExactly one outgoing path is taken. The conditions are evaluated in order and the first true one wins. The default gateway and the one to reach for first.
Parallel (AND)rhombus with a +Every outgoing path is taken, with no conditions at all. As a merge, it waits for every incoming path before continuing.
Inclusive (OR)rhombus with a circleEvery path whose condition is true is taken - one, several, or all. As a merge it waits for exactly the paths that were activated, which is cleverer than it sounds and is where deadlocks come from.
Event-basedpentagon in a double ringDoes not decide - waits. The path whose event fires first is taken and the others are discarded.
Complexrhombus with an asteriskAn escape hatch for rules the other four cannot express - "continue when three of the five approvals are in". Rare, and usually a sign the process wants restructuring.

03Splitting, merging and joining#

The same symbol does both jobs, and which one it is doing depends only on whether it has more outgoing or more incoming flows. A gateway with one in and three out is a split; three in and one out is a merge.

The vocabulary is worth pinning down, because three words get used for the converging case. A converging parallel gateway is a join: it waits for every branch. A converging exclusive gateway is a merge: it waits for nothing and passes each token through. Both are drawn as the same diamond they were when they split, and calling a merge a join is how a diagram ends up claiming work finished that never ran.

ElementNotationWhat it means
Exclusive mergeseveral in, one outPasses each token straight through as it arrives. It does not wait, because only one branch was ever taken.
Parallel merge (AND-join)several in, one outWaits for every incoming path, then emits one token. This is the one that blocks, and it should be blocking on purpose. It is the construct usually meant by a join in BPMN.
Inclusive mergeseveral in, one outWaits for exactly the branches that were activated upstream. Requires the engine to reason about the whole process, and is the construct most likely to behave differently between tools.
Mixed gatewayseveral in, several outLegal. Unreadable. Split with one gateway and merge with another, and the diagram will tell you what it is doing.

04Counting tokens through the diagram above#

Everything in the two sections above is one skill: put a finger on the start event and count. Here is the claim process at the top of this page, walked through one step at a time, with the number of live tokens after each.

  1. Claim received fires. One token. It sits on the flow into the first gateway.
  2. The parallel split. Two tokens. No conditions are evaluated and nothing is chosen - a parallel split emits one token per outgoing flow, always.
  3. Check policy and check fraud run. Still two. They are genuinely concurrent: the diagram makes no claim about which finishes first, and it does not need to.
  4. The parallel join. Back to one. Whichever token arrives first waits there. When the second arrives the join consumes both and emits one.
  5. Covered? One token, one branch. An exclusive gateway never changes the count - it only changes which flow the token is on.
  6. Settle or reject, then the end. Zero. The process instance is finished when the last token is consumed by an end event.

Now break it deliberately, because both of the classic bugs are visible from the count alone.

Make the first gateway exclusive and leave the join parallel. The split now emits one token, so one check runs. The parallel join is still waiting for two. Nothing arrives on the second flow, ever, and the claim sits in the join for the lifetime of the system. That is the deadlock, and it took one changed marker.

Leave the split parallel and make the join exclusive. Two tokens arrive and an exclusive merge waits for nothing, so both pass straight through. Covered? is evaluated twice, the settle task runs twice, and the customer is paid twice. This one is worse than the deadlock, because a deadlock announces itself and a double payment does not.

05The event-based gateway#

An event-based gateway. After a request documents task, an event-based gateway leads to two catching events: a message event for documents received, and a fourteen day timer. The message path continues to an assess claim task; the timer path continues to a close as incomplete task.
Nothing is decided here. The gateway waits, the two events race, and whichever happens first takes its path while the other is discarded.

This is the construct that makes "we wait for the documents, but not forever" expressible in one picture. Every other way of drawing it - a timer boundary event on a wait task, a loop with a condition - either duplicates the timeout logic or hides it.

Two rules go with it. The targets of an event-based gateway must be catching intermediate events or receive tasks, never plain tasks: the gateway is a race between things that arrive, and a task does not arrive. And the branches must be genuinely mutually exclusive in time, which they are automatically - the first to fire discards the rest.

06Conditions and default flows#

Conditions live on the outgoing sequence flows, not on the gateway. Write them as short expressions a reader can evaluate - amount > 10000, policy status = active - and put them on the line near the gateway rather than near the target.

Exactly one branch of a branching gateway should be the default flow, drawn with a small tick across its tail. It is taken when no other condition holds, and it is what stops a process from stalling at a gateway where the data turned out to be something nobody anticipated.

Reach for it when

  • Exclusive when precisely one path applies - which is most of the time
  • Parallel when both paths must run and neither depends on the other
  • Event-based when the process is waiting and something external decides
  • A default flow on every branching exclusive or inclusive gateway

Reach for something else when

  • Inclusive when exclusive would do - it costs clarity and adds a deadlock risk
  • Complex, almost always - restructure instead
  • A gateway immediately after a gateway with nothing between them
  • Conditions written as prose paragraphs on the flow label

07When the answer is not a gateway at all#

A model that has learned gateways tends to reach for them for every branch in the world, and the result is a diagram that is 40% rhombus. Four of BPMN's other constructs express a decision better in the cases below, and knowing them is most of the difference between a process model that fits on a page and one that does not.

ElementNotationWhat it means
Conditional sequence flowa small rhombus at the tail of a flowA condition written directly on a flow leaving a task, with no gateway. Right for one optional step - "send a receipt if the customer asked for one" - and wrong the moment there are two of them, because there is nowhere to put a default and nothing to stop both firing.
Boundary eventa circle on the edge of a taskFor something that interrupts work already under way: a timeout, an error, a cancellation. A gateway can only ask its question betweentwo tasks, so modelling "if this fails halfway" with one means inventing a polling loop that does not exist.
Event sub-processa dotted rounded rectangleFor something that may happen at any point in the process rather than at one known place - the customer cancels, the regulator asks for the file. Drawing that with gateways means a gateway after every single task.
Business rule taska task with a table markerWhen the decision is forty rules rather than one question. One task pointing at a decision table says "the pricing rules decide this" and leaves the rules somewhere they can be changed without redrawing the process.

Four ways to express a decision that are not a rhombus. Each one keeps something off the diagram that a gateway would have dragged onto it.

The test is whether the branch is part of the process or part of a decision. A claim that goes to fast-track or to manual review is process: the two paths look different and a reader needs to see both. Which of nine risk bands a claim falls into is a decision: the paths are identical afterwards, and putting it on the diagram costs eight rhombi to say one thing. See how to draw a BPMN diagram for where that line usually falls in practice.

08Common mistakes#

  1. Parallel split, exclusive merge. The split made two tokens; the exclusive merge passes both through, and everything after it happens twice.
  2. Inclusive split, parallel merge. The deadlock above. Match your gateways.
  3. Work inside the gateway.A rhombus labelled "Validate and route" is a task and a gateway wearing one outline. Split them.
  4. Unlabelled branches. Two lines leaving a rhombus with nothing written on them make the reader guess, and half of them will guess wrong.
  5. No default flow. The one input nobody thought about arrives and the token has nowhere to go.
  6. Plain tasks after an event-based gateway. Not legal, and it usually means an exclusive gateway was meant.

Gateways and eventsare the two halves of BPMN's control flow: gateways decide, events wait and interrupt. A process modelled with gateways alone tends to grow long chains of polling; one that uses boundary events where it should stays much closer to what actually happens.

In one line each

  1. 01A gateway changes how many tokens exist and does no work of its own.
  2. 02Exclusive picks one path, parallel takes all of them, inclusive takes the true ones.
  3. 03The event-based gateway does not decide - it races catching events.
  4. 04Match every split with a merge of the same kind.
  5. 05Inclusive split into a parallel merge is the classic deadlock.
  6. 06Name the gateway as a question and label every branch with an answer.

09Common questions#

What is the difference between an exclusive and an inclusive gateway?

An exclusive gateway, marked with an X, takes exactly one outgoing path. An inclusive gateway, marked with a circle, evaluates every outgoing condition and takes all of those that are true, which may be one, several or all of them.

What does a parallel gateway do?

A parallel gateway, marked with a plus, takes every outgoing path unconditionally, with no conditions to evaluate. Used as a merge it waits for a token on every incoming path before continuing, which is how you model when all branches have finished.

What is an event-based gateway?

A gateway whose outgoing paths each begin with an intermediate catching event, where the first event to occur decides which path is taken. It is how you model a race, such as a reply or a timeout, whichever arrives first.

Why does an inclusive gateway deadlock?

Because an inclusive merge waits for exactly the branches its matching split activated, and it can only know which those were if the two are properly paired. Split with an inclusive gateway and merge with a parallel one, and the merge waits forever for a branch that never ran.

Do BPMN gateways do any work?

No. A gateway only routes tokens: it never performs an activity and never takes time. Whatever a gateway appears to decide was computed by the activity before it, and the conditions on the outgoing flows only read that result.

In this series

Related reading

All articles