Mermaid template

Sequence Diagram

Message passing between participants over time — perfect for API flows and protocols.

sequenceDiagram
    participant U as User
    participant A as App
    participant S as API Server
    U->>A: Click "Save"
    A->>+S: POST /documents
    S-->>-A: 201 Created
    alt success
        A->>U: Show confirmation
    else error
        A->>U: Show retry option
    end

Sequence diagrams show who talks to whom and in what order. Participants appear as vertical lifelines; arrows between them are messages. Solid arrows are synchronous calls, dashed arrows are responses.

Activations (+/-) shade the period a participant is busy, and blocks like alt/else or loop express branching and repetition without leaving the diagram.