State

A state diagram represents a system's lifecycle as a set of named states and directed transitions between them.

Fields

FieldRequiredTypeDescription
kindyes"state"Must be exactly "state"
titlenostringRendered above the diagram
statesyesarray of StateAt least 2 states required
transitionsnoarray of TransitionMay be empty (unconnected states)

State fields

FieldRequiredTypeDescription
labelyesstringDisplay text. Must be unique unless id is set.
idnostringStable identifier for from/to references. Falls back to label if omitted.
rolenostring"initial" or "terminal". At most one "initial"; multiple "terminal" allowed.

Transition fields

FieldRequiredTypeDescription
fromyesstringid (preferred) or label of source state
toyesstringid (preferred) or label of target state
triggernostringEvent or condition causing this transition
typenostring"normal" (default) or "exception" — semantic type

Self-loop transitions (from = to) are valid. Transition without trigger is valid (unconditional).

Cross-reference resolution

If a state has an id, use id in from/to. If it has no id, use label. Unknown references → validation error. Duplicate labels without id → validation error.

Example

주문 처리 상태 주문 접수 결제 완료 결제 실패 대기 처리 중 완료 취소됨