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.
| Use Case | What it solves |
|---|---|
| Durable Execution | Crash-safe model and tool calls, idempotent retries, agents that resume at the last successful step. |
| Detailed Observability | Auto-captured trace of every step, retry, and message for easy debugging and auditing. |
| Human-in-the-loop & long waits | Suspend while waiting for user approval or slow jobs; pay for compute, not wall-clock time. |
| Stateful sessions / memory | Keep multi-turn conversations and other state isolated and consistent. |
| Multi-agent orchestration | Reliable RPC, queuing, and scheduling between agents running in separate processes. |
Restate UI showing an agent execution with parallel tool calls
Restate integrates with popular Agent SDKs and with all LLM SDKs (only abstracting away the LLM API).
| Integration | Quickstart | Template |
|---|---|---|
| Vercel AI SDK | π | |
| OpenAI Agents SDK | π | |
| Google ADK | π | |
| Pydantic AI | π | |
| LangChain | π | |
| Restate - Python - any LLM SDK | π | |
| Restate - TS - any LLM SDK | π |
| Pattern | Docs | Restate + LLM SDK | Vercel AI | OpenAI | ADK | Pydantic AI | LangChain |
|---|---|---|---|---|---|---|---|
| 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 | π |
| Pattern | Docs | Restate + LLM SDK | Vercel AI | OpenAI | ADK | Pydantic AI | LangChain |
|---|---|---|---|---|---|---|---|
| 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 | - | - | - | - | - | - |
| Pattern | Docs | Restate + LLM SDK | Vercel AI | OpenAI | ADK | Pydantic AI | LangChain |
|---|---|---|---|---|---|---|---|
| Error handling: Retries and error handling for agents | π | - | |||||
| Rollback: Saga pattern for compensating failed operations | π | - | - | - | - |
| Pattern | Docs | Restate + LLM SDK | Vercel AI | OpenAI | ADK | Pydantic AI | LangChain |
|---|---|---|---|---|---|---|---|
| Chat UI integration: Integrate agents with chat UIs | π | - | - | - | - | - | |
| Streaming responses: Stream agent responses to clients | π | - | - | - | - | - | |
| Notify when ready: Callback when agent completes | π | - | - | - | - | - |
| Integration | Restate + LLM SDK | OpenAI Agents | Google ADK | Pydantic AI |
|---|---|---|---|---|
| Langfuse | ||||
| Arize Phoenix | - | - | - | |
| Pydantic LogFire | - | - | - | |
| Braintrust | - | - | - |
Restate currently supports 6 languages:
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.
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.
