State machines
you can serialize.

States, guards, and mutations as plain JSON you can store, diff, and ship. The mark on this page is one of them, running live.

Click a state to move the machine.

machine.json
State graph
TOGGLETOGGLEoffCURRENTon
CURRENT STATEoff
CONTEXT{}
EVENTS

One event. Two states. Try TOGGLE.

Event payload optional
TRANSITION LOG
THE DEFINITION

States, transitions, guards, and mutations are plain data. JSONata expressions handle dynamic values.

THE RUNTIME

Validate, compile, then interpret. This playground runs the same TypeScript engine in your browser.

Inspect the implementation ↗