langchain-ai/langgraph · error

AsyncShallowPostgresSaver is deprecated as of version…

Error message

AsyncShallowPostgresSaver is deprecated as of version 2.0.20 and will be removed in 3.0.0. Use AsyncPostgresSaver instead, and invoke the graph with `await graph.ainvoke(..., durability='exit')`.

What it means

Error "AsyncShallowPostgresSaver is deprecated as of version 2.0.20 and will be removed in 3.0.0. Use AsyncPostgresSaver instead, and invoke the graph with `await graph.ainvoke(..., durability='exit')`." thrown in langchain-ai/langgraph.

Solutions

  1. Use AsyncPostgresSaver instead and await graph.ainvoke(..., durability="exit") for persist-on-exit semantics
  2. Plan removal of AsyncShallowPostgresSaver before checkpoint-postgres 3.0.0 drops it
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at libs/checkpoint-postgres/langgraph/checkpoint/postgres/shallow.py:551 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26). Data as JSON: /api/errors/558e8323fa7694e4. Report an issue: GitHub.

Appendix: source

Thrown at libs/checkpoint-postgres/langgraph/checkpoint/postgres/shallow.py:551

    It is meant to be a light-weight drop-in replacement for the AsyncPostgresSaver that
    supports most of the LangGraph persistence functionality with the exception of time travel.
    """

    SELECT_SQL = SELECT_SQL
    MIGRATIONS = MIGRATIONS
    UPSERT_CHECKPOINT_BLOBS_SQL = UPSERT_CHECKPOINT_BLOBS_SQL
    UPSERT_CHECKPOINTS_SQL = UPSERT_CHECKPOINTS_SQL
    UPSERT_CHECKPOINT_WRITES_SQL = UPSERT_CHECKPOINT_WRITES_SQL
    INSERT_CHECKPOINT_WRITES_SQL = INSERT_CHECKPOINT_WRITES_SQL
    lock: asyncio.Lock

    def __init__(
        self,
        conn: _ainternal.Conn,
        pipe: AsyncPipeline | None = None,
        serde: SerializerProtocol | None = None,
    ) -> None:
        warnings.warn(
            "AsyncShallowPostgresSaver is deprecated as of version 2.0.20 and will be removed in 3.0.0. "
            "Use AsyncPostgresSaver instead, and invoke the graph with `await graph.ainvoke(..., durability='exit')`.",
            DeprecationWarning,
            stacklevel=2,
        )
        super().__init__(serde=serde)
        if isinstance(conn, AsyncConnectionPool) and pipe is not None:
            raise ValueError(
                "Pipeline should be used only with a single AsyncConnection, not AsyncConnectionPool."
            )

        self.conn = conn
        self.pipe = pipe
        self.lock = asyncio.Lock()
        self.loop = asyncio.get_running_loop()
        self.supports_pipeline = Capabilities().has_pipeline()

    @classmethod

View on GitHub (pinned to 38031739e5)