BPMN and swimlanes

The bpmn header models a business process. Groups become horizontal swimlane bands (one per participant or responsibility) and nodes rank across the lanes in flow order, so an edge that crosses a band reads as a handoff from one role to another.

bpmn
group Customer { Place order, Confirm receipt }
group Warehouse { Pick items, Ship }

Place order -> Pick items
Pick items -> Ship
Ship -> Confirm receipt
CustomerWarehousePlace orderConfirm receiptPick itemsShip
Two lanes; the edges between them are the handoffs.

Activities, events, and gateways#

BPMN has three core node roles, and each has an alias that draws the right shape:

Role aliasDrawsMeans
activityrectanglea task someone performs
eventellipsesomething that happens (start, end, message)
gatewaydiamonda branch or merge in the flow
bpmn
group Applicant {
  Start [event]
  Submit form [activity]
}
group Reviewer {
  Review [activity]
  Complete [decision]
  Approved [event]
  Rejected [event]
}

Start -> Submit form -> Review
Review -> Complete
Complete -> Approved: pass
Complete -> Rejected: fail
ApplicantReviewerStartSubmit formReviewCompleteApprovedRejectedpassfail
event, activity, and a decision gateway across two lanes.

Lanes are groups#

A swimlane is just a group under the bpmn header, so everything you know about groups applies: a node can join a lane from its own declaration with [group: Name], and members can be declared inline or elsewhere. Nodes that belong to no lane fall into a trailing band.

bpmn

group Sales {
  Lead [event]
  Qualify [activity]
}
group Finance {
  Invoice [activity]
  Payment [event]
}

Lead -> Qualify
Qualify -> Invoice: won
Invoice -> Payment
SalesFinanceLeadQualifyInvoicePaymentwon

An order-to-cash process across three responsibilities, with a decision gateway and a rejection loop.

bpmn
title: Order to cash

group Customer {
  Places order [event]
  Receives goods [event]
}
group Sales {
  Validate order [activity]
  Credit ok [decision]
  Approve [activity]
}
group Fulfilment {
  Pick and pack [activity]
  Dispatch [activity]
}

Places order -> Validate order
Validate order -> Credit ok
Credit ok -> Approve: yes
Credit ok -> Places order: no, revise
Approve -> Pick and pack -> Dispatch
Dispatch -> Receives goods
CustomerSalesFulfilmentPlaces orderReceives goodsValidate orderCredit okApprovePick and packDispatchyesno, revise
Every diagram on these pages is compiled live from the code above it, through the same pipeline the app uses. Open the canvas to try it.