langchain-ai/langgraph · error · ValueError

Async client is not initialized: please provide `url` or…

Error message

Async client is not initialized: please provide `url` or `client` when initializing `RemoteGraph`.

What it means

Raised by RemoteGraph's async client validation when neither a url nor a pre-built client was provided at construction, so async operations have no client to use. RemoteGraph does not run locally; it needs connection details to a LangGraph server. Pass url= or client= when creating the RemoteGraph.

Solutions

  1. Pass url=... (and optionally api_key/headers) when constructing RemoteGraph
  2. Pass an explicit async LangGraphClient via client=
  3. Use the sync methods if only a sync_client is available
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at libs/langgraph/langgraph/pregel/remote.py:183 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/47a46e3a006be0a8. Report an issue: GitHub.

Appendix: source

Thrown at libs/langgraph/langgraph/pregel/remote.py:183

        self.assistant_id = assistant_id
        if name is None:
            self.name = assistant_id
        else:
            self.name = name
        self.config = config
        self.distributed_tracing = distributed_tracing

        if client is None and url is not None:
            client = get_client(url=url, api_key=api_key, headers=headers)
        self.client = client

        if sync_client is None and url is not None:
            sync_client = get_sync_client(url=url, api_key=api_key, headers=headers)
        self.sync_client = sync_client

    def _validate_client(self) -> LangGraphClient:
        if self.client is None:
            raise ValueError(
                "Async client is not initialized: please provide `url` or `client` when initializing `RemoteGraph`."
            )
        return self.client

    def _validate_sync_client(self) -> SyncLangGraphClient:
        if self.sync_client is None:
            raise ValueError(
                "Sync client is not initialized: please provide `url` or `sync_client` when initializing `RemoteGraph`."
            )
        return self.sync_client

    def _reject_v3_unsupported(
        self,
        *,
        control: Any,
        transformers: Any,
        interrupt_before: Any,
        interrupt_after: Any,

View on GitHub (pinned to 38031739e5)