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.
Eventless (always) transitions
Eventless transitions (also known as always transitions) are transitions without events. These transitions are always taken.
Delayed (after) transitions
Delayed transitions (also known as after transitions) are transitions that only happen after a specified interval of time.
Self transitions
A self-transition (also known as a self-event) starts and ends in the same state. Self-transitions can be used to restart a 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.”