Skip to main content
LangGraph defines several constants that are used throughout the framework for graph control flow, node identification, and configuration. Defined in: langgraph/constants.py

Graph Control Flow

START

str
The first (virtual) node in graph-style Pregel.Use this constant to add edges from the graph entry point to your first node(s). The actual value is the interned string "__start__".Defined in: langgraph/constants.py:30

Usage Example

END

str
The last (virtual) node in graph-style Pregel.Use this constant to mark terminal nodes in your graph. When execution reaches a node with an edge to END, the graph will cease execution. The actual value is the interned string "__end__".Defined in: langgraph/constants.py:28

Usage Example

Conditional Routing to END

Streaming and Tracing Tags

TAG_HIDDEN

str
Tag to hide a node/edge from certain tracing/streaming environments.When applied to a node, it will not appear in tracing outputs or certain streaming modes. The actual value is the interned string "langsmith:hidden".Defined in: langgraph/constants.py:26

Usage Example

TAG_NOSTREAM

str
Tag to disable streaming for a chat model.When applied to a chat model invocation, it will not stream tokens even if streaming is enabled. The actual value is the interned string "nostream".Defined in: langgraph/constants.py:24

Usage Example

Import Paths

Reserved Constants (Deprecated)

The following constants are retained for backwards compatibility but should not be used directly:
  • CONF - Internal configuration key (use context_schema instead)
  • TASKS - Internal tasks tracking (managed automatically)
  • CONFIG_KEY_CHECKPOINTER - Internal checkpointer key (managed automatically)
These internal constants are deprecated and may be removed in future versions. The LangGraph team maintains these for backwards compatibility with existing code, particularly in langgraph-api. If you’re using any of these constants, please contact the LangGraph team or file an issue.

Usage Patterns

Basic Linear Graph

Conditional Routing

Multiple Entry Points

See Also