Templates

Mermaid templates you can ship today

Every template is real, render-tested Mermaid source. Open one in the studio to edit it, run compatibility checks against GitHub, GitLab, or markdown targets, and export SVG or PNG.

flowchartArchitecture

Microservices architecture

A service map with an API gateway, core services, and shared infrastructure. A solid starting point for README architecture sections.

sequenceDiagramProcess

User login sequence

A login flow with token issuance and a failure branch. Useful for documenting auth endpoints and session behavior.

stateDiagram-v2Process

Order state machine

Lifecycle states for an e-commerce order, from creation to fulfillment, with cancellation and refund paths.

erDiagramData

E-commerce data model

A compact entity-relationship model for customers, orders, and products with keys and attributes.

flowchartOperations

CI/CD pipeline

A build-test-deploy pipeline with a manual approval gate before production. Fits well in engineering handbooks.

timelineOperations

Incident response timeline

A postmortem-ready timeline from alert to resolution. Note: the timeline type needs a recent Mermaid version on the target platform.

ganttPlanning

Sprint plan

A two-week sprint plan with backend, frontend, and release tracks. Swap in your own dates and tasks.

classDiagramArchitecture

Payment module classes

An interface with two provider implementations and a processing service. A template for documenting module boundaries.

journeyProduct

User onboarding journey

A scored user journey from signup to first value. Good for aligning product and growth teams on friction points.

gitGraphOperations

Git release flow

A trunk-plus-develop branching model with a feature branch, a tagged release, and a hotfix commit.

flowchartArchitecture

Request throttling logic

Rate-limiting decision logic with quota checks and retry hints. A template for API behavior documentation.

sequenceDiagramProcess

OAuth2 authorization code flow

The full authorization code exchange between user, client app, authorization server, and resource API.

sequenceDiagramProcess

Payment checkout sequence

An order confirmation flow through a payment provider, with authorized and declined branches driven by webhooks.

sequenceDiagramArchitecture

Cache-aside pattern

The classic read-through caching interaction: cache hit, cache miss, database load, and repopulation with a TTL.

sequenceDiagramArchitecture

WebSocket connection lifecycle

Upgrade handshake, heartbeat loop, and clean shutdown — a template for documenting realtime connections.

flowchartData

Data ETL pipeline

Sources, extract-transform-load stages, and warehouse destinations grouped in subgraphs.

flowchartArchitecture

API error handling flow

Retry-with-backoff logic for external API calls, separating retryable errors from hard failures.

flowchartProduct

Signup activation funnel

From landing page to activated user, with drop-off points and the email verification loop made explicit.

flowchartOperations

Webhook delivery with retries

Event delivery with exponential backoff, retry limits, and a dead-letter path — API platform documentation staple.

flowchartData

ML training pipeline

Data preparation, training, evaluation gate, registry, deployment, and the drift-monitoring feedback loop.

stateDiagram-v2Operations

Job queue lifecycle

Background job states with retry backoff and a dead-letter terminal state.

stateDiagram-v2Process

Document approval workflow

Draft, review, changes-requested loop, approval, publication, and archive states for content workflows.

erDiagramData

Blog / CMS data model

Authors, posts, comments, and a many-to-many tag relationship — the canonical content schema.

erDiagramData

SaaS multi-tenant data model

Organizations, users, subscriptions, plans, and projects — the backbone schema of a B2B SaaS.

classDiagramArchitecture

Observer pattern

Subject, observer interface, and two concrete observers — a template for documenting design patterns.

ganttPlanning

Product launch plan

Marketing, product, and launch tracks converging on a ship milestone with a hotfix window.

pieProduct

Traffic sources breakdown

A simple share-of-total pie for reports and dashboards. Swap in your own channels and numbers.

journeyProduct

Support ticket journey

A scored journey across customer, agent, and engineer touchpoints — useful for spotting support friction.

timelinePlanning

Product milestones timeline

Quarter-by-quarter milestones from prototype to 1.0. Note: timeline needs a recent Mermaid version on the target platform.

mindmapPlanning

Project scope mindmap

A quick scope-mapping mindmap for kickoffs. Note: mindmap needs a recent Mermaid version on the target platform.

flowchartOperations

Incident escalation flow

Alert triage with severity-based escalation paths, paging rules, and the postmortem loop.

quadrantChartPlanning

Feature prioritization quadrant

An effort-vs-impact quadrant for roadmap discussions. Note: quadrantChart needs a recent Mermaid version on the target platform.

flowchartOperations

Kubernetes deployment flow

Image build through rollout, with a health-check gate and automatic rollback on failed readiness probes.

flowchartOperations

Terraform apply workflow

Plan-review-apply with a drift-detection loop, the standard safety gate for infrastructure-as-code changes.

stateDiagram-v2Operations

Feature flag rollout

Off, canary, partial, and full rollout states with a kill-switch rollback path from any active state.

flowchartProduct

A/B test decision flow

From hypothesis to ship/kill decision, with the statistical significance gate made explicit.

flowchartOperations

Database migration runbook

Backup, migrate, verify, and a rollback branch for production schema changes.

flowchartArchitecture

Event sourcing + CQRS

Command side writes events; a separate read-model projection serves queries.

flowchartArchitecture

Multi-region failover

Active-passive regions with a health-check-driven DNS failover path.

flowchartArchitecture

Message queue architecture

Producers, a broker with topic partitions, competing consumers, and a dead-letter queue.

flowchartProduct

Chatbot conversation flow

Intent detection with a fallback to human handoff when confidence is low.

stateDiagram-v2Product

Subscription billing lifecycle

Trial, active, dunning, and cancellation states for a recurring billing subscription.

flowchartProcess

Code review workflow

Draft PR through merge, with the changes-requested loop and CI gate made explicit.

flowchartOperations

Disaster recovery runbook

Declare-assess-restore sequence with RTO/RPO checkpoints for a major outage.

sequenceDiagramArchitecture

GraphQL resolver sequence

A query resolving through a batched data loader to avoid the N+1 query problem.

flowchartOperations

Cron job scheduler

Scheduled trigger through execution with a lock to prevent overlapping runs.

journeyProduct

Trial-to-paid conversion journey

A scored journey through a free trial, tracking sentiment at each conversion touchpoint.

flowchartArchitecture

Load-balanced network topology

A standard three-tier topology: load balancer, app tier, and a primary/replica database pair.

sequenceDiagramProcess

Mobile biometric authentication

Face/fingerprint unlock backed by a securely stored refresh token, with a password fallback.

flowchartOperations

Deployment rollback decision

Post-deploy monitoring window with clear thresholds for when to auto-rollback versus page a human.

flowchartPlanning

Reporting structure

A simple manager/report tree template for team pages and onboarding docs.

erDiagramData

Data warehouse star schema

A fact table surrounded by dimension tables -- the standard star schema for analytics.

flowchartOperations

GDPR data request flow

Identity verification through fulfillment for access, export, and deletion requests.

sequenceDiagramProcess

Push notification delivery

Server-triggered push through a platform gateway (APNs/FCM) down to the device.