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 Checkpoint
    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

    OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
    LangGraph Checkpoint
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggraphtypesTimeoutPolicy
    Classā—Since v1.1

    TimeoutPolicy

    Copy
    TimeoutPolicy(
      self,
      *,
      run_timeout: float | timedelta | None = None,
      idle_timeout:

    Constructors

    Attributes

    Methods

    View source on GitHub
    float
    |
    timedelta
    |
    None
    =
    None
    ,
    refresh_on
    :
    Literal
    [
    'auto'
    ,
    'heartbeat'
    ]
    =
    'auto'
    )
    constructor
    __init__
    NameType
    run_timeoutfloat | timedelta | None
    idle_timeoutfloat | timedelta | None
    refresh_onLiteral['auto', 'heartbeat']
    attribute
    run_timeout: float | timedelta | None
    attribute
    idle_timeout: float | timedelta | None
    attribute
    refresh_on: Literal['auto', 'heartbeat']
    method
    coerce

    Configuration for timing out node attempts.

    Cooperative cancellation

    Timeouts rely on asyncio cancellation. If your node uses synchronous time.sleep() or other CPU-bound work that blocks the GIL, the timeout will not be fired until after the event loop has been released.

    Inline callback dispatch

    Under refresh_on="auto", an internal handler refreshes the timeout on any callback event that occurs in the execution of the node or its nested descendants.

    Hard wall-clock cap (in seconds) for a single node attempt.

    This timeout is never refreshed by progress signals or runtime.heartbeat().

    Maximum time (in seconds) a single node attempt may go without observable progress.

    Which signals refresh idle_timeout.

    "auto" refreshes on standard graph progress signals and explicit heartbeats. "heartbeat" refreshes only on explicit runtime.heartbeat() calls.

    Normalize a timeout value to positive-second policy fields.