These samples demonstrate the Temporal LangGraph integration - combining LangGraph's agent framework with Temporal's durable execution.
Note: The LangGraph integration is currently available as a preview feature in the
langgraph_pluginbranch of the SDK repository.
The integration combines:
- Temporal workflows for orchestrating agent control flow and state management
- LangGraph for defining agent graphs with conditional logic, cycles, and state
This approach ensures that AI agent workflows are durable, observable, and can handle failures gracefully.
- Temporal server running locally
- Python 3.9+
- uv package manager (recommended)
Since the LangGraph integration is currently in a branch, you need to install from the branch repositories.
-
Clone this samples repository:
git clone -b langgraph_plugin https://github.com/mfateev/samples-python.git cd samples-python -
Install dependencies:
uv sync --group langgraph
-
Install the SDK from the
langgraph-pluginbranch:uv pip install "temporalio @ git+https://github.com/mfateev/sdk-python.git@langgraph-plugin" -
Start a local Temporal server:
temporal server start-dev
-
Navigate to a sample directory and follow its README for specific instructions
Each directory contains a complete example with its own README for detailed instructions:
| Sample | Description |
|---|---|
| hello_world | Simple starter example demonstrating basic plugin setup and graph registration |
| activity_from_node | Calling Temporal activities from a graph node using run_in_workflow |
| react_agent | ReAct agent pattern with tool calling and multi-step reasoning |
| human_in_the_loop | Human-in-the-loop approval workflows using two approaches |
| ↳ approval_graph_interrupt | Uses LangGraph's interrupt() function |
| ↳ approval_wait_condition | Uses run_in_workflow=True with workflow.wait_condition() |
| supervisor | Multi-agent supervisor pattern coordinating specialized agents |
| agentic_rag | Retrieval-augmented generation with document grading and query rewriting |
| deep_research | Multi-step research with web search and iterative refinement |
| plan_and_execute | Plan-and-execute pattern with structured step execution |
| reflection | Self-reflection pattern for iterative improvement |