fork
Continues from checkpoint on the new thread GraphConfig.threadId, and leaves the thread that checkpoint comes from as it is. Use it to go back to an earlier step of a run and try something else from there: another answer of a person, a corrected state, a changed node.
val beforeReview = graph.history(config).first { it.nextNodes == listOf("review") }
val retry = graph.fork(beforeReview, config.copy(threadId = "ticket-42-retry")) { it.copy(approved = false) }The new thread starts with checkpoint, with the state that update returns, and runs its next nodes like resume does. It keeps the step numbers of the run it comes from.
Parameters
where to continue from, usually one of history.
the settings of the new run. Its thread must not have a checkpoint yet.
edits the state of checkpoint before execution continues.
Throws
if config has no checkpointer, checkpoint is the end of a run, or it names nodes that are not in this graph.
if the thread of config already has a checkpoint.