Mermaid · Confluence
Mermaid sequence diagrams in Confluence: syntax and examples
A Mermaid sequence diagram lists participants and the messages between them, one per line, top to bottom. Confluence Cloud does not render it on its own, so the diagram goes on the page as an exported image or through an app that keeps it as text. Every example here renders as written in Mermaid 12.3.
Updated
The smallest useful sequence diagram
Start with sequenceDiagram, declare the participants, then write one message per line in the order they happen. participant B as Browser gives a short id for the lines below and a readable name for the box.
sequenceDiagram
participant B as Browser
participant A as API
B->>A: POST /orders
A-->>B: 201 Created
Declaring participants is optional: Mermaid creates one the first time a name appears in a message. Declare them anyway when the order of the boxes matters, because they are drawn in the order they are declared.
Arrow types
The characters between two participants choose how the message is drawn:
sequenceDiagram
A->>B: solid arrow
A-->>B: dotted arrow
A->B: solid line
A-->B: dotted line
A-xB: cross
A-)B: async
A<<->>B: both ways
A common convention is a solid arrow for a request and a dotted arrow for its reply, -x for a message that fails or is lost, and -) for one that is sent without waiting for an answer. Mermaid does not enforce any meaning; pick one and keep it across your pages.
Actors, activations and notes
actor draws a person instead of a box. A + after the arrow activates the receiver (a bar on its lifeline while it works) and a - on the reply ends it. Notes go to one side of a participant or over several.
sequenceDiagram
actor U as User
participant A as API
U->>+A: GET /status
A-->>-U: 200 OK
Note right of A: one participant
Note over U,A: spans both
Loops, branches and parallel work
Blocks wrap a group of messages and each ends with end: loop for repetition, alt/else for branches, opt for something that may not happen, par/and for parallel steps, critical/option for a step with fallbacks, and break for an exit from the flow.
sequenceDiagram
participant C as Client
participant S as Server
loop Every 30 s
C->>S: poll
end
alt order paid
S-->>C: shipped
else unpaid
S-->>C: reminder
end
opt has coupon
C->>S: apply coupon
end
par to warehouse
S->>S: reserve stock
and to billing
S->>S: issue invoice
end
critical payment
S->>S: charge card
option declined
S-->>C: payment failed
end
break stock is zero
S-->>C: out of stock
end
Numbering, groups and highlights
autonumber numbers every message, which makes a diagram easy to discuss in a review ("step 3 is wrong"). box draws a labelled frame around several participants, for example the services you own. rect shades a stretch of messages.
sequenceDiagram
autonumber
box Our system
participant A as API
participant D as Database
end
participant P as Payment provider
rect rgb(230, 240, 255)
A->>D: write order
A->>P: charge
end
P-->>A: approved
Two characters that break sequence diagrams
A semicolon in message text. Mermaid reads ; as the end of a statement, so this fails with a parse error:
sequenceDiagram
A->>B: price; tax
Write it as the entity #59; and it renders as a semicolon:
sequenceDiagram
A->>B: price#59; tax
A participant called end. As in flowcharts, lowercase end closes a block, so it cannot be a participant id; this fails too. The word is fine inside message text.
sequenceDiagram
participant end
A->>end: hi
Getting it onto a Confluence page
Confluence Cloud has no built-in Mermaid renderer: paste this code into a page and you get the code. There are two ways to get a diagram.
Export an image. Paste the code into our free online Mermaid editor, download SVG or PNG and upload it to the page. It is free and needs nothing installed, but the image no longer carries its source: keep the Mermaid code on the page as well, or the next change means starting over.
Keep it as text, with an app. Mermaid Studio for Confluence, our app, adds a macro with a live editor and preview; it renders sequence diagrams along with the other common types, and the diagram stays editable on the page. It is free for up to 10 users. The paid tier adds AI that writes the Mermaid from a plain-English description, and PNG/SVG export. The demo video on YouTube shows the macro on a page.
Limits
Every example was rendered with Mermaid 12.3.0, the version our editor uses, on 28 November 2026. Older Mermaid versions may not support every arrow (the two-way <<->> arrow is recent). If an example fails in another tool, check that tool's Mermaid version.
Sources
Questions and answers
Can Confluence Cloud show a Mermaid sequence diagram?
Not natively. Pasted Mermaid code stays code. Upload an exported image, or use a Marketplace app that renders Mermaid on the page.
What is the difference between ->> and -->> in Mermaid?
->> draws a solid line with an arrowhead, -->> a dotted one. Many teams use solid for requests and dotted for replies.
How do I number the messages in a Mermaid sequence diagram?
Add autonumber on the line after sequenceDiagram.
Why does my sequence diagram fail when the message has a semicolon?
Mermaid reads ; as the end of a statement. Write #59; instead.
How to cite this
Going Stellar (2026). Mermaid sequence diagrams in Confluence: syntax and examples. GOING STELLAR S.R.L..
https://goingstellar.ro/methods/mermaid-sequence-diagram-confluence/