Optionaloptions: {Optionaloptions: {OptionalcontextSchema: C | AnnotationRoot<ToStateDefinition<C>>OptionalcontextSchema: C | AnnotationRoot<ToStateDefinition<C>>OptionalcontextSchema: C | AnnotationRoot<ToStateDefinition<C>>OptionalentryOptionaloptions: StateGraphAddNodeOptions<string>Optionaloptions: StateGraphAddNodeOptions<string>Optional__namedParameters: {Optionalinterrupt: string[]Protectedwarn
A graph whose nodes communicate by reading and writing to a shared state. Each node takes a defined
Stateas 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