Skip to content

State lifecycle

SHEET
B7
REV
flowfig 0.8.4
DATE
2026-10-05

This page is the output of npx flowfig docs marks. Your agent reads the same text.

Read this topic for a state lifecycle or a state machine.

  • Draw one box per state. Draw one edge per transition, and label the edge with its event in plain words.
  • Give each path through the states its own step.
  • Mark the first state with "mark": "start" on the box. The figure draws a filled dot before the box.
  • Mark each final state with "mark": "end" on the box. The figure draws a ringed dot after the box.
  • In a Mermaid stateDiagram, only a top-level [*] --> A makes A the start state. A [*] inside a nested state gives no start mark. B --> [*] makes B an end state.
  • Use the box tone for the state color. Use green for a success state, red for a failed state and gray for an idle state.