Sequence diagram (SeqDiag)

SeqDiag trades features for brevity. An arrow is a message, a double arrow is a call with its return, and that is most of the language.


#What this example shows

  • The => form, which draws a call and its return in one line.

  • Explicit return labels.

  • Participants ordered by first mention.


#A worked example

Open it, edit it, or copy the source below.

Sequence diagram (SeqDiag)

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

seqdiag {
  browser  -> web    [label = "GET /orders"];
  web      => api    [label = "getOrders(userId)", return = "orders"];
  api      => db     [label = "SELECT * FROM orders", return = "rows"];
  api      -> cache  [label = "warm cache", note = "fire and forget"];
  browser <-- web    [label = "200 OK"];
}

#Making it your own

  • Mention participants in the order you want them drawn.

  • The => form halves the length of a long sequence.

  • For activations, alt blocks and loops, use Mermaid or PlantUML.



Specialists. Borrow one when you need it.