Templates

Starters for engineers, product, and security—sequence diagrams, flowcharts, state, and class models.

Start faster with ready-made Mermaid diagram templates. Browse sequence diagram templates, flowcharts, state machines, and class diagrams — then open any template in the editor.

Basics

Basic sequence
Example
Two participants with a request and reply.
…

Request–reply sketch

Use template

Numbering

Autonumber
Example
Numbered steps for ordered messages.
…

Ordered messaging

Use template

Branching

Alt / Else
Example
Branch on success or failure.
…

Success and error paths

Use template

Loops

Loop
Example
Iterate until a condition is met.
…

Repeated polling or heartbeat

Use template

Optional blocks

Opt
Example
Optional fragment when something may happen.
…

Optional step or side effect

Use template

Activation

Activation
Example
Show active focus when a call is in progress.
…

Call stack / focus on a lifeline

Use template

API & backends

REST + database
Example
For backend devs documenting CRUD-style reads.
…

HTTP API hitting a database

Use template

Auth & identity

OAuth-style sign-in
Example
Simplified OAuth-style sign-in for app security discussions.
…

Authorization flow with an identity provider

Use template

Events & async

Async events / queue
Example
For integration and event-driven architectures.
…

Publish, deliver, consume

Use template

Flowcharts

Flowchart decision
Example
For PMs and ops mapping approvals.
…

Approvals and branching

Use template

State machines

State lifecycle
Example
For support and delivery workflows.
…

Ticket or task lifecycle

Use template

Class models

Class diagram
Example
For architects sketching a small domain model.
…

Orders and line items (domain sketch)

Use template