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(), val effects: Map<String, String> = 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(), effects: Map<String, String> = emptyMap())

Properties

Link copied to clipboard

the results of the effects that finished in the step of nextNodes, so that they do not run again when CompiledGraph.resume runs that step again. The keys name the node and the effect; the values are the results as the serializer of each effect wrote them. Empty until an effect of that step finishes. In a history, the checkpoint before a step that finished keeps the effects of that step. A Checkpointer has to store it with the rest.

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, or when a subgraph among them failed after some of its steps. 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 or that failed after some of its steps, so that CompiledGraph.resume continues inside it. A Checkpointer has to store it with the rest.