💬 Mermaid

Sequence diagram

Show how systems and people talk to each other

What is a Sequence diagram?

A sequence diagram shows messages exchanged between participants over time: API calls, authentication flows, microservice communication. It is the standard way to document interactions in software architecture.

Live example

Mermaid code
sequenceDiagram
    autonumber
    participant U as User
    participant A as API
    participant D as Database
    U->>A: POST /login
    A->>D: SELECT user
    D-->>A: user row
    A-->>U: 200 + JWT token
    U->>A: GET /profile (Bearer)
    A-->>U: 200 profile
Live example
DatabaseAPIUserDatabaseAPIUserPOST /login1SELECT user2user row3200 + JWT token4GET /profile (Bearer)5200 profile6

When to use it

Document API flows, authentication and payment protocols
Design microservice interactions before implementation
Debug production incidents by mapping the actual call chain

Basic syntax

.mmd
sequenceDiagram
    participant A as Alice
    participant B as Bob
    A->>B: Sync request
    B-->>A: Async response

Questions about this diagram

What do the arrow types mean in a Mermaid sequence diagram?

Solid arrows (->>) are synchronous calls, dashed arrows (-->>) are responses or async messages. Activations show when a participant is busy processing.

Can I show loops and conditions?

Yes — Mermaid supports loop, alt (if/else), opt (optional) and par (parallel) blocks to express real-world protocol logic.

Create your Sequence diagram now

Describe it in plain language — the AI writes the Mermaid code for you.

Open Mermaid Studio