Transitions and events
Learn about all the possible transitions and events in Stately Studio’s editor.
Transitions and events
A machine moves from state to state through transitions. Transitions are caused by events; when an event happens, the machine transitions to the next state.
Guards
A guard is a condition that the machine checks when it goes through an event. If the condition is true, the machine follows the transition to the next state. If the condition is false, the machine follows the rest of the conditions to the next state. Any transition can be a guarded transition.
Eventless (always) transitions
Eventless transitions are transitions without events. These transitions are always taken after any transition in their state is enabled.
Delayed (after) transitions
Delayed transitions are transitions that only happen after a specified interval of time. If another event happens before the end of the timer, the transition doesn’t complete. Delayed transitions are handy if you need to build timeouts and intervals into your application logic.
Self transitions
A self-transition starts and ends in the same state.
State done events
A state done event transitions from a parent state when one of its child states reaches its final state. State done events are labeled “onDone.”
Invoke done events
An invoke done event transitions from a state once its invocation has been completed. An invoke done event is labeled “done:” followed by the invocation’s ID.
Invoke error events
An invoke error event transitions from a state when an error occurs in its invocation. An invoke error event is labeled “error:” followed by the invocation’s ID.