The
Transition interface in Solmyr’s workflow system corresponds to XState’s transition definitions. While our API is simplified for AI workflow use cases, it maps to XState’s underlying transition logic.Transition interface represents a transition between states in the workflow’s state machine. It defines the conditions and actions for moving from one state to another.
Structure
Properties
Provides guidance for the AI on when and how to trigger this transition. This description helps the AI understand the context for choosing this transition.
The target state to transition to.
Optional guard condition that must be true for the transition to occur. References a guard defined in the workflow’s
guards property.type: The name of the guard to check.
Actions to be performed during the transition. Must be an object with a
type property.type: The type of action to perform.
Usage Example
Using Transitions in States
Transitions are typically used within theon property of a State object to define how the state responds to different events: