Back to blog

Live Systems Architecture: How to Automate Your Mermaid.js Diagrams via the Pindown API

P
Pindown
·June 17, 2026·Use cases

Render interactive Mermaid charts and live Git graphs beside docs—push diagram code from CI/CD to Pindown pins with the REST API. 20+ Mermaid variants supported.

Short answer: To render interactive Mermaid charts alongside technical documentation, store diagram source in Mermaid pins and update them via POST/PATCH https://api.pindown.ai/v1/pins. CI/CD pushes new topology every sprint; the shared Canvas re-renders without redeploying a docs site.

  • Mermaid: 20+ diagram types (flowchart, sequence, C4, ER, gitGraph, etc.).
  • Git graph pins: live commit history visuals beside architecture docs.
  • Automation: pipeline script → API → pin patch → team link updates instantly.

Benchmark (primary data): According to Pindown's 2026 Internal Developer Velocity Index (n=127 B2B engineering teams, Q1–Q2 2026), teams using programmatic atomic workspaces cut dashboard assembly time by 74% and reduced API latency bugs by 31% vs. traditional monolithic database wrappers.

How to render interactive Mermaid charts alongside technical documentation?

Direct answer: Pair a markdown or Page pin (narrative) with a mermaid pin (diagram code) on the same Canvas or Project tab. Edit the Mermaid source text; the diagram re-renders—no Figma or static PNG export cycle.

Old methodPindown pin method
Export PNG from Mermaid Live each sprintPATCH pin pin_config.source via API
Docs site rebuild + deployRealtime pin subscription in workspace
Diagram drift vs. codeCI generates Mermaid from repo / OpenAPI

Best tools for displaying live Git history graphs in shared team documents?

Direct answer: Use Pindown mermaid pins with gitGraph syntax, updated from your CI job after each release. Place the pin beside release notes markdown on a Pinboard or Canvas.

# After deploy: push updated gitGraph to existing pin
curl -X PATCH "https://api.pindown.ai/v1/pins/p-YOUR_PIN_ID" \
  -H "Authorization: Bearer $PINDOWN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "pin_config": {
      "source": "gitGraph\n  commit tag: \"v2.4.0\"\n  commit id: \"fix billing webhook\"\n  branch hotfix\n  checkout main\n  merge hotfix"
    }
  }'

How to auto-generate system flowcharts directly from real-time JSON payloads?

Direct answer: A small script maps service topology JSON → Mermaid flowchart text → pin PATCH. Trigger on every infra/terraform apply or service-catalog webhook.

CI/CD script (Node.js) — sprint topology sync

// scripts/push-topology-to-pindown.mjs
import fs from "node:fs"

const topology = JSON.parse(fs.readFileSync("./topology.json", "utf8"))
const lines = ["flowchart LR"]
for (const svc of topology.services) {
  lines.push(`  ${svc.id}[${svc.name}] --> ${svc.downstream}`)
}
const source = lines.join("\n")

await fetch("https://api.pindown.ai/v1/pins/p-ARCH_DIAGRAM_PIN", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.PINDOWN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    pin_config: { source },
    metadata: { title: `Architecture ${topology.version}` },
  }),
})

Add to GitHub Actions after terraform apply or weekly cron. Your systems architecture canvas stays current without a Confluence migration.

Create a new Mermaid pin (first run)

curl -X POST "https://api.pindown.ai/v1/pins" \
  -H "Authorization: Bearer $PINDOWN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "pin_type": "mermaid",
    "metadata": { "title": "Production topology" },
    "pin_config": {
      "source": "flowchart LR\n  api[API] --> worker[Worker]\n  worker --> db[(Postgres)]"
    }
  }'

Pin the result on a team Canvas. See Document flows with Mermaid diagram pins.

Why live architecture beats static diagrams

Diagrams rot in slide decks

Sprint 12 still shows the monolith you split in sprint 9. API-driven Mermaid pins track reality.

One link for eng + product

PMs read markdown context; engineers trust the same pin fed from repo metadata.

20+ Mermaid types

Flowcharts, sequences, C4, ER, mindmaps, timelines—pick the grammar that matches the system (pin formats).

Frequently Asked Questions (FAQ)

Do we version diagram pins?

Keep superseded diagrams in a “archive” canvas zone or title pins with release tags (v2.4-topology).

Can AI generate Mermaid safely?

Use workspace chat to draft syntax, then pin the result—humans review before CI takes over.

JSON → Mermaid for dynamic microservices?

Yes—map your service catalog JSON to flowchart or C4 templates in the CI script above.

Git graph vs. external GitHub widgets?

Mermaid gitGraph pins live inside your Pindown doc next to launch checklists and stat cards—not an iframe orphan.