All diagram types Open editor

merIDK / Diagram types / Flowchart

Mermaid flowchart: example and syntax

Flowcharts are the most used Mermaid diagram. You describe each step as a node and connect the steps with arrows, and Mermaid lays them out for you. Use them for processes, decision trees, user flows and algorithms.

Open this example in the editor

Example code

---
title: Order fulfilment
---
flowchart LR
    A([Order placed]) --> B{In stock?}
    B -- Yes --> C[Pick & pack]
    B -- No --> D[Backorder]
    D --> E[(Supplier DB)]
    E -.-> C
    C ==> F[/Ship/]
    F --> G((Delivered))
    classDef done fill:#d1fae5,stroke:#059669,color:#064e3b
    class G done

Result

---
title: Order fulfilment
---
flowchart LR
    A([Order placed]) --> B{In stock?}
    B -- Yes --> C[Pick & pack]
    B -- No --> D[Backorder]
    D --> E[(Supplier DB)]
    E -.-> C
    C ==> F[/Ship/]
    F --> G((Delivered))
    classDef done fill:#d1fae5,stroke:#059669,color:#064e3b
    class G done

Syntax quick reference

How to use it

  1. Open the example in the editor, or paste your own Mermaid code.
  2. Edit the code on the left. The preview updates as you type, and errors point to the line.
  3. Export SVG or PNG, copy a Markdown block for GitHub or Notion, or copy a share link.

More diagram types