npmstart.
Exercises
中文

Draw a release flow with a recovery branch in Mermaid

Express checks, release and failure recovery as text you can copy and version.

Mermaid Live EditorReviewed 2026-11-10Original example exercise

What you will make

A flowchart with success and failure paths, plus its .mmd source.

Before you begin
The browser editor. Installation is optional.

Menu names can change. The upstream demo is externally operated and may differ from the pinned local version.

Begin with a diagram that renders

Paste the downloaded .mmd text or the code below into the editor and confirm that the preview renders before changing it. This is a diagram exercise, not a deployment script. Its arrows do not run tests, upload files or roll back a service. Keep that distinction visible when using the drawing in team documentation.

Example source
flowchart TD
  A[Prepare a change] --> B{Checks pass?}
  B -->|Yes| C[Release]
  B -->|No| D[Fix the change]
  D --> B
  C --> E{Verify result}
  E -->|Healthy| F[Record version]
  E -->|Failure| G[Restore known version]

Separate identifiers from labels

A, B and C are identifiers; the bracketed phrases are labels. Stable, unique identifiers let you change visible wording without rewriting every connection. Use a decision shape for a question and rectangles for actions. Prefer short labels, and quote complex label text when punctuation could otherwise be interpreted as syntax.

Give failure a practical destination

A useful release diagram includes what happens when checks fail and when a deployed version is unhealthy. Add notes explaining who makes the decision and what counts as healthy: a key route responds, logs look reasonable and a core action works. Avoid a vague check node with no owner or observable condition; it hides an operational gap behind a tidy shape.

Choose a readable direction

TD makes the flow run downward; LR changes it to a left-to-right layout. Try both and choose the one that fits the reading surface. Split a large process into before-release and after-release diagrams before introducing complicated grouping. Mermaid derives layout from relationships. Choose Excalidraw instead when free positioning matters more than text-based maintenance.

Maintain the source alongside the image

Save the .mmd text and export SVG or PNG when the destination needs an image. Generate later revisions from source instead of annotating the image alone. If a documentation platform renders Mermaid directly, check its supported version. The template uses basic nodes and links, but it should still be rendered in the final environment because the live demo and pinned local version can differ.

Check your result

  • Check failures return to editing and unhealthy releases have a recovery target.
  • Conditional links have understandable labels.
  • Source is retained and renders in the final document environment.

The preview disappears after editing?

Undo the last change and inspect identifiers, brackets and quotes before rewriting the entire diagram.

Sources and further reading

This exercise is original. Consult these primary sources for project behavior and syntax.