Flowcharts: boxes and arrows
A flowchart shows steps and decisions. It is the Flowchart example in the editor.
The first line sets the direction. flowchart LR draws
from left to right, and flowchart TD from top to
bottom. Prefer TD for anything more than about
six steps. Confluence pages are narrow, so tall diagrams
read better than wide ones.
flowchart TD
A[Leave request] --> B{Manager approves?}
B -->|Yes| C[Book in HR system]
B -->|No| D[Tell the employee]Its picture is under How Mermaid text works.
Shapes
| Write | To draw |
|---|---|
A[Rectangle] | Standard box |
A(Rounded) | Rounded box |
A([Stadium]) | Pill shape |
A{Decision} | Diamond — a yes/no branch |
A((Circle)) | Circle |
A[(Database)] | Cylinder |
A[[Subroutine]] | Box with side bars |
Arrows
| Write | To draw |
|---|---|
A --> B | Solid arrow |
A --- B | Line, no arrowhead |
A -.-> B | Dotted arrow |
A ==> B | Thick arrow |
A -->|label| B | Arrow with a label |
To draw a labeled box around some steps, put them between
subgraph and end. The
process recipe shows how.
A group can set its own direction with a line such as
direction TB inside it. Since version 2.9, that line
is followed only while no arrow joins a box inside the group to a
box outside it. When it is not followed, a note under the text,
Subgraph direction not followed, says what to
write instead. See
A flowchart whose
subgraphs lost their direction.
Do not name a box end. Mermaid reads
it as the end of a group. Use done or
End instead.
Step by step: Draw a process and Draw an org chart. Every flowchart option is in the reference.