Learn

Architecture & pattern guides

Read the idea, build it on a Grid, prove it in a challenge. Short, practical guides — illustrated with RodGrid's own nodes — on system design, design patterns, flow modeling, and how to get the most out of the app.

All articles

Gateways: parallel, inclusive & event

BPMN-style gateways that open all, some or only the first of a flow's paths, and what the point where those paths meet again has to wait for.

Three teams and one start date

A new engineer starts on Monday. Before then, IT has to ship a laptop and Security has to create the accounts, and neither team needs anything from the other. Some hires also need a visa letter or a parking permit; most need neither. Drawing the start of this is easy: one step fans out into several. The hard part is the other end. Monday can only begin once the work that was started is finished, and the diagram has to say which work that is.

A Decision cannot say it, because it sends the flow down exactly one of its two branches. Gateways are the diamonds that BPMN (Business Process Model and Notation) uses for richer control flow. A Parallel Gateway activates all outgoing paths at once, an Inclusive Gateway activates every path whose condition holds, one or more of them, and an Event Gateway waits and takes whichever path's event fires first. The first two can start several branches at once; the Event Gateway lets only one run. Where branches meet again, what the meeting point waits for is where most gateway mistakes are made.

All of them out, all of them back

The laptop and the accounts are both mandatory, so they leave through a Parallel Gateway: both branches start, and they can run at the same time because neither waits for the other. A Parallel Gateway also joins: placed after the branches, it waits until every incoming path has arrived and only then lets the flow continue. On the Grid it takes up to three incoming edges, on its left, right and top ports, so two branches coming down from a fork can land on its two sides.

Two branches out, both back in

If the laptop ships two days after the accounts are ready, First day waits those two days: the join lets the flow continue only once every branch has finished. A join belongs wherever the next step needs every branch; a branch that nothing after the fork depends on can end at its own End instead. A Split draws the same fan-out but takes one input, so it cannot be the join (Split & parallelism covers it), and a Summing Junction is the other node that waits for every input; Junctions: Or & Summing compares it with the Or.

Some of them out, only those back

The visa letter and the parking permit are different. Each one depends on the hire, and a hire can need both, one or neither. Send them through a Parallel Gateway and every new engineer gets a visa letter, wanted or not. An Inclusive Gateway checks each outgoing path's condition and starts the ones that hold. BPMN also lets one path be the gateway's default, taken only when no condition holds; without it, a hire who needs nothing extra has no path to take, so give that case a labelled path of its own.

Now take a hire who needs only the permit. One branch starts and the visa branch never does. If the two meet at a Parallel Gateway or a Summing Junction, the join waits for the visa branch as well, which will never arrive, and the flow never reaches First day. Branches opened by an Inclusive Gateway converge on a Merge, which states no wait and so cannot stall on a branch that never started — the Inclusive Gateway itself only forks. Never join them with a Parallel Gateway or a Summing Junction: both wait for branches that never ran. (In full BPMN that join can be a converging inclusive gateway, which waits for the branches that started; on the Grid the Inclusive Gateway takes a single input, so a Merge is what brings those branches back. It does not state the wait, so name what First day needs in its title or on the edge into it. Merge & path convergence covers the Merge.)

A race, not a question

The Event Gateway is the odd one of the three: it is BPMN's exclusive event-based gateway (BPMN also has a parallel variant, used only to start a process). It takes one incoming path and waits. Its outgoing paths each begin with something that has not happened yet, a reply arriving or a deadline passing, and the first of those to arrive picks the path; the gateway stops waiting for the others. Earlier in the hire's process, that is the offer letter: signed, declined, or expired after five days. The events themselves and how to draw them belong to BPMN events: timer, message & boundary.

That is also the line between a gateway and a plain Decision. A Decision answers a question from data the flow already has: "is the hire based abroad?" is in the record, so it is a Decision, not an Event Gateway. When exactly one path should run and the answer is known, a Decision is enough; it has two exits on the Grid, so chain Decisions for three or more outcomes (Decisions & branching explains why). Reach for a gateway only when several paths run at once, or when the flow has to wait to find out.

The order that asks for nothing extra

Parallel Order Fulfillment moves the onboarding problem to a warehouse. Picking, packing material and the shipping label are mandatory for every order; gift wrap and a printed invoice depend on what the customer chose. The order that exposes a wrong join is the dullest one, with neither option ticked. Walk it through your diagram node by node: wherever it stalls, either no path covers the order with no extras, or a join is waiting for an optional branch that never started, and the optional branches should meet at a Merge, not at that join. The same brief has an out-of-stock pick fail the whole order and abandon the other branches; Error handling & error boundaries covers that path.

Practice this