Class StateGraph<State, Update, N>

Type Parameters

  • State extends object | unknown
  • Update extends object | unknown = Partial<State>
  • N extends string = typeof START

Hierarchy (view full)

Constructors

Properties

branches: Record<string, Record<string, Branch<State, N>>>
channels: Record<string, BaseChannel<unknown, unknown, unknown>>
compiled: boolean
edges: Set<["__start__" | N, "__end__" | N]>
entryPoint?: string
nodes: Record<N, Runnable<State, Update, RunnableConfig>>
supportMultipleEdges: boolean
waitingEdges: Set<[N[], N]>

Accessors

  • get allEdges(): Set<[string, string]>
  • Returns Set<[string, string]>

Methods

  • Parameters

    • source: BranchOptions<State, N>

    Returns this

  • Parameters

    • source: N
    • path: ((input, config?) => string | string[] | Promise<string> | Promise<string[]>)
        • (input, config?): string | string[] | Promise<string> | Promise<string[]>
        • Parameters

          • input: State
          • Optional config: RunnableConfig

          Returns string | string[] | Promise<string> | Promise<string[]>

    • Optional pathMap: N[] | Record<string, "__end__" | N>

    Returns this

  • Parameters

    • startKey: "__start__" | N | N[]
    • endKey: "__end__" | N

    Returns this

  • Parameters

    • key: N

    Returns this

    Deprecated

    use addEdge(START, key) instead

  • Parameters

    • key: N

    Returns this

    Deprecated

    use addEdge(key, END) instead

  • Parameters

    • Optional interrupt: string[]

    Returns void