Optional
options: {Optional
options: {Optional
contextSchema: C | AnnotationRoot<ToStateDefinition<C>>Optional
contextSchema: C | AnnotationRoot<ToStateDefinition<C>>Optional
contextSchema: C | AnnotationRoot<ToStateDefinition<C>>Optional
entryOptional
options: StateGraphAddNodeOptions<string>Optional
options: StateGraphAddNodeOptions<string>Optional
interrupt: string[]Protected
warn
A graph whose nodes communicate by reading and writing to a shared state. Each node takes a defined
State
as input and returns aPartial<State>
.Each state key can optionally be annotated with a reducer function that will be used to aggregate the values of that key received from multiple nodes. The signature of a reducer function is (left: Value, right: UpdateValue) => Value.
See Annotation for more on defining state.
After adding nodes and edges to your graph, you must call
.compile()
on it before you can use it.Example