Example
journey
title User creates a diagram
section Discovery
Find MermanDraw: 3: User
Visit landing page: 4: User
section Creating
Open editor: 5: User
Paste Mermaid code: 4: User
See live preview: 5: User
Adjust theme: 4: User
Tweak layout: 3: User
section Sharing
Click Share: 5: User
Copy link: 5: User
Send to team: 5: User Syntax
Structure
journey
title Checkout flow
section Browse
Search catalogue: 4: Customer
Compare products: 3: Customer
section Buy
Enter payment: 2: Customer
Confirm order: 5: Customer, System Each task line is Task name: score: Actor1, Actor2. Scores are integers 1 (worst) to 5 (best). Sections group tasks into labelled columns.
Multiple actors
journey
title Support ticket
section Report
Open ticket: 3: User
Triage: 4: Agent
section Resolve
Fix and reply: 5: Agent, Engineer
Confirm fixed: 4: User Each actor gets a colour in the legend; a task with several actors shows all of them.
Try this snippet →Common mistakes
These are the parse errors that come up most, including in code written by ChatGPT and Claude. Paste any failing diagram into the editor and it marks the offending line.
-
A score outside 1 to 5, or a decimal score.
Fix: Round to an integer in range. Mermaid does not validate, but out-of-range scores draw outside the chart.
-
A task line without an actor:
Search: 4.Fix: Add at least one actor after the second colon. The legend is built from actors, so a missing one leaves a blank.
-
Colons inside the task name (
Step 1: search: 4: User).Fix: The parser splits on colons, so avoid them in task text. Use a dash or parentheses instead.
Real-world examples
Complete, copy-ready user journeys for common situations. Each one opens in the editor with a click.
-
Employee Onboarding User Journey Diagram
A Mermaid user journey for a new hire across three phases, before day one, first week, and first month, with a score and an owner for each onboarding task.
-
User Onboarding Journey Diagram for a SaaS Product
A Mermaid user journey from first blog visit to a daily habit: discover, sign up, first value, habit, with a 1 to 5 score per step showing where new users drop.
FAQ
Can I draw branches in a user journey?
No. The journey diagram is strictly linear. Describe each path as its own section, or use a flowchart when the branching itself matters.
Where does the journey diagram fit in a design document?
Right after the problem statement, as a before picture. Follow it with the proposed flow (often a flowchart) and, if you have metrics, an XY chart of the measured improvement.