Skip to content
BENIBIX Learn

Sequence Diagram

Development🏗️ ArchitectureArchitecture Basics

Also known as UML Sequence Diagram, Sequence Chart

A diagram of the messages between parts of a system. Read it from top to bottom.

Think of it like

It is like a comic strip of a phone call. Each box shows who spoke, and in what order.

Example

Emma draws the login flow as a sequence diagram. It shows the browser, the app and the login service, and the four messages between them in order.

Why it matters

Bugs between services often hide in the order of the calls. A sequence diagram puts that order on one page.

Definition

A sequence diagram shows how the parts of a system talk to each other over time. Each part gets a box at the top with a dashed line running down from it. Arrows between the lines are messages, read from top to bottom. A solid arrow is a call, and a dashed arrow is the reply. It is one of the UML diagrams, and tools like Mermaid and PlantUML draw it from text.

Example code

mermaid
sequenceDiagram
    Browser->>App: Open page
    App-->>Browser: Go to sign in
    Browser->>IdP: Sign in
    IdP-->>Browser: Signed token
Mermaid text for a short sign-in. Solid arrows ask, and dashed arrows answer.
Three parts across the top. The messages run down in the order they happen.

Common mistake

Drawing every branch and error in one diagram. Draw the main path first, then a small diagram for each error that matters.

Key takeaways

  1. 1
    Time runs down. Read it from top to bottom.
  2. 2
    Lifelines. One dashed line for each part.
  3. 3
    Calls and replies. Solid arrows ask, and dashed arrows answer.