LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Graphs
    • Functional API
    • Pregel
    • Checkpointing
    • Storage
    • Caching
    • Types
    • Runtime
    • Config
    • Errors
    • Constants
    • Channels
    • Agents
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggraphpregelremoteRemoteGraphainvoke
    Method●Since v0.2

    ainvoke

    Copy
    ainvoke(
      self,
      input: dict[str, Any] | Any,
      config: RunnableConfig
    View source on GitHub
    |
    None
    =
    None
    ,
    *
    ,
    context
    :
    Context
    |
    None
    =
    None
    ,
    interrupt_before
    :
    All
    |
    Sequence
    [
    str
    ]
    |
    None
    =
    None
    ,
    interrupt_after
    :
    All
    |
    Sequence
    [
    str
    ]
    |
    None
    =
    None
    ,
    headers
    :
    dict
    [
    str
    ,
    str
    ]
    |
    None
    =
    None
    ,
    params
    :
    QueryParamTypes
    |
    None
    =
    None
    ,
    version
    :
    Literal
    [
    'v1'
    ,
    'v2'
    ]
    =
    'v1'
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ->
    dict
    [
    str
    ,
    Any
    ]
    |
    Any

    Parameters

    NameTypeDescription
    input*dict[str, Any] | Any

    Input to the graph.

    configRunnableConfig | None
    Default:None

    A RunnableConfig for graph invocation.

    interrupt_beforeAll | Sequence[str] | None
    Default:None
    interrupt_afterAll | Sequence[str] | None
    Default:None
    headersdict[str, str] | None
    Default:None
    versionLiteral['v1', 'v2']
    Default:'v1'
    **kwargsAny
    Default:{}

    Create a run, wait until it finishes and return the final state.

    Interrupt the graph before these nodes.

    Interrupt the graph after these nodes.

    Additional headers to pass to the request.

    The streaming format version. "v1" (default) returns the traditional format, "v2" returns StreamPart typed dicts.

    Additional params to pass to RemoteGraph.astream.