Diagrams guide

State diagrams: every state a thing can be in

A state diagram shows the states one thing moves through and what moves it on or back. Draw it to find the states and moves nobody had planned for.

Diagrams · · 4 minute read

The short answer

  • Follow one thing, such as an order, and list every state it can be in.
  • Label each arrow with what causes the move, not with the next state.
  • Ask of every state: what can move it back, and how does it end?

A finished example

This is what the State diagram template can look like once it is filled in. This one is for a holiday request at a small company.

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
On the board
Start
Asked for
With the manager
Approved
Dates clash
In the calendar
End
Rules
A clash goes back to the person
Only a manager can approve
Once taken, it cannot change
How the boxes are joined
Start, asked, leads to Asked for
Asked for, sent to the manager, leads to With the manager
With the manager, approved, leads to Approved
With the manager, dates clash, leads to Dates clash
Dates clash, new dates picked, leads to Asked for
Approved, added, leads to In the calendar
In the calendar, holiday taken, leads to End

What a state diagram is for

Many things in a business have a status. An order is placed, paid, sent or delivered. A holiday request is asked for, approved or turned down. A document is a draft, in review or published.

A state diagram shows every status one thing can have, and every way it can move from one to another. Each status is called a state. Each move is an arrow, labelled with what causes it.

It answers questions a flowchart does not. A flowchart follows the work: first this step, then that one. A state diagram follows the thing. At any moment, which state is it in, and what can happen to it next?

That makes it the right drawing when the trouble is with statuses. Orders stuck as "processing" for ever. A request approved twice. A page published without review. In each case, a move happened that nobody meant to allow, or a state had no way out.

Drawing the states makes those gaps plain. It is also the picture a developer needs before building anything with a status field.

Finding the states

Choose one thing to follow. One diagram, one thing. If you find yourself drawing the states of an order and of its payment together, split them into two diagrams.

List the states. Ask the people who do the work what they call each stage. Use their words. A state is a noun or a describing word, such as Draft, Paid or With the manager. It is something the thing is, not something a person does.

Check each state is real with one test. Can the thing sit in it for a while, and would somebody want to count how many are there? "Awaiting payment" passes. "Clicking the button" does not.

Keep the list short. Five to eight states is usual. If you have fifteen, some are probably details of one state, or belong to a different thing.

Then mark where it starts and where it ends. Everything begins somewhere, often when it is created. Most things have more than one ending. An order can end delivered, cancelled or refunded. Draw each ending, because the unhappy ones are the ones that get forgotten.

Drawing the moves between them

Now join the states with arrows. Each arrow is one move from one state to another.

Label every arrow with what causes the move. "Payment taken", "manager approves", "30 days pass". The label is an event or an action, not the name of the next state. An arrow with no label hides the most useful fact on the page.

Draw only the moves that are allowed. This is where the diagram earns its keep. If there is no arrow from Published back to Draft, then a published page cannot be quietly edited. Everyone can see that rule, and can argue with it.

Then test each state with three questions.

  • How does the thing get here? A state with no arrow in can never happen.
  • How does it leave? A state with no arrow out is an ending. If it is not meant to be one, something will get stuck there.
  • What can move it back? Rejections, cancellations and corrections are the moves most often missed.

Write any rule that does not fit on an arrow as a note beside the diagram. "Only a manager can approve" is a rule about who, and belongs in the Rules frame.

Using the template on doodleboard

The State diagram template on doodleboard follows a document from Draft to Published. It has a start, five states, an end and seven labelled moves. One state is Changes needed. A document goes there from In review, and back to Draft once it is edited. A Rules frame at the side holds a note that asks "What can move it back?"

Rename the states to your own. Double-click a shape to change its words. To add a state, copy one and drag a connector to it from the state before. Double-click a connector to label it.

If you prefer to type, you can write the diagram in Mermaid, a way of writing a diagram as plain text. Choose More, then Diagram from text (Mermaid). Start with the line stateDiagram-v2. Then write one move on each line, such as Draft --> Review: sent for review. Use [*] for the start and the end. The board draws a shape for each state and a labelled arrow for each move.

Walk a few real cases through the finished diagram with the people who handle them. Pick an ordinary one and two awkward ones. If a case needs a move that is not drawn, decide together whether to allow it.

To hand the result to a developer, select the shapes and choose Copy as code. They get the same diagram as a Mermaid flowchart to keep with the code.

Questions people ask

What is the difference between a state diagram and a flowchart?

A flowchart shows the steps of a process in order. A state diagram shows the statuses one thing can have and the moves allowed between them. Use a state diagram when the questions are about status.

How many states should a diagram have?

Usually five to eight. Fewer than four and a simple list may do. More than ten often means two things are mixed together, or that small details have been drawn as states of their own.

Can doodleboard draw a state diagram from text?

Yes. Choose More, then Diagram from text (Mermaid), and start with stateDiagram-v2. Each state becomes a shape and each move a labelled arrow. A state inside another state is drawn as its own shape.

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