All posts
April 26, 2026 5 min read

Export Flowcharts as Mermaid Syntax: Embed in GitHub, Notion, and Docs

Convert any flowchart into Mermaid syntax with a single API call. Embed live diagrams in GitHub READMEs, GitLab wikis, Notion pages, and Markdown docs — no images required.

mermaid github notion export markdown

If you've ever maintained a GitHub README, a GitLab wiki, or a Notion knowledge base, you know the pain: embedding a flowchart usually means uploading a static PNG. The diagram becomes outdated the moment your process changes, and you can't search the contents of an image.

Mermaid solves this — it's a markdown-flavored diagram syntax that GitHub, GitLab, Notion, Obsidian, and most modern docs platforms render natively. FreeFlowCharts now lets you export any flowchart as Mermaid syntax with a single API call.

Why Mermaid?

Mermaid is supported out-of-the-box by:

  • GitHub: (in READMEs, issues, PRs, and wikis since 2022)
  • GitLab: (in markdown content)
  • Notion: (via /code block with mermaid language)
  • Obsidian: (in any markdown note)
  • Azure DevOps: wikis
  • Bitbucket: Cloud
  • Discord: (via bots)
  • Most static site generators (Docusaurus, MkDocs, VitePress, etc.)
  • When you embed Mermaid syntax, the platform renders a real diagram — text-based, version-controlled, searchable, and always rendering crisply at any zoom level.

    How to export Mermaid from FreeFlowCharts

    Build your flowchart visually on the canvas, then call the export endpoint:

    GET https://freeflowcharts.app/api/export/mermaid?id=YOUR_SHARE_ID

    The response is plain text (text/plain) containing valid Mermaid syntax. Drop it into a fenced code block in your README:

    flowchart TD

    1(["Begin"])

    2["Validate input"]

    3{{"Valid?"}}

    4["Process"]

    5(["Done"])

    1 --> 2

    2 --> 3

    3 -->|"Yes"| 4

    3 -->|"No"| 5

    4 --> 5

    GitHub will render that as an interactive flowchart automatically. No image hosting, no broken links, no out-of-date screenshots.

    What Mermaid shapes does FreeFlowCharts use?

    The API maps every node type to the correct Mermaid shape:

  • Decision: → {{...}} (diamond)
  • Start: / End(["..."]) (pill / rounded)
  • Process: → ["..."] (rectangle)
  • Input/Output: → [/.../] (parallelogram)
  • Subprocess: → [[...]] (double-bordered)
  • Note: / TextLabel>"..."] (annotation)
  • Edges with labels render as -->|"label"| so the conditions on your decision branches stay intact.

    Bidirectional workflow: visual edit, text export

    The killer use case: edit visually, deploy as text.

  • Drag-and-drop your flowchart on the canvas
  • Iterate visually until it's right
  • Export as Mermaid via the API
  • Commit the Mermaid block to your repo
  • Update later? Edit visually again, re-export, push
  • You get the speed of a visual editor with the version-control benefits of plain text. Your diagrams live in Git history, reviewable in pull requests, diffable line-by-line.

    Example: Document a deployment pipeline

    Most engineering teams have a deployment process that's "documented somewhere." Make it real:

    flowchart TD

    push(["Push to main"])

    ci["Run CI tests"]

    pass{{"Tests pass?"}}

    build["Build Docker image"]

    staging["Deploy to staging"]

    smoke{{"Smoke tests pass?"}}

    prod["Deploy to production"]

    rollback["Rollback"]

    done(["Live"])

    push --> ci

    ci --> pass

    pass -->|"Yes"| build

    pass -->|"No"| rollback

    build --> staging

    staging --> smoke

    smoke -->|"Yes"| prod

    smoke -->|"No"| rollback

    prod --> done

    Paste that into your repo's README and every visitor — engineers, PMs, leadership — sees the same diagram. Update the canvas, re-export, push. Done.

    Free, no API key

    The Mermaid export endpoint is completely free, no API key needed, 30 requests per hour per IP. Use it from your CI/CD pipeline, your docs build, your deploy preview — anywhere.

    curl "https://freeflowcharts.app/api/export/mermaid?id=YOUR_ID" \
      -o flow.mmd

    Beyond Mermaid: also export to PNG, SVG, JSON

    Mermaid is great for inline rendering, but sometimes you need a static image (presentations, PDFs) or raw data (importing into another tool):

  • /api/export/png?id=... — 1600px PNG, contrast-aware
  • /api/export/svg?id=... — scalable SVG
  • /api/export/json?id=... — full structured data
  • All four formats from a single source flowchart. Build once, export anywhere.

    Try it now

    Create a flowchart on FreeFlowCharts, share it to get a shareId, then export:

    GET https://freeflowcharts.app/api/export/mermaid?id=YOUR_SHARE_ID

    Paste the result into your GitHub README, Notion page, or Obsidian vault — and watch your diagram come to life.

    Full API docs: freeflowcharts.app/api-docs