State lifecycle
- SHEET
- B7
- REV
- flowfig 0.8.4
- SOURCE
- src/guide.ts
- 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[*] --> Amakes A the start state. A[*]inside a nested state gives no start mark.B --> [*]makes B an end state. - Use the box
tonefor the state color. Usegreenfor a success state,redfor a failed state andgrayfor an idle state.