The compiled, executable graph. Produced by StateGraph$compile(). Do not
call GraphRunner$new() directly; use StateGraph$compile().
Value
The final WorkflowState object.
A coro generator yielding
list(node, state_snapshot, iteration).
State snapshot (named list) or NULL.
A data frame with columns agent, provider, model,
input_tokens, output_tokens, cost.
Character string.
Character string.
Invisibly, path.
Methods
Method new()
Initialise the runner. Called internally by StateGraph$compile().
Usage
GraphRunner$new(
nodes,
edges,
conditional_edges,
state_schema,
agents,
checkpointer,
termination,
output_channel = NULL
)Arguments
nodesNamed list of
list(fn = <function>).edgesList of
list(from, to).conditional_edgesList of
list(from, routing_fn, route_map).state_schemaA WorkflowState object (used as schema template).
agentsNamed list of
Agentobjects.checkpointerA Checkpointer or
NULL.terminationA
termination_conditionorNULL.output_channelCharacter or
NULL. Name of the channel returned byWorkflowState$output()after$invoke().
Method invoke()
Execute the graph and return the final state.
Arguments
initial_stateNamed list of initial channel overrides.
configNamed list of run-time configuration:
thread_id: character, identifies this run for checkpointing.max_iterations: integer, cycle guard (default 25).on_step:function(node_name, state)callback after each node.verbose: logical, print step info viacli(defaultFALSE).
Method visualize()
Render a visualization of the compiled graph.
Usage
GraphRunner$visualize(engine = c("dot", "visnetwork", "mermaid"))