LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    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

    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    Pythonlanggraph-sdk_asyncrunsRunsClient
    Classā—Since v0.3

    RunsClient

    Copy
    RunsClient(
        self,
        http: HttpClient,
    )

    Constructors

    Attributes

    Methods

    View source on GitHub
    constructor
    __init__
    NameType
    httpHttpClient
    attribute
    http: http
    method
    stream

    Create a run and stream the results.

    method
    create

    Create a background run.

    method
    create_batch

    Create a batch of stateless background runs.

    method
    wait

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

    method
    list

    List runs.

    method
    get

    Get a run.

    method
    cancel

    Get a run.

    method
    cancel_many

    Cancel one or more runs.

    Can cancel runs by thread ID and run IDs, or by status filter.

    method
    join

    Block until a run is done. Returns the final state of the thread.

    method
    join_stream

    Stream output from a run in real-time, until the run is done. Output is not buffered, so any output produced before this call will not be received here.

    method
    delete

    Delete a run.

    Client for managing runs in LangGraph.

    A run is a single assistant invocation with optional input, config, context, and metadata. This client manages runs, which can be stateful (on threads) or stateless.

    Example
    client = get_client(url="http://localhost:2024")
    run = await client.runs.create(assistant_id="asst_123", thread_id="thread_456", input={"query": "Hello"})