Stately core concepts
Learn about states, transitions, events, actions, and actors in the Stately Studio.
A state describes the machine’s status or mode, which could be as simple as Paused and Playing. A state machine can only be in one state at a time.
When a state machine starts, it enters the initial state first. A machine can only have one top-level initial state; if there were multiple initial states, the machine wouldn’t know where to start!
When a machine reaches the final state, it can no longer receive any events, and anything running inside it is canceled and cleaned up. The box with a surrounding border icon represents the final state.
States can contain more states, also known as child states. These child states are only active when the parent state is active.
A parallel state is a state separated into multiple regions of child states, where each region is active simultaneously.
A history state returns the parent state to its most recently active child state. The box with an H inside represents the history state.
Transitions and events
Actions and actors