When to use it
Support centre handbooks, after-sales policies, and ticket-handling documentation for e-commerce or SaaS teams. The customer raises an issue, the support desk logs a ticket and either resolves it first-line or escalates to technical support, then replies; the customer confirms. If the customer is not satisfied, the case escalates to the quality team for root-cause analysis and improvement before going back to technical support. Four lanes make it clear who is handling the case and where it is waiting.
Making it yours
- A lane is a
subgraph Role … end. Rename "Technical support" to "Second line" or "Repair centre"; add "Logistics" or "Finance (refunds)" as extra blocks. - Put your real triage rule into the diamond:
C{First line can resolve?}can becomeC{Refund involved?}or similar. - To show service levels (for example "reply within 24 hours"), write them into the node text
D[Reply within 24 hours]or list them in a table in the text. - The customer confirmation is a diamond because it branches; if confirmation always closes the ticket in your process, make it a rectangle and delete the "No" branch.
- To run the flow left to right, change
TBon the first line toLR.
Mermaid code
flowchart TB
subgraph Customer
A[Raise issue / complaint]
G{Issue resolved?}
end
subgraph Support desk
B[Log ticket] --> C{First line can resolve?}
D[Reply to customer]
H[Close ticket]
end
subgraph Technical support
E[Investigate and fix]
end
subgraph Quality team
F[Root cause analysis and improvement]
end
A --> B
C -- Yes --> D
C -- No --> E --> D
D --> G
G -- Yes --> H
G -- No --> F --> EAsk an AI for one with this structure
Send the prompt below to ChatGPT or Claude, then paste the whole reply into the editor; the code inside is detected automatically.
Draw a customer service swimlane diagram in Mermaid flowchart TB syntax. Use one subgraph per lane for [Customer, Support desk, Technical support, Quality team]; put each role's steps inside its own subgraph and write the edges that cross roles after all the subgraphs. The process: the customer raises an issue → the support desk logs a ticket → decide whether first line can resolve it; if yes reply to the customer, if not technical support investigates and fixes, then the desk replies → the customer confirms whether it is resolved; if yes the ticket is closed, if not it escalates to the quality team for root cause analysis and improvement and goes back to technical support. Use diamond nodes for decisions and label the branches on the edges. Output only the mermaid code block.
FAQ
- The diagram has a loop (quality team → technical support → reply → customer). Can Mermaid draw that?
Yes. Flowchart edges may point back to earlier nodes and the layout engine draws them as return arrows. Too many loops get messy, so keep one main loop per diagram and describe further escalation paths in the text.
- How do I separate "question" and "complaint" as two entry points?
Put two start nodes in the customer lane,
A1[Question]andA2[Complaint], both connected toB[Log ticket]. If complaints take a different route (for example a supervisor must reply), add a diamond{Complaint?}in the support lane to split them.- Can I show handling times?
A Mermaid flowchart has no time axis; times can only go into node text or edge labels (for example
D -- within 24 h --> G). To show the stages against time, a Gantt chart is the better tool.
More in this category
Updated 2026-09-22