Checkpoint

data class Checkpoint<State>(val state: State, val nextNodes: List<String>, val step: Int = 0, val interruptedBefore: Boolean = false, val subgraphs: Map<String, SubgraphPosition> = emptyMap())

A saved point in a graph run.

Constructors

Link copied to clipboard
constructor(state: State, nextNodes: List<String>, step: Int = 0, interruptedBefore: Boolean = false, subgraphs: Map<String, SubgraphPosition> = emptyMap())

Properties

Link copied to clipboard

true when the run paused before nextNodes because of GraphConfig.interruptBefore, or because one of them called interrupt when it ran. CompiledGraph.resume then runs those nodes without pausing before them again. A checkpoint saved for any other reason is false, so resuming it still pauses before a node listed in GraphConfig.interruptBefore.

Link copied to clipboard

true when the run reached END and there is nothing left to resume.

Link copied to clipboard

the nodes that run when the thread is resumed. Empty when the run completed.

Link copied to clipboard

the graph state after the last executed step, or the input of the run when no step has finished yet.

Link copied to clipboard
val step: Int

the number of steps the thread has executed so far. 0 for the checkpoint that is saved when a run starts.

Link copied to clipboard

where the run stands inside the subgraphs among nextNodes, by the name of their node. It has an entry for a subgraph that the run paused in, so that CompiledGraph.resume continues inside it. A Checkpointer has to store it with the rest.