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_asynccron
    Module●Since v0.3

    cron

    Async client for managing recurrent runs (cron jobs) in LangGraph.

    Attributes

    Classes

    Type Aliases

    View source on GitHub
    attribute
    All: Literal['*']
    attribute
    CronSelectField: Literal['cron_id', 'assistant_id', 'thread_id', 'end_time', 'schedule', 'timezone', 'created_at', 'updated_at', 'user_id', 'payload', 'next_run_date', 'metadata', 'now', 'on_run_completed', 'enabled']
    attribute
    CronSortBy: Literal['cron_id', 'assistant_id', 'thread_id', 'created_at', 'updated_at', 'next_run_date', 'end_time']
    attribute
    Durability: Literal['sync', 'async', 'exit']
    attribute
    OnCompletionBehavior: Literal['delete', 'keep']
    attribute
    SortOrder: Literal['asc', 'desc']
    attribute
    StreamMode: Literal['values', 'messages', 'updates', 'events', 'tasks', 'checkpoints', 'debug', 'custom', 'messages-tuple']
    class
    HttpClient
    class
    Config
    class
    Cron
    class
    Run
    class
    CronClient
    typeAlias
    Context: TypeAlias
    typeAlias
    Input: TypeAlias
    typeAlias
    Json: dict[str, Any] | None
    typeAlias
    QueryParamTypes: Mapping[str, PrimitiveData | Sequence[PrimitiveData]] | list[tuple[str, PrimitiveData]] | tuple[tuple[str, PrimitiveData], ...] | str | bytes

    Represents a wildcard or 'all' selector.

    The field to sort by.

    Durability mode for the graph execution.

    • "sync": Changes are persisted synchronously before the next step starts.
    • "async": Changes are persisted asynchronously while the next step executes.
    • "exit": Changes are persisted only when the graph exits.

    Defines action after completion:

    • "delete": Delete resources after completion.
    • "keep": Retain resources after completion.

    The order to sort by.

    Defines the mode of streaming:

    • "values": Stream only the values.
    • "messages": Stream complete messages.
    • "updates": Stream updates to the state.
    • "events": Stream events occurring during execution.
    • "checkpoints": Stream checkpoints as they are created.
    • "tasks": Stream task start and finish events.
    • "debug": Stream detailed debug information.
    • "custom": Stream custom events.

    Handle async requests to the LangGraph API.

    Adds additional error messaging & content handling above the provided httpx client.

    Configuration options for a call.

    Represents a scheduled task.

    Represents a single execution run.

    Represents a JSON-like structure, which can be None or a dictionary with string keys and any values.

    Client for managing recurrent runs (cron jobs) in LangGraph.

    A run is a single invocation of an assistant with optional input, config, and context. This client allows scheduling recurring runs to occur automatically.

    Example Usage
    client = get_client(url="http://localhost:2024"))
    cron_job = await client.crons.create_for_thread(
        thread_id="thread_123",
        assistant_id="asst_456",
        schedule="0 9 * * *",
        input={"message": "Daily update"}
    )
    Feature Availability

    The crons client functionality is not supported on all licenses. Please check the relevant license documentation for the most up-to-date details on feature availability.