Sequence diagram

Sequence diagram

The most consistently useful UML diagram. It answers a question people ask constantly: what actually happens when someone does this?

It ages well too, because interactions change less often than structures.


When to draw one

  • API and integration documentation.

  • Debugging discussions, where the order is the argument.

  • Design reviews of anything asynchronous.


What is on the diagram

Element

Meaning

Element

Meaning

Participant

A service, component or person

Solid arrow

A call

Dashed arrow

A return

Activation

The bar showing a participant is busy

alt, opt, loop

Alternatives, optional steps, repetition

Note

Commentary anchored to participants


A worked example

A login flow with an alternative path and a loop:

extension

The source, which you can paste into a new diagram and edit:

extension

A few things that catch people out

  • Put the actor on the left and work rightwards. Readers expect the initiator first.

  • Show the failure path in an alt block; happy-path-only sequence diagrams miss the interesting part.

  • Note over is the right place for timing, expiry and retry rules.


Related

extension

Four types cover most of it.

extension
extension