invoke

suspend fun invoke(input: State, config: GraphConfig<State> = GraphConfig()): GraphResult<State>

Runs the graph from START with input until it completes or reaches an interrupt.

A call always starts a new run: if config has a checkpointer, any earlier checkpoint of the thread is replaced by one that holds input, before the first node runs. Use resume to continue a paused run, or to retry one that failed.

Throws

if config names interrupt nodes that are not in the graph, or if a node calls interrupt and config has no checkpointer.

if a node throws, or takes longer than its time limit, and has no try left.

if the reducer throws.

if the condition of a conditional edge throws.

if a conditional edge returns an invalid target.