package documentation

LangGraph plugin for Temporal SDK.

Warning

This package is experimental and may change in future versions. Use with caution in production environments.

This plugin runs LangGraph nodes and tasks as Temporal Activities, giving your AI agent workflows durable execution, automatic retries, and timeouts. It supports both the LangGraph Graph API (StateGraph) and Functional API (@entrypoint / @task).

Module _activity Activity wrappers for executing LangGraph nodes and tasks.
Module _interceptor Workflow interceptor that scopes LangGraph graphs/entrypoints to the workflow run.
Module _langgraph_config LangGraph configuration management for Temporal workflows.
Module _plugin LangGraph plugin for running LangGraph nodes and tasks as Temporal activities.
Module _task_cache Task result cache for continue-as-new support.

From __init__.py:

Class LangGraphPlugin LangGraph plugin for Temporal SDK.
Function cache Return the task result cache as a serializable dict.
Function entrypoint Retrieve a registered entrypoint by name.
Function graph Retrieve a registered graph by name.
def cache() -> dict[str, Any] | None: (source)

Return the task result cache as a serializable dict.

Returns a dict suitable for passing to entrypoint(name, cache=...) to restore cached task results across continue-as-new boundaries. Returns None if the cache is empty.

def entrypoint(name: str, cache: dict[str, Any] | None = None) -> Pregel[Any, Any, Any, Any]: (source)

Retrieve a registered entrypoint by name.

Parameters
name:strEntrypoint name as registered with Plugin.
cache:dict[str, Any] | NoneOptional task result cache from a previous cache() call. Restores cached results so previously-completed tasks are not re-executed after continue-as-new.
Returns
Pregel[Any, Any, Any, Any]Undocumented
def graph(name: str, cache: dict[str, Any] | None = None) -> StateGraph[Any, Any, Any, Any]: (source)

Retrieve a registered graph by name.

Parameters
name:strGraph name as registered with LangGraphPlugin.
cache:dict[str, Any] | NoneOptional task result cache from a previous cache() call. Restores cached results so previously-completed nodes are not re-executed after continue-as-new.
Returns
StateGraph[Any, Any, Any, Any]Undocumented