Sub topic 5
Reading and Drawing Flow Diagrams
This chapter covers the notation used in flow diagrams: which shape means what, how arrows work, and the conventions that make a diagram readable by someone who did not draw it. It assumes you know what a user flow and a task flow are, and that you can tell a screen from a step in a process. Later chapters use this notation to map the happy path, decision points, and error paths.
Why notation matters
A flow diagram is a shared document. A designer draws it, a developer reads it, and a product manager approves it. If each person reads the shapes differently, the diagram causes arguments instead of settling them.
Flowchart notation is a small set of agreed shapes and rules. You do not need many of them. Most UX flows use four shapes and one kind of connector.
The core shapes
| Shape | Mermaid syntax | Meaning | Example label |
|---|---|---|---|
| Rounded terminator (stadium) | `A([text])` | Where the flow starts or ends | Start: open app |
| Rectangle | `B[text]` | A step: something the user does or the system shows | Enter email |
| Diamond | `C{text}` | A decision: a question with two or more outcomes | Credentials valid? |
| Arrow | `A --> B` | The direction of movement from one element to the next |
Some teams add more shapes, such as a parallelogram for input or a document shape for an email. Add one only when your team has agreed on it and you can explain it in a legend. A shape the reader has to guess at is worse than a plain rectangle.
Terminators
Every flow needs a clearly marked start and at least one end. The start often names the entry point, for example "Start: tap Forgot password". An end names the outcome, for example "End: password updated".
A flow can have several ends. A sign-in flow might end at the home screen, at a locked-account screen, or at an exit when the user gives up. Draw each one as its own terminator so a reader can count the possible outcomes.
Steps
A rectangle holds one step. Write steps as short verb phrases ("Enter email", "Show error message"). Decide up front whether a step means a user action or a screen state, and keep to that choice. Mixing "Login screen" with "Enter password" in the same chain makes the diagram hard to read, because one is a place and the other is an action.
Decisions
A diamond holds a question. Every arrow leaving a diamond must carry a label that answers the question, such as "Yes" and "No". A diamond with one outgoing arrow is a mistake. A diamond with unlabeled arrows forces the reader to guess which branch is which.
Keep the question answerable. "Credentials valid?" has two clean answers. "What does the user do next?" does not belong in a diamond, because the answer depends on the user, not on a condition.
Reading a flow
To read a diagram, find the start terminator and follow the arrows. At each diamond, follow one labeled branch at a time. Repeat until you reach an end.
Here is the sign-in flow from the plan, with the notation applied.
Reading it step by step:
- The flow starts at "open app" and reaches the first diamond, "Has account?".
- The "Yes" branch leads to the form. The "No" branch leads to sign-up.
- After the form, "Credentials valid?" splits again. "Yes" reaches the end. "No" shows an error and loops back to the form.
- The sign-up branch has no decision, so it runs straight to the same end.
Two things are worth noticing. First, two branches merge at "End: home screen". A merge is fine: several arrows may enter one element. Second, the error branch loops. A loop is how a diagram shows retrying, and it should always return to the step where the user can fix the problem.
Direction and layout
Pick a direction and keep it. In Mermaid, flowchart TD runs top to bottom and flowchart LR runs left to right. Use top to bottom for flows with many decisions, because branches spread sideways. Use left to right for short, linear task flows that must fit a wide slide or document.
Layout conventions that help readers:
- Put the happy path in a straight line along the main axis, and push error branches to the side.
- Avoid crossing arrows. If lines cross, reorder the steps or split the diagram.
- Make every arrow point one way. Do not use double-headed arrows, because they hide which direction the user moves.
- Keep labels short. Long text in a shape usually means two steps are merged into one.
A task flow in the same notation
A task flow covers one task only. The password-reset example shows how the same shapes produce a narrower diagram.
Compare it with the sign-in flow. It has one decision, one loop, and one end. Nothing in it belongs to another task, such as signing in afterward. That limit is what makes it a task flow.
Checking a diagram for structural errors
Most notation mistakes can be found by rule. A diagram is structurally sound when:
- It has at least one start and at least one end.
- Every step other than an end has at least one outgoing arrow.
- Every diamond has two or more outgoing arrows, each labeled.
- Every element can be reached from the start.
A step with no way out that is not a declared end is a dead end. The user is stuck there. You can check this automatically if you store the flow as data. The code below keeps a flow as a map from each step to its next steps, and lists any step that leads nowhere and is not a declared end.
const flow = {
open_app: ["has_account"],
has_account: ["login_form", "signup_form"],
login_form: ["credentials_valid"],
signup_form: ["home"],
credentials_valid: ["home", "login_error"],
login_error: ["login_form"],
home: [],
};
const endpoints = new Set(["home"]);
const deadEnds = Object.entries(flow)
.filter(([step, next]) => next.length === 0 && !endpoints.has(step))
.map(([step]) => step);
console.log(deadEnds); // []The result is an empty array, so the flow has no dead ends. Try deleting "login_error" from the credentials_valid list and adding a new entry login_error: []. The check then reports ["login_error"], because the error step no longer returns the user to the form.
Common errors
- Unlabeled branches. A diamond whose arrows have no labels cannot be read. Label every outgoing arrow.
- Mixed levels of detail. One box says "Complete checkout" and the next says "Tap the blue button". Pick one level for the whole diagram.
- Missing end points. A flow that trails off without a terminator leaves readers unsure whether the task finished.
- Decisions that are really steps. "Choose a payment method" is an action by the user, so it is a rectangle. "Payment method saved?" is a condition, so it is a diamond.
- Error branches that dead-end. An error message with no arrow back leaves the user stranded. Route it to the step where they can correct the problem, or to a defined exit.
- Too many shapes. Extra symbols with no legend force readers to guess.
A short checklist before sharing
- Is there one clear start, and is every end labeled with an outcome?
- Do all rectangles use the same style of wording?
- Does every diamond ask a question, and does every branch have a label?
- Does every error path return somewhere or end somewhere?
- Can someone who did not draw the diagram trace the happy path in under a minute?
Exercise
A teammate sends you a diagram for "change email address". It has a start terminator, a rectangle "User chooses new email or cancels", a rectangle "Show error", and no end terminator. The "Show error" box has no outgoing arrow. Name three notation problems and say how to fix each.
Show answer
First, "User chooses new email or cancels" is a decision written as a step. Replace it with a diamond such as "Enter new email?" and label the branches, or split it into a step "Enter new email" and a separate cancel branch. Second, "Show error" is a dead end. Add an arrow from it back to the step where the user can correct the email, or to a defined exit. Third, there is no end terminator. Add at least one end, such as "End: email updated", and one for the cancel path, such as "End: no change".
Exercise
Redraw this description as a Mermaid flowchart using the correct shapes: the user starts at the checkout page, enters a promo code, and the system checks the code. If the code is valid, the discount is applied and the flow ends at the order summary. If it is not valid, an error is shown and the user returns to entering a code.
Show answer
One correct answer is: flowchart LR A([Start: checkout page]) --> B[Enter promo code] B --> C{Code valid?} C -- Yes --> D[Apply discount] D --> E([End: order summary]) C -- No --> F[Show error] F --> B The start and end use rounded terminators, the system check is a labeled diamond, and the error loops back to the entry step.