Durable Agents and AI workflows with Restate

June 18, 2026 ยท View on GitHub

This repo contains a set of runnable examples of AI workflows and agents, using Durable Execution and Orchestration via Restate (Github)

The goal is to show how you can easily add production-grade resilience, state persistence, retries, suspend/resume, human-in-the-loop, and observability to agentic workflows. So you can ship agents that stay alive and consistent without sprinkling retry-code everywhere and without building heavyweight infra yourself.

The Restate approach works independent of specific SDKs but integrates easily with popular Agent SDKs, like the Vercel AI SDK, the OpenAI Agent SDK, Google ADK, Pydantic AI, and LangChain. Alternatively, you can also roll your own agent loop by combining Restate with any LLM SDK.

Why Restate?

Use CaseWhat it solves
Durable ExecutionCrash-safe model and tool calls, idempotent retries, agents that resume at the last successful step.
Detailed ObservabilityAuto-captured trace of every step, retry, and message for easy debugging and auditing.
Human-in-the-loop & long waitsSuspend while waiting for user approval or slow jobs; pay for compute, not wall-clock time.
Stateful sessions / memoryKeep multi-turn conversations and other state isolated and consistent.
Multi-agent orchestrationReliable RPC, queuing, and scheduling between agents running in separate processes.
Restate UI - trace of agent with parallel tools
Restate UI showing an agent execution with parallel tool calls

Quickstart Templates

Restate integrates with popular Agent SDKs and with all LLM SDKs (only abstracting away the LLM API).

IntegrationQuickstartTemplate
Vercel AI SDK๐Ÿ“–
OpenAI Agents SDK๐Ÿ“–
Google ADK๐Ÿ“–
Pydantic AI๐Ÿ“–
LangChain๐Ÿ“–
Restate - Python - any LLM SDK๐Ÿ“–
Restate - TS - any LLM SDK๐Ÿ“–

Getting Started - Basic Examples

PatternDocsRestate + LLM SDKVercel AIOpenAIADKPydantic AILangChain
Durable agents: Build AI agents that survive crashes and recover automatically๐Ÿ“–
Durable Sessions: Persistent, isolated agent sessions๐Ÿ“–
Human approvals with pause/resume: Human approval steps that suspend execution๐Ÿ“–
Multi-agent orchestration: Route requests to specialized agents๐Ÿ“–

Implementation Guides

Orchestration Guides

PatternDocsRestate + LLM SDKVercel AIOpenAIADKPydantic AILangChain
Parallel tool calls: Run multiple tools in parallel with recovery and coordination๐Ÿ“–
Sequential LLM calls: Chain agents in multi-step pipelines๐Ÿ“–
Parallel agents: Executing multiple agents in parallel๐Ÿ“–
Orchestrator-worker: Break tasks into specialized subtasks๐Ÿ“–
Evaluator-optimizer: Generate, evaluate, improve loop๐Ÿ“–
Workflows as tools: Complex tool logic as separate durable services๐Ÿ“–
Remote agents: Deploy/scale agents separately with resilient RPC and queuing๐Ÿ“–
Competitive racing agents: Run parallel agents, use the fastest response, cancel others๐Ÿ“– -----
Interrupt & regenerate: Interrupt a running agent with new context; cancel in-flight task and restart- -----

Reliability Guides

PatternDocsRestate + LLM SDKVercel AIOpenAIADKPydantic AILangChain
Error handling: Retries and error handling for agents๐Ÿ“–-
Rollback: Saga pattern for compensating failed operations๐Ÿ“–----

Frontend Integration

PatternDocsRestate + LLM SDKVercel AIOpenAIADKPydantic AILangChain
Chat UI integration: Integrate agents with chat UIs๐Ÿ“–-----
Streaming responses: Stream agent responses to clients๐Ÿ“–-----
Notify when ready: Callback when agent completes๐Ÿ“–-----

Integrations

Protocols

ExampleCode
MCP: Using Restate for exposing tools and resilient orchestration of tool calls
A2A: Implement Google's Agent-to-Agent protocol with Restate as resilient, scalable task orchestrator

AI Observability

IntegrationRestate + LLM SDKOpenAI AgentsGoogle ADKPydantic AI
Langfuse
Arize Phoenix---
Pydantic LogFire---
Braintrust---

Others

ExampleCode
NextJS Template: Minimal example of Restate + AI SDK + NextJS
NextJS Example App: Example app of Restate + AI SDK + NextJS with tools, chat, pubsub,...

Advanced Examples

Larger, end-to-end applications (in separate repos) showing how Restate holds up in real-world agentic systems.

ExampleCode
Coding agent: orchestrates multi-turn conversations and coordinates subagents over sandboxed task execution
Deep Research Agent: Autonomous multi-day research agent (news digests, human-approved plans, parallel investigations) with Restate + LangChain + Tavily
Supervisor Agent: Supervisor pattern with policy gates, audit trails, and escalation ladders for security remediation workflows

Supported Languages

Restate currently supports 6 languages:

TypeScript Python Java Kotlin Go Rust

The examples can be translated to any of the supported languages. Join our Discord/Slack to get help with translating an examples to your language of choice.

Using AI coding tools

If you use Claude Code, Codex, or Cursor to build on Restate, we highly recommend installing the Restate plugin. It bundles skills, prompts, and context that help AI coding assistants generate correct, idiomatic Restate code across all supported SDKs. Most templates in this repo install the plugin automatically โ€” see the skills repo for setup instructions.

Learn more