langchain-ai/langgraph · error
Importing from langgraph.constants is deprecated. Please…
Error message
Importing {name} from langgraph.constants is deprecated. Please use 'from langgraph.types import {name}' instead. What it means
Module-level deprecation shim in langgraph.constants: __getattr__ intercepts imports of Send and Interrupt, which moved to langgraph.types. The warning is emitted but the object is still transparently returned from its new home, so the import keeps working.
Solutions
- Change the import to 'from langgraph.types import Send, Interrupt'
- Search the codebase for 'from langgraph.constants import' and update each occurrence
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at libs/langgraph/langgraph/constants.py:36 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/981835bc4fbc812b.
Report an issue: GitHub.
Appendix: source
Thrown at libs/langgraph/langgraph/constants.py:36
"CONF",
"TASKS",
"CONFIG_KEY_CHECKPOINTER",
)
# --- Public constants ---
TAG_NOSTREAM = sys.intern("nostream")
"""Tag to disable streaming for a chat model."""
TAG_HIDDEN = sys.intern("langsmith:hidden")
"""Tag to hide a node/edge from certain tracing/streaming environments."""
END = sys.intern("__end__")
"""The last (maybe virtual) node in graph-style Pregel."""
START = sys.intern("__start__")
"""The first (maybe virtual) node in graph-style Pregel."""
def __getattr__(name: str) -> Any:
if name in ["Send", "Interrupt"]:
warn(
f"Importing {name} from langgraph.constants is deprecated. "
f"Please use 'from langgraph.types import {name}' instead.",
LangGraphDeprecatedSinceV10,
stacklevel=2,
)
from importlib import import_module
module = import_module("langgraph.types")
return getattr(module, name)
try:
from importlib import import_module
private_constants = import_module("langgraph._internal._constants")
attr = getattr(private_constants, name)
warn(
f"Importing {name} from langgraph.constants is deprecated. "View on GitHub (pinned to 38031739e5)