Skip to content

Sequence view

The sequence view draws a scenario as a sequence diagram: one lifeline per node, one arrow per step, time running down the page. It suits readers who think in lifelines, and it is the quickest way to see who talks to whom, and in what order.

Scenario

The shopper pays. We write the payment down first, charge the card second, and tell the rest of the system last, so a crash never loses money.

I · Record it — before any money moves1POST /payments2INSERT payment (pending)II · Charge the card3create payment intent4authorise card5succeededIII · Finish6mark paid7payment.succeeded8201 Created9payment.succeededWeb appWeb appPayments APIPayments API:8080Ledger databaseLedger databaseStripeStripecard processorRabbitMQRabbitMQpayment.eventsReceipt mailerReceipt mailer
IRecord itbefore any money moves
1
Web app→Payments APIPOST /payments

The request carries an idempotency key, so a retry cannot charge twice.

2
Payments API→Ledger databaseINSERT payment (pending)
IICharge the card
3
Payments API→Stripecreate payment intent
4
Stripeauthorise card

This is the only step we do not control, and the slowest one.

5
Stripe→Payments APIsucceeded
IIIFinish
6
Payments API→Ledger databasemark paid
7
Payments API→RabbitMQpayment.succeeded
8
Payments API→Web app201 Created
9
RabbitMQ→Receipt mailerpayment.succeededplanned

Receipts are planned. Today the shopper only sees the on-screen confirmation.

Pick Sequence beside the player to switch any scenario to it, or open a scenario that way:

scenarios:
pay:
title: Pay with a card
mode: sequence
<Diagram name="payments" scenario="pay" mode="sequence" />
  • Lifelines are the nodes the scenario uses, left to right in the order they first appear. Each heads its column with its icon, title and sub.
  • Arrows are flow steps, drawn from the sender to the receiver with the step’s label above the line. The line style follows the step’s kind: solid for requests, dashed green for responses, red for errors, dotted grey for lookups and amber for events. A planned step is dashed.
  • Self steps are drawn as a small labelled box on the node’s lifeline.
  • Phases become labelled bands across the diagram, such as “I · Record it”.
  • Numbers at the left match the numbers in the step list.

A step that crosses several nodes is drawn as one arrow from the first node to the last. The nodes in between do not get arrows of their own, because the sequence diagram shows what the scenario says, not the route a packet takes. Use the flow view to see the hops.

The player works the same way in every view. Click a row to play that step, press Play to run the scenario, or use the scrubber. The row in progress is highlighted.

You want to Use
Show the architecture and how a request moves through it Flow
Show who talks to whom, and in what order Sequence
Walk a newcomer through what happens, in words Story

All three come from the same steps, so there is nothing to keep in sync.