Diagram type

Mermaid User Journey Syntax & Examples

Reference for Mermaid user journey syntax — journey keyword, title, sections, and task lines with satisfaction scores and actors. Copy-paste examples for onboarding, checkout, and support flows.

Syntax reference, layout guidance, and ready-to-open examples for this diagram type.

At a glance

A syntax reference for Mermaid's `journey` grammar — read this when you need the exact format for task lines, satisfaction scores, or actor lists, then try the result in the editor.

What is a Mermaid user journeyBasic syntax — journey + title + sectionsTask format — name, score, actorsReading the satisfaction curveWhen to pick a different chartCommon patterns & gotchas
Rendered proof
User journey for a new-user onboarding flow.
Theme · Memphis
Open this diagram in editor
USER JOURNEY New user onboarding Discover Sign up First success Land on homepage 5/7 Compare plans 4/7 Create account 3/7 Verify email 2/7 Import first diagram 6/7 Share with team 7/7 New userTeammate
View Mermaid sourcePlain-text diagram syntax — copy or edit directly.
diagram.mmd
1journey
2 title New user onboarding
3 section Discover
4 Land on homepage: 5: New user
5 Compare plans: 4: New user
6 section Sign up
7 Create account: 3: New user
8 Verify email: 2: New user
9 section First success
10 Import first diagram: 6: New user
11 Share with team: 7: New user, Teammate

What is a Mermaid user journey

A user journey diagram maps the steps a person takes through a process and scores how each step feels. Each task carries a satisfaction score from 1 (frustrating) to 7 (delightful), and the scores trace a curve across the diagram — the emotional shape of the experience at a glance. It is the right diagram when the question is where-does-the-experience-hurt: onboarding flows, checkout funnels, support interactions, first-run experiences. Use a flowchart instead when the process branches on decisions, and a sequence diagram when the content is messages between systems rather than a person's experience. Journeys are the only Mermaid type that encodes sentiment, which is exactly what makes them useful in UX reviews.

Basic syntax — journey + title + sections

Every Mermaid user journey starts with the `journey` keyword. Add a chart title with `title <Text>` on the next line. Then declare sections with `section <Phase Name>` — each section groups the tasks of one phase (Discover, Sign up, First use). Under each section, write one task per line. Sections render as labelled bands across the top, and the tasks inside them keep their source order left to right.

  • `journey` — diagram type keyword (always first)
  • `title <Text>` — chart title (appears at the top)
  • `section <Phase Name>` — groups the tasks of one phase
  • One task per line inside each section

Task format — name, score, actors

A task line has three colon-separated parts: `Task name: <score>: <actors>`. The name is free text and becomes the task label. The score is an integer from 1 to 7 — higher is happier — and drives both the face icon on the task and the height of the satisfaction curve. The actors are a comma-separated list of who performs the task (`Me`, `Support agent`, `Cat`); they are optional, and the same actor names are collected into a legend. A typical line reads `Find the signup form: 3: New user`. Keep scores honest — the value of the diagram is the dips, and a journey where everything scores 6 tells the reader nothing.

  • `Task name: 5: Me` — three parts separated by colons
  • Score is an integer 1–7; higher is happier
  • Actors are comma-separated and optional

Reading the satisfaction curve

The score does double duty. Each task shows a face icon — happy for high scores, neutral for the middle, sad for low ones — and the tasks themselves sit higher or lower so the whole diagram reads as a curve. A healthy onboarding journey starts mid, dips at the first hard step, and climbs to a high finish. A journey that sags in the middle and never recovers is a redesign argument drawn in one picture. When you present one of these, narrate the lowest point first: that is the step your audience will ask about.

When to pick a different chart

Journeys are deliberately linear — no branches, no parallel paths, no loops. When the process genuinely branches ("if payment fails, retry"), use a flowchart and keep the journey for the happy path. When the content is which-system-calls-which, use a sequence diagram. When the story is what-happened-when rather than how-it-felt, use a timeline. A useful rule: if you cannot honestly attach a satisfaction score to a step, that step probably belongs in a different diagram type.

Common patterns & gotchas

Three patterns cover most real journeys. New-user onboarding (Discover / Sign up / First success) is the most common — three sections, scores dipping at the friction step. Checkout funnel (Browse / Decide / Pay / Confirm) is the second — usually exposes a low score around payment details. Support interaction (Hit problem / Find help / Resolve) is the third — starts low by definition and should end high. The most common syntax gotcha: the score must be a bare number — `Make tea: high: Me` is invalid and the line is skipped with a warning, so write `Make tea: 5: Me`. Second gotcha: a task line needs at least the name and the score; actors can be omitted but the score cannot.

  • Score must be a number 1–7 — words like `high` make the line invalid
  • Actors are optional; the score is not
  • Branching flows belong in a flowchart — journeys are linear by design
FAQ

Mermaid User Journey Syntax & Examples — frequently asked questions

How do I write a task line in a Mermaid user journey?

Three colon-separated parts: `Task name: <score>: <actors>`. The name is free text, the score is an integer from 1 to 7 (higher is happier), and the actors are a comma-separated list of who performs the task. Example: `Verify email: 2: New user`. The actors part is optional — `Verify email: 2` is also valid — but the score is required, and it must be a bare number.

What do the satisfaction scores mean?

The score rates how the step feels for the person doing it, from 1 (frustrating) to 7 (delightful). It drives the face icon on each task and the height of the satisfaction curve across the diagram. Scores are most useful when they vary — the dips are the insight. Teams typically calibrate with anchors: 1–2 means users complain or abandon, 3–4 means it works but feels like effort, 5–7 means smooth to delightful.

Can a journey show branching paths?

No — user journeys are linear by design. Every task follows the previous one, with no conditions or parallel paths. If the flow genuinely branches (payment failures, alternate signup methods), draw the happy path as the journey and use a flowchart for the branching logic. Trying to force branches into a journey usually means the diagram wants to be a flowchart with the emotional data dropped, or two separate journeys.

How is a user journey different from a timeline?

A timeline orders events by when they happened; a journey orders tasks by the sequence a person experiences them and adds a satisfaction score to each. Timelines answer "what happened when"; journeys answer "how did each step feel." If your content has dates and no sentiment, use a timeline. If it has a person moving through steps and you care where the experience hurts, use a journey.

Why is one of my journey tasks missing from the render?

Almost always a malformed score. The second colon-separated part must be a bare integer — `Make tea: high: Me` or a task line with no score at all is skipped, and the editor shows a skipped-line warning pointing at it. Check that every task line follows `name: number: actors` and that the number is between 1 and 7.