pub struct TaskNode {
pub id: NodeId,
pub goal: String,
pub depends_on: Vec<NodeId>,
pub tool_allowlist: Vec<String>,
pub kind: TaskNodeKind,
pub role: Option<RoleId>,
pub status: NodeStatus,
pub output: Option<String>,
pub compacted_output: Option<String>,
pub error: Option<String>,
}Expand description
A single work unit in a TaskGraph.
Each node is either a TaskNodeKind::Leaf (executed as an isolated
AgentLoop worker) or a TaskNodeKind::Team (a sub-team with its own
nested TaskGraph that the executor recurses into).
Leaf node context is assembled from:
- Its own
goalas the system instruction. - Compacted outputs from each
depends_onpredecessor as additional context messages. - No orchestrator planning history (strict isolation between nodes).
Fields§
§id: NodeIdShort, unique identifier for this node within its graph.
goal: StringOne-sentence goal that the worker agent is asked to achieve.
depends_on: Vec<NodeId>Nodes whose outputs this node depends on.
Must form a DAG when combined with all other nodes’ depends_on lists.
tool_allowlist: Vec<String>Tool names the worker is permitted to call.
An empty list means no tools are available to this worker. Names must match entries in the runtime tool catalog.
kind: TaskNodeKindWhether this node is a leaf worker or a sub-team.
Defaults to TaskNodeKind::Leaf when absent in serialised JSON so
that all Phase A–F plans deserialise without modification.
role: Option<RoleId>Optional specialist role assigned to this node.
When Some, the executor will inject the role’s
system_prompt_fragment before the node’s goal. None means the
node runs as a generic worker.
status: NodeStatusCurrent lifecycle state (mutated by the executor as the node runs).
output: Option<String>The worker’s full output text (set after reaching NodeStatus::Done).
compacted_output: Option<String>Compressed summary of output passed to downstream nodes as context.
Set by the compaction step immediately after execution finishes.
error: Option<String>Error message if the node reached NodeStatus::Failed.