---
title: "Mermaid sequence diagrams in Confluence: syntax and examples"
description: "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."
date: 2026-11-28
lang: en
canonical: https://goingstellar.ro/methods/mermaid-sequence-diagram-confluence/
author: Going Stellar
publisher: GOING STELLAR S.R.L.
topic: Mermaid / Confluence
license: CC BY 4.0
alternate_ro: https://goingstellar.ro/ro/metode/diagrama-de-secventa-mermaid-in-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.*

> Mermaid · Confluence · 2026-11-28 · https://goingstellar.ro/methods/mermaid-sequence-diagram-confluence/

## Key points

- Write `sequenceDiagram`, declare participants in the order you want them, then one message per line.
- `-&gt;&gt;` is a solid arrow, `--&gt;&gt;` dotted; `+`/`-` on arrows draw activations.
- `loop`, `alt`/`else`, `opt`, `par`, `critical` and `break` blocks all close with `end`.
- Write a semicolon in message text as `#59;`, and never name a participant `end`.
- Confluence Cloud does not render Mermaid natively: export an image, or use an app that keeps the diagram as text.

## 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.

```mermaid
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:

```mermaid
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.

```mermaid
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.

```mermaid
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.

```mermaid
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:

```mermaid
sequenceDiagram
    A->>B: price; tax
```

Write it as the entity `#59;` and it renders as a semicolon:

```mermaid
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.

```mermaid
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 `&lt;&lt;-&gt;&gt;` arrow is recent). If an example fails in another tool, check that tool's Mermaid version.

## Sources

1. [Mermaid documentation: Sequence diagrams](https://mermaid.js.org/syntax/sequenceDiagram.html)
2. [YouTube: Mermaid Studio for Confluence (demo video)](https://www.youtube.com/watch?v=RpKp9BnRaa0)
3. [Atlassian Marketplace: Mermaid Studio for Confluence](https://marketplace.atlassian.com/apps/1011179388/mermaid-studio-ai-mermaid-diagram-editor)

## 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 -&gt;&gt; and --&gt;&gt; in Mermaid?

`-&gt;&gt;` draws a solid line with an arrowhead, `--&gt;&gt;` 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

**Cite this as:** Going Stellar (2026). *Mermaid sequence diagrams in Confluence: syntax and examples*. GOING STELLAR S.R.L.. https://goingstellar.ro/methods/mermaid-sequence-diagram-confluence/

```bibtex
@misc{goingstellar2026mermaid,
  title  = {Mermaid sequence diagrams in Confluence: syntax and examples},
  author = {{Going Stellar}},
  year   = {2026},
  url    = {https://goingstellar.ro/methods/mermaid-sequence-diagram-confluence/},
  note   = {2026-11-28}
}
```

Licence. Free to quote with attribution.

## Also available

- This page as HTML: https://goingstellar.ro/methods/mermaid-sequence-diagram-confluence/
- Same article in Romanian: https://goingstellar.ro/ro/metode/diagrama-de-secventa-mermaid-in-confluence/
