Skip to main content

Langgraph Temporal

Logo

Temporal integration for LangGraph — durable execution for stateful AI agents.

Run your existing LangGraph StateGraph as a Temporal Workflow with automatic recovery from failures, distributed node execution, and zero-resource human-in-the-loop.

This project is experimental, use at your own risk

Installation

pip install langgraph-temporal

Requirements: Python >= 3.10, langgraph >= 1.0.0, temporalio >= 1.7.0

Quick start

1. Run a local Temporal server

A docker-compose.yml is provided to run Temporal locally with PostgreSQL and Elasticsearch.

cp .env.ci .env
make start_temporal

2. Create langgraph workflow

Take any compiled LangGraph graph, wrap it in TemporalGraph, start a Worker, and invoke:

import asyncio
from typing import TypedDict

from langgraph.graph import END, START, StateGraph
from temporalio.client import Client as TemporalClient
from temporalio.worker import UnsandboxedWorkflowRunner

from langgraph.temporal import TemporalGraph


class State(TypedDict):
    message: str


def greet(state: State) -> dict:
    from time import sleep
    sleep(10) # simulate work
    return {"message": f"Hello, {state['message']}!"}


async def main():
    # 1. Build a normal LangGraph
    builder = StateGraph(State)
    builder.add_node("greet", greet)
    builder.add_edge(START, "greet")
    builder.add_edge("greet", END)
    graph = builder.compile()

    # 2. Connect to Temporal and wrap the graph
    client = await TemporalClient.connect("localhost:7233")
    tg = TemporalGraph(graph, client, task_queue="my-queue")

    # 3. Start a Worker (runs Activities that execute your nodes)
    worker = tg.create_worker(workflow_runner=UnsandboxedWorkflowRunner())

    async with worker:
        result = await tg.ainvoke(
            {"message": "world"},
            config={"configurable": {"thread_id": "greeting-1"}},
        )

    print(result)  # {"message": "Hello, world!"}


asyncio.run(main())

Note: LangGraph imports modules restricted by Temporal's sandbox, so UnsandboxedWorkflowRunner() is required when creating the Worker.

3. Open Temporal UI

The Temporal Web UI is available at http://localhost:8233

Demo

License

MIT

Metadata

Release files for langgraph-temporal 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langgraph-temporal 0.2.0
File Size Uploaded Provenance Actions
langgraph_temporal-0.2.0.tar.gz 31.0 MB With provenance Details for langgraph_temporal-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langgraph-temporal 0.2.0
File Interpreter ABI Platform Actions
langgraph_temporal-0.2.0-py3-none-any.whl Python 3 none any Details for langgraph_temporal-0.2.0-py3-none-any.whl

Total release size: 31.0 MB

Release files / langgraph_temporal-0.2.0.tar.gz

Download URL langgraph_temporal-0.2.0.tar.gz
Size 31.0 MB
Tags Source
SHA-256 checksum
How to use checksums
dcb64dfbde0b8a0676bf93c16eb7d5794d6f5e3b435458f02dda6a7a4fa1e46a
BLAKE2b-256 checksum
How to use checksums
a90d3695806bbf0de8e48a6f6b8f20ebe1500fb5124318de8d3e76c195dc6685
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 29, 2026.

Transparency log

Release files / langgraph_temporal-0.2.0-py3-none-any.whl

Download URL langgraph_temporal-0.2.0-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e357ab4c5d5cf8de17ec73722879f82215cc12347f51b0f237160a9b99651e55
BLAKE2b-256 checksum
How to use checksums
1ab899d4c99f79ca964fd154d466bc91ec7e2f552cf22ef1a19736c633ca5425
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 29, 2026.

Transparency log

Security for langgraph-temporal 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langgraph_temporal-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page