Sequence diagram

Updated

A sequence diagram is a diagram that shows how participants, such as users, services or objects, exchange messages in a particular order. Each participant has a vertical line, time runs from top to bottom, and horizontal arrows show the messages between them. It is one of the interaction diagrams of the Unified Modeling Language, so it is often called a UML sequence diagram.

Sequence diagram symbols

  • Actor: a person or outside system that starts or takes part in the interaction, often drawn as a stick figure.

  • Participant or object: a box at the top of the diagram, such as "Web app" or "Payment service".

  • Lifeline: the dashed vertical line under each participant.

  • Activation bar: a thin rectangle on a lifeline that shows when the participant is busy.

  • Message: a solid arrow for a call or request, and a dashed arrow for the reply.

  • Fragments: labeled frames for logic such as alt (alternatives), opt (optional) and loop (repetition).

When to use a sequence diagram

Sequence diagrams are useful when the order of communication matters: designing an API, explaining a login or payment flow, documenting how services call each other, or finding out where a request fails. They are also a clear way to explain a system to someone who does not read code.

How to draw a sequence diagram

  1. Choose one scenario. For example "customer pays by card". One diagram per scenario keeps it readable.

  2. List the participants. Place them left to right in the order they first take part.

  3. Add the messages in time order. Label each arrow with the action or data it carries.

  4. Add replies and conditions. Show return messages, and use fragments for alternatives and loops.

  5. Check it against the real behavior. Walk through the diagram with the people who build or operate the system.

Example

A checkout flow has four participants: Customer, Store website, Payment gateway and Bank. The customer submits the order, the website sends a charge request to the gateway, the gateway asks the bank to authorize it, and the answer travels back along the same path. An alt fragment shows the two outcomes: payment approved, or payment declined with a message to the customer.

Sequence diagram vs flowchart

A flowchart shows the steps and decisions of a process. A sequence diagram shows who talks to whom, and in what order. A swimlane diagram sits between the two: it keeps the flowchart steps and adds a lane for each participant. For structure instead of behavior, use an architecture diagram or another UML diagram.

Sequence diagrams in MockFlow

Describe an interaction in plain words and the AI sequence diagram generator drafts the participants and messages on a MockFlow board, where you can edit them with your team. You can also start from the UML sequence diagram template or the payment checkout sequence skill. Engineering teams keep these diagrams beside their plans and notes on a whiteboard for developers.

MockFlow

Turn ideas into plans on one board.

No account needed
mockflow.com/new

Open a blank board in one click. Boards last 24 hours, so sign up to keep one.

MCPBrainstorm with MockFlow MCP

Add MockFlow as an MCP connector in Claude, Cursor, or any MCP-compatible AI assistant to generate flowcharts, mindmaps, architecture diagrams, and 16 types of visualizations.

Desktop App MCP Powerful
CLI Web MCP Developer
Web MCP Easiest

Built into the MockFlow Desktop App. AI creates visuals directly on your open canvas — no URLs, no waiting.

1
Open Desktop App → open a MockFlow project
2
In Claude Code / Cursor, run:
claude mcp add --transport http -s user mockflow-ideaboard http://localhost:21193/mcp
3
Ask: "Create a flowchart for..."

Best for: Designers, product teams, daily MockFlow users.

Download Desktop App →

Install from npm, log in via browser (OAuth), and boards are saved to your MockFlow account.

1
npm install -g @mockflow/ideaboard-mcp
2
mockflow-ideaboard-mcp login
3
mockflow-ideaboard-mcp

Best for: Developers using Claude Code, Cursor, or VS Code Copilot.

npm Package →

Add MockFlow as a connector in Claude.ai or ChatGPT. No installation. A new board is created and you get a shareable URL.

1
Open Claude.ai → Settings → Connectors
2
Paste this URL, then click Connect and sign in to MockFlow: https://app.mockflow.com/ideaboard/connector/mcp
3
Ask Claude to create a flowchart — done!

ChatGPT: use https://app.mockflow.com/ideaboard/mcp and save its boards to your account to keep them

Best for: Managers, marketers, anyone using Claude.ai or ChatGPT in the browser.

Welcome back
Don't have an account? Sign up

Faster ways in

Sign in with an account you already use.