FAQ
What are state machines?
State machines describe systems in terms of states and transitions between those states. Transitions are triggered by events, and they define how a system moves from one state to another.
A running state machine has a current state. When an event is dispatched into the machine, the machine checks the transitions that are valid from that state and, if one matches, moves to the next state.
State machines are a kind of language. The states and transitions are the syntax; the rules for executing them are the semantics. Different state machine formalisms define different semantics. SCXML defines its execution semantics in the W3C standard.
What are statecharts?
Statecharts extend state machines with hierarchy and concurrency. They are useful when behavior has nested modes, parallel regions, or event-driven control flow that is hard to keep clear in ordinary conditional code.
Hierarchy lets a model group related states under a parent state. That can remove duplication because common behavior can be described once on the parent instead of repeated on every child. Concurrency lets a model describe independent regions that are active at the same time.
What is SCXML?
SCXML is a W3C standard for representing statecharts in XML. The standard defines both a document format and execution semantics for interpreting those documents.
SCXML documents can describe states, transitions, events, executable actions, data, history states, parallel states, and communication with external systems. It is useful when application behavior should be explicit, inspectable, and portable across tools.
What are SCXML and statecharts used for?
SCXML and statecharts can be used wherever software has well-defined modes and event-driven behavior. Common domains include user interfaces, embedded systems, workflow orchestration, interaction design, telephony, customer-service flows, and application coordination logic.
They are especially helpful when a system's behavior is easier to understand as a set of states and transitions than as scattered conditional logic.
Why is SCXML relevant in the age of AI?
SCXML gives AI systems a smaller semantic target than general-purpose code. Instead of asking an AI to generate a large amount of custom workflow code, you can ask it to generate a specialized language whose job is only to describe states, events, transitions, and actions.
That narrower target leaves less room for error. The result is usually smaller, simpler, and easier for humans to inspect than spaghetti control flow spread across application code. It is also easier to instrument: an SCXML runtime can capture state, events, transitions, and timing as structured telemetry, which makes debugging and AI-assisted trace analysis more practical.
What is SCION?
SCION is an open source JavaScript implementation and tooling ecosystem for SCXML. It powers the examples and visualizations on this site.
What is this website?
This is an open source informational site about SCXML and hierarchical state machines. It is not affiliated with W3C. The examples and tutorial material are powered by SCION.
How should I get started?
Start with the tutorial, then look at the examples and tooling pages as more resources are added.
If you are already familiar with state machines, the tutorial is still a useful path through SCXML-specific concepts such as compound states, conditional transitions, and history states.