Skip to main content

Module node

Module node 

Source
Expand description

The node contract.

A node is an immutable, pre-validated object built once from its NodeDoc by a factory in the Registry. At run time the engine calls Node::run with an owned NodeContext; the node reads inputs from the context’s pool snapshot and returns a NodeOutcome. Nodes never mutate shared state directly: outputs and variable writes are returned and committed by the engine.

Structs§

ConfigError
Error raised when a node’s configuration is invalid (at graph build time).
NoTimerClock
A clock without timers: sleeps complete immediately and timeouts are not enforced. Useful for tests and for executors without a timer facility.
NodeContext
Everything a node may use while running. Cheap to clone.
NodeError
Error produced by a node.
NodeOutput
Successful node result.
PauseRequest
A request from a node to pause the run (e.g. waiting for a human).
Registry
Maps node kinds (llm, if-else, …) to factories.
Resume
Data given to a node that previously paused.
Services
Type-indexed registry of host services (LLM providers, HTTP clients, tool runtimes, file resolvers…). Nodes look services up at run time, so node factories stay pure and graphs can be built without any integration.
SubgraphRequest
Request to execute a container’s body once.
TokioClock
Tokio-backed clock.

Enums§

NodeOutcome
What a node run produced.
NodeRole
How the scheduler treats a node.
SubgraphResult
Outcome of a container body run.

Traits§

Clock
Time source used by the engine and nodes (retries, timeouts, elapsed time).
Node
An executable node.
Subgraph
Executes a container’s child scope. Provided to container nodes by the engine.

Functions§

default_clock
The default clock for this build: TokioClock with the tokio feature, else NoTimerClock.
merge_writes
Append new writes to acc, keeping only the latest write per exact selector.
parse_config
Helper for factories: parse the node config into T, mapping errors to ConfigError.

Type Aliases§

DescriptorFn
Builds a node kind’s catalog descriptor.
EventSink
Callback receiving events from nodes.
NodeFactory
Builds a node from its document.
NodeResult
Result type of Node::run.