pub enum NodeKind {
Spawn,
Loop {
max_iters: usize,
},
Classify {
branches: Vec<ClassifyBranch>,
},
Tournament {
entrants: Vec<RuntimeTask>,
},
Reduce {
reducer: String,
},
}Expand description
Control-flow kind of a workflow node. Spawn (the default) runs the node’s agent once.
Loop re-runs it until a stop condition; Classify routes to one branch by its result;
Tournament generates entrants and pairwise-judges them — all dynamic control-flow types.
Additive: existing specs omit kind → Spawn. (No Eq: a Tournament’s entrant tasks carry
arbitrary JSON metadata, which is PartialEq but not Eq.)
Variants§
Spawn
Run the node’s agent once (classic spawn node).
Loop
Re-run the node’s agent up to max_iters times; an iteration reporting
loop_continue=Some(false) stops early (v2 “until done”).
Classify
Run the node’s agent once as a classifier; its classify_branch result selects one branch
to run and prunes the others. Branch nodes must depends_on this classify node.
Fields
branches: Vec<ClassifyBranch>Tournament
A controller node (spawns no agent of its own): it generates entrants candidates in
parallel, then runs a single-elimination bracket of pairwise judges (reusing
super::tournament::Tournament) until one survivor remains. The winner’s id lands in the
node’s tournament_winner result; dependents start only after the bracket resolves.
Fields
entrants: Vec<RuntimeTask>Reduce
G2 deterministic compute: a host-compute node that runs no LLM agent. The kernel schedules
it like a Spawn (deps / ready / completion) but stamps its spawn descriptor with reducer
- the dependency agent ids, and the SDK routes it to a registered pure function over those
dependencies’ outputs (dedupe / filter / merge / early-exit) instead of the model. This is the
“ordinary code between stages” of the code-orchestration model, expressed as a DAG node — no
agent burned, fully deterministic.
reducernames the SDK-side function.