# Sequence Diagram

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

**Field:** Software Development  
**Category:** Architecture  
**Also known as:** UML Sequence Diagram, Sequence Chart

## Think of it like

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

## 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

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.

## 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.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [Unified Modeling Language (UML)](https://learn.benibix.com/term/development/uml)
- [C4 Model](https://learn.benibix.com/term/development/c4-model)
- [Mermaid](https://learn.benibix.com/term/design/mermaid)
- [PlantUML](https://learn.benibix.com/term/design/plantuml)
- [Application Programming Interface (API)](https://learn.benibix.com/term/development/api)

![Three boxes across the top, Browser, App and Login service, each with a dashed lifeline running down. Four arrows cross between the lines from top to bottom: 1, open page, solid, browser to app. 2, go to sign in, dashed, app to browser. 3, sign in, solid, browser to login service. 4, signed token, dashed, login service to browser. An arrow at the side marked time points down.](https://learn.benibix.com/diagrams/dev-sequence-diagram.svg)

---

Source: https://learn.benibix.com/term/development/sequence-diagram
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
