MERMAID TEMPLATE

Order state machine: Mermaid Template Example

Show the states and transitions of an order lifecycle. This editable Mermaid state template gives you a practical starting point for documentation and review. Manage code and settings in one place, then export the result as SVG or PNG.

  • Live Mermaid preview
  • Automatic browser draft saving
  • Strict security rendering
  • Start instantly from templates

How to get started

  1. 1. Write Mermaid syntax in the Code panel.
  2. 2. Choose a diagram type and theme in Config.
  3. 3. Pan, zoom, and inspect the canvas.
  4. 4. Export as SVG or PNG, or sign in to save a project.

What you can adapt

  • Adapt the state to your product or team
  • Share a consistent example with collaborators
  • Keep the diagram source versionable and easy to revise

How to use this template

  1. 1. Replace the example labels with the entities in your state.
  2. 2. Remove details that do not help the current audience.
  3. 3. Add the relationships, states, dates, or values that matter to the decision.
  4. 4. Preview the result, then export or save the finished diagram.

Order state machine Mermaid code

Copy this starting point, replace the labels with your own domain, and preview the result in the editor.

stateDiagram-v2
  [*] --> Created
  Created --> Paid: Payment Success
  Created --> Cancelled: Cancel
  Paid --> Shipping: Fulfillment
  Shipping --> Delivered: Fulfillment Done
  Paid --> Refunded: Refund
  Delivered --> [*]
  Cancelled --> [*]
  Refunded --> [*]

Template FAQ

What is the Order state machine template for?

Show the states and transitions of an order lifecycle.

Can I edit this Mermaid template?

Yes. Open the template in Mermaid Studio, change the Mermaid source, and preview the result before exporting it.

State tips

Use [*] for lifecycle start and end.

Name transition events after the colon.

stateDiagram-v2
  [*] --> Created
  Created --> Paid: Payment Success
  Created --> Cancelled: Cancel
  Paid --> Shipping: Fulfillment
  Shipping --> Delivered: Fulfillment Done
  Paid --> Refunded: Refund
  Delivered --> [*]
  Cancelled --> [*]
  Refunded --> [*]

EXPLORE

Explore other diagrams

Flowchart

Visualize processes, decisions, and system flows with connected nodes.

Sequence

Map requests, responses, and asynchronous events between services.

Class

Design domain objects, properties, methods, inheritance, and relationships.

ER

Document database entities, fields, relationships, and cardinality.

State

Show how an object or workflow changes state in response to events.

Mindmap

Organize ideas and subtopics hierarchically around a central theme.

Gantt

Plan projects with tasks, milestones, dependencies, and dates.

C4

Explain software architecture from system context to detailed components.

User Journey

Describe user actions, sentiment, and experience across a journey.

Pie Chart

Compare parts of a whole with a simple Mermaid pie chart.

Quadrant

Position items across two axes to compare priorities or trade-offs.

Requirement

Connect requirements, elements, and verification relationships.

GitGraph

Explain branches, commits, merges, and release paths visually.

Timeline

Present milestones and events in chronological order.

ZenUML

Write concise sequence diagrams for object interactions and messages.

Sankey

Show how quantities flow between sources, stages, and destinations.

XY Chart

Plot values across two axes to show trends and comparisons.

Block

Arrange system blocks and connections to explain structure at a glance.

Packet

Document the fields and bit layout of a network packet.

Kanban

Organize work into visual columns such as backlog, active, and done.

Architecture

Show cloud services, infrastructure groups, and their connections.

Radar

Compare multiple options across a consistent set of dimensions.

Treemap

Show hierarchical values as nested areas for quick comparison.

Bar Chart

Compare discrete values across categories with vertical bars.

Line Chart

Show change over time or across ordered values with a line.

100%