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.
Microservices architecture
A service map with an API gateway, core services, and shared infrastructure. A solid starting point for README architecture sections.
User login sequence
A login flow with token issuance and a failure branch. Useful for documenting auth endpoints and session behavior.
Order state machine
Lifecycle states for an e-commerce order, from creation to fulfillment, with cancellation and refund paths.
E-commerce data model
A compact entity-relationship model for customers, orders, and products with keys and attributes.
CI/CD pipeline
A build-test-deploy pipeline with a manual approval gate before production. Fits well in engineering handbooks.
Incident response timeline
A postmortem-ready timeline from alert to resolution. Note: the timeline type needs a recent Mermaid version on the target platform.
Sprint plan
A two-week sprint plan with backend, frontend, and release tracks. Swap in your own dates and tasks.
Payment module classes
An interface with two provider implementations and a processing service. A template for documenting module boundaries.
User onboarding journey
A scored user journey from signup to first value. Good for aligning product and growth teams on friction points.
Git release flow
A trunk-plus-develop branching model with a feature branch, a tagged release, and a hotfix commit.
Request throttling logic
Rate-limiting decision logic with quota checks and retry hints. A template for API behavior documentation.
OAuth2 authorization code flow
The full authorization code exchange between user, client app, authorization server, and resource API.
Payment checkout sequence
An order confirmation flow through a payment provider, with authorized and declined branches driven by webhooks.
Cache-aside pattern
The classic read-through caching interaction: cache hit, cache miss, database load, and repopulation with a TTL.
WebSocket connection lifecycle
Upgrade handshake, heartbeat loop, and clean shutdown — a template for documenting realtime connections.
Data ETL pipeline
Sources, extract-transform-load stages, and warehouse destinations grouped in subgraphs.
API error handling flow
Retry-with-backoff logic for external API calls, separating retryable errors from hard failures.
Signup activation funnel
From landing page to activated user, with drop-off points and the email verification loop made explicit.
Webhook delivery with retries
Event delivery with exponential backoff, retry limits, and a dead-letter path — API platform documentation staple.
ML training pipeline
Data preparation, training, evaluation gate, registry, deployment, and the drift-monitoring feedback loop.
Job queue lifecycle
Background job states with retry backoff and a dead-letter terminal state.
Document approval workflow
Draft, review, changes-requested loop, approval, publication, and archive states for content workflows.
Blog / CMS data model
Authors, posts, comments, and a many-to-many tag relationship — the canonical content schema.
SaaS multi-tenant data model
Organizations, users, subscriptions, plans, and projects — the backbone schema of a B2B SaaS.
Observer pattern
Subject, observer interface, and two concrete observers — a template for documenting design patterns.
Product launch plan
Marketing, product, and launch tracks converging on a ship milestone with a hotfix window.
Traffic sources breakdown
A simple share-of-total pie for reports and dashboards. Swap in your own channels and numbers.
Support ticket journey
A scored journey across customer, agent, and engineer touchpoints — useful for spotting support friction.
Product milestones timeline
Quarter-by-quarter milestones from prototype to 1.0. Note: timeline needs a recent Mermaid version on the target platform.
Project scope mindmap
A quick scope-mapping mindmap for kickoffs. Note: mindmap needs a recent Mermaid version on the target platform.
Incident escalation flow
Alert triage with severity-based escalation paths, paging rules, and the postmortem loop.
Feature prioritization quadrant
An effort-vs-impact quadrant for roadmap discussions. Note: quadrantChart needs a recent Mermaid version on the target platform.
Kubernetes deployment flow
Image build through rollout, with a health-check gate and automatic rollback on failed readiness probes.
Terraform apply workflow
Plan-review-apply with a drift-detection loop, the standard safety gate for infrastructure-as-code changes.
Feature flag rollout
Off, canary, partial, and full rollout states with a kill-switch rollback path from any active state.
A/B test decision flow
From hypothesis to ship/kill decision, with the statistical significance gate made explicit.
Database migration runbook
Backup, migrate, verify, and a rollback branch for production schema changes.
Event sourcing + CQRS
Command side writes events; a separate read-model projection serves queries.
Multi-region failover
Active-passive regions with a health-check-driven DNS failover path.
Message queue architecture
Producers, a broker with topic partitions, competing consumers, and a dead-letter queue.
Chatbot conversation flow
Intent detection with a fallback to human handoff when confidence is low.
Subscription billing lifecycle
Trial, active, dunning, and cancellation states for a recurring billing subscription.
Code review workflow
Draft PR through merge, with the changes-requested loop and CI gate made explicit.
Disaster recovery runbook
Declare-assess-restore sequence with RTO/RPO checkpoints for a major outage.
GraphQL resolver sequence
A query resolving through a batched data loader to avoid the N+1 query problem.
Cron job scheduler
Scheduled trigger through execution with a lock to prevent overlapping runs.
Trial-to-paid conversion journey
A scored journey through a free trial, tracking sentiment at each conversion touchpoint.
Load-balanced network topology
A standard three-tier topology: load balancer, app tier, and a primary/replica database pair.
Mobile biometric authentication
Face/fingerprint unlock backed by a securely stored refresh token, with a password fallback.
Deployment rollback decision
Post-deploy monitoring window with clear thresholds for when to auto-rollback versus page a human.
Reporting structure
A simple manager/report tree template for team pages and onboarding docs.
Data warehouse star schema
A fact table surrounded by dimension tables -- the standard star schema for analytics.
GDPR data request flow
Identity verification through fulfillment for access, export, and deletion requests.
Push notification delivery
Server-triggered push through a platform gateway (APNs/FCM) down to the device.