pub enum Transition {
Await(Vec<Effect>),
Spawn {
specs: Vec<NodeSpec>,
join: JoinPolicy,
},
Goto {
target: NodeId,
carry: Value,
},
Suspend {
reason: SuspendReason,
},
Done(Value),
}Expand description
What a step wants to happen next.
Deliberately NOT #[non_exhaustive], for the same reason as
crate::node::NodeOutcome, its other half: the driver decides control
flow off this value, and a wildcard arm there is a silent wrong answer.
Adding a variant should break every consumer — each one has to decide
what the new transition means for it.
Variants§
Await(Vec<Effect>)
Perform these effects — concurrently — then poll again with the results in the same order.
Spawn
Create and run these nodes now, then poll again with their outputs.
The map half of map-reduce, where the fan-out width is only known at
runtime. LangGraph calls this Send.
Fields
join: JoinPolicyHow their outputs recombine, and what one failure does to the rest.
Goto
Hand control to another node, with a value. The current step is done.
A handoff, in the sense the OpenAI Agents SDK uses: delegation that transfers control rather than nesting a call.
Fields
Suspend
Stop the run and persist it. Resuming replays the journal up to here and continues with whatever came back.
Fields
reason: SuspendReasonWhat the run is waiting for, and what would restart it.
Done(Value)
Finished, with this output.
Implementations§
Source§impl Transition
impl Transition
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Is this the step’s last word? Done and Goto are — nothing polls
the step again this run. The other three expect another poll: after
the effects, after the spawned nodes, or after a resume.