Diagrams guide

Sequence diagrams: who talks to whom, in what order

A sequence diagram shows the messages that pass between people and systems, in order, from first request to last reply. Draw one scenario at a time.

Diagrams · · 4 minute read

The short answer

  • Each participant gets a column, with time running down the page.
  • Draw one scenario per diagram, starting with the normal case.
  • Number the messages so that people can refer to them.

A finished example

This is what the Sequence diagram template can look like once it is filled in. This one is for a shopper tracking an order.

An example made up for this guide. Your own board starts with the headings and prompts, and you add the notes.
Read the example as words
The board
Shopper
Shop app
Order service
Orders database
1. Taps “Track”
2. Sends request
3. Finds the order
4. Returns data
5. Replies
6. Shows “Arriving today”

What a sequence diagram shows

When a person taps a button in an app, a chain of events follows. The app sends a request to a service. The service looks something up. An answer comes back, and the screen updates. A sequence diagram shows that chain, step by step.

It answers one question: what happens, in what order, between which parts?

The layout is simple. Each participant has a column. A participant may be a person, an app, a service or a database. A line runs down from each. Time flows down the page. Messages are drawn as arrows from one column to another, each lower than the last.

Reading from top to bottom, you follow the conversation.

Other diagrams show what the parts of a system are. A sequence diagram shows how they behave together. That makes it the best tool for explaining how a feature works, finding where a fault occurs or agreeing how two systems will talk.

Setting up the columns

Choose one scenario. A sequence diagram shows a single path through the system. "A customer checks their order status" is a scenario. Trying to show every possibility in one diagram makes it unreadable.

Start with the normal case, where everything works. Draw the failures separately, later.

List the participants. Who or what takes part in this scenario? Include the person who starts it. Leave out anything that plays no part.

Arrange them left to right in the order they first get involved. The person usually sits on the far left. What they use directly comes next, and the deeper parts follow. This keeps most arrows short.

Keep the number down. Four to six participants is comfortable. If you need more, you may be showing too much detail. Group several internal parts into one column and expand them in a second diagram.

Give each column a plain name that everyone on the team will recognise.

Drawing the messages

Take the scenario from the top. What is the first thing that happens? Draw an arrow from the sender to the receiver, and label it. Then the next, a little lower.

Label each message with what is asked or sent, in plain words. "Asks for order status" is clearer than a technical name.

Number the messages. In a discussion, "step four" is much easier to say than "the arrow from the service".

Show the replies as well as the requests. A request without a reply leaves the reader unsure whether anything came back. Many people draw replies with a dashed line.

Keep each message to one action. If a step hides several exchanges, either show them or note that they are covered elsewhere.

When the diagram is done, read it aloud from top to bottom, as a story. "The person asks. The app sends a request. The service looks it up." If the story has a gap, so does the diagram.

Using it, and the template

A sequence diagram is a discussion tool. Walk through it with the people who build each part. They will spot a step that is missing or in the wrong order.

Use it to ask what could go wrong. At each arrow, ask what happens if the message never arrives, or the reply is slow. Draw the important failures as their own diagrams.

Use it to find waste. Does the app ask the service for the same thing twice?

Keep the diagram with the feature it describes, and update it when the behaviour changes.

The Sequence diagram template on doodleboard has four columns: person, app, service and database. A line runs down from each. Six numbered messages sit between them. They read asks, sends request, looks up, returns data, replies and shows result.

Rename the columns for your own participants. Edit the six messages to match your scenario, and draw an arrow for each. Add more as needed.

Questions people ask

How is this different from a flowchart?

A flowchart shows the steps and decisions in a process. A sequence diagram shows messages passing between separate participants over time. Use a flowchart for logic, and a sequence diagram for conversations between parts.

How do I show something going wrong?

Draw it as a separate diagram. Copy the normal case, then change it from the point where the failure happens. Keeping each scenario on its own diagram makes both easier to read.

Can participants be people as well as systems?

Yes. A sequence diagram works for any exchange between parties. You can use one to show how a customer, a receptionist and a clinician pass information during a visit.

Templates for diagrams and mapping

Put it on a shared whiteboard

Start for free with one board and up to three people, or try every feature for 7 days.

Start for freeSee pricing