Glossary
Glossary Sequence Diagram

Sequence Diagram

Also known as: sequence diagrams
EngineeringModelingDiagrams

Definition

A diagram of how participants, such as a user, services or components, exchange messages over time, with each participant a vertical lifeline and each message an arrow in order

A UML interaction diagram. It answers who calls whom, in what order, and what comes back. It is the clearest way to explain an authentication handshake, an API flow or an agent hand-off. In Mermaid it is sequenceDiagram.

Tech

See the Mermaid guide for the syntax. It is part of UML.

A real one from this site: signing in with a magic link. Membership is checked twice: once when an account is first created, and again on every new session (#124).

sequenceDiagram
  actor V as Visitor
  participant L as Login page
  participant A as Better Auth
  participant R as Resend
  V->>L: enter email, "Send magic link"
  L->>A: request a magic link
  A->>R: send the link
  R-->>V: email with a one-time link
  V->>A: open the link
  opt first sign-in
    A->>A: user.create.before: address invited?
  end
  A->>A: session.create.before: still on a member list?
  alt invited and listed
    A-->>V: session cookie, redirect in
  else not invited, or removed
    A-->>V: 403 (MEMBERSHIP_BY_INVITATION_ONLY or MEMBERSHIP_REVOKED)
  end

Related Terms

  • a: Appearance
  • ?: Keyboard shortcuts