Durable execution.
No replay.
Add Dex to your AI agent or workflow to make it resilient to any disruptions.
Built for reliable agents
Keep your agent framework. Wrap the agent in one call, and Dex runs each model call and tool call as its own Step.
- A crash reruns only the call in flight.
- Tool calls that need approval wait as long as it takes.
- New code takes effect at the next Step.
$ pip install dex-agents-pydantic-ai "pydantic-ai-slim[openai]"agent = Agent("openai:gpt-5.2", instructions="You help customers with their orders.")
# @agent.tool find_order, refund_order, email_customer: unchanged
flow = pydantic_ai_session_flow(
agent,
flow_type="OrderAgent",
tool_policies={
"find_order": ToolPolicy(ToolEffect.READ),
"refund_order": ToolPolicy(ToolEffect.IDEMPOTENT_WRITE, requires_approval=True),
"email_customer": ToolPolicy(ToolEffect.NON_IDEMPOTENT_WRITE),
},
)$ pip install dex-agents-langgraphdef build_support_agent():
return create_agent(
init_chat_model("openai:gpt-5-mini"),
tools=[search_orders, refund_order],
system_prompt="You help customers with their orders.",
middleware=[DurableToolCallMiddleware()],
)
support_agent = langchain_agent_session_flow(
build_support_agent,
flow_type="SupportAgent",
tool_policies={
"search_orders": ToolPolicy(ToolEffect.READ),
"refund_order": ToolPolicy(ToolEffect.IDEMPOTENT_WRITE, requires_approval=True),
},
)$ pip install dex-agents-openai-agentsagent = Agent(
name="Support",
instructions="Help the customer with their orders.",
tools=[search_orders, create_refund],
)
flow = openai_agents_session_flow(
agent,
flow_type="SupportAgent",
tool_policies={
"search_orders": ToolPolicy(ToolEffect.READ),
"create_refund": ToolPolicy(ToolEffect.NON_IDEMPOTENT_WRITE),
},
)$ npm i @superdurable/dex-agents-vercel-ai @superdurable/dex-agents @superdurable/dex ai zodexport const supportAgentFlow = createVercelAiAgentSessionFlow(
{
model: openai("gpt-5"),
instructions: "You help customers with their orders. Ask before refunding.",
tools: { get_order, refund_order }, // tool({ ... }) as usual
toolPolicies: {
get_order: { effect: "read" },
refund_order: { effect: "idempotent_write", requiresApproval: true },
},
},
"SupportAgent",
{ interruptDeadlineMs: 24 * 60 * 60 * 1000 },
);$ npm i @superdurable/dex-agents-mastra @superdurable/dex-agents @superdurable/dex @mastra/core zodconst supportAgent = new Agent({
id: "support",
name: "Support",
instructions: "Help customers with their orders. Refund only when asked.",
model: "openai/gpt-5",
tools: { search_orders: searchOrders, refund_order: refundOrder },
});
const flow = createMastraAgentSessionFlow(supportAgent, "SupportAgent", {
toolPolicies: { refund_order: { effect: "idempotent_write", requiresApproval: true } },
interruptDeadlineMs: 24 * 60 * 60 * 1000,
});$ pip install dex-agents-google-adkagent = LlmAgent(
name="support",
model="gemini-2.5-flash",
instruction="Help customers with their orders.",
tools=[search_orders, refund_order, send_email],
)
flow = adk_agent_session_flow(
agent,
flow_type="SupportAgent",
tool_policies={
"search_orders": ToolPolicy(ToolEffect.READ),
"refund_order": ToolPolicy(ToolEffect.IDEMPOTENT_WRITE, requires_approval=True),
# send_email has no policy: unclassified, it runs once after approval.
},
)$ pip install dex-agents-claude-agent-sdkdef build_options(context: ClaudeAgentOptionsContext) -> ClaudeAgentOptions:
return ClaudeAgentOptions(
model="claude-sonnet-5",
system_prompt="You resolve order problems.",
tools=["Read", "Grep", "Bash"],
cwd=f"/srv/agents/{context.flow_id}",
)
flow = claude_agent_session_flow(
build_options,
[lookup_order, create_refund],
flow_type="SupportAgent",
tool_policies={"create_refund": ToolPolicy(ToolEffect.NON_IDEMPOTENT_WRITE)},
)The Claude Agent SDK runs its own loop in its CLI, so Dex runs each turn as one Step, not each call.
func (CallModel) GetStepOptions() *dex.StepOptions {
return &dex.StepOptions{
ExecuteMethodTimeout: 2 * time.Minute,
HeartbeatTimeout: 2 * time.Minute,
ExecuteDurability: dex.StepDurabilitySync,
ExecuteRetry: &dex.RetryPolicy{MaximumAttempts: 3, MaximumInterval: 5 * time.Second},
ExecuteFailure: dex.ProceedToOnExecuteFailure(RecordModelFailure{}, recoveryStepOptions),
}
}Durable execution, done differently
Change code safely
No replay, so you deploy while runs wait. Each run picks up the new code at its next step.
Write ordinary code
No determinism rules. A Step is plain code: call any API or library, check the time, generate IDs.
See the business process
Dex Web draws every flow from its code and shows where each run is on it.
Data-native
Attributes are a fast, low-cost key-value store that syncs to your database of choice.
Zero dependencies
Dex Server is one Rust binary. S3 holds the data and RocksDB is its write-through cache, so there is no database, queue or search cluster to run beside it.
Build with what you already use
The Dex skills teach Claude Code, Codex and Cursor how Dex works, from the first Flow to the connectors. Or write it yourself with an SDK and the Dex CLI.
- Go
- Python
- TypeScript
- Java
- Rust
$ brew install superdurable/tap/dexcli
$ dexcli dev$ claude plugin marketplace add superdurable/dex-skills
$ claude plugin install superdurable-dex@superdurable
A growing library of connectors
Google Sheets
Gmail
Slack
Google Drive
Google Calendar
HubSpot
Airtable
Notion
Salesforce
OpenAI
Jira
Zendesk Support
LLM
Asana
Mailchimp
Trello
Calendly
Stripe
Zoom
PostgreSQL
MySQL
monday.com
Typeform
Twilio Messaging
Google Forms
LinkedIn
Microsoft SQL Server
Amazon S3
Microsoft Outlook Mail
GitHub
Gemini
Freshdesk
Google Docs
Microsoft Teams
Webhook
Intercom
Microsoft Excel
Zoho Desk
Help Scout
Spotify
Xero
Email (IMAP and SMTP)
BambooHR
Confluence
Microsoft OneDrive and SharePoint
Google Workspace Admin
Hacker News Daily
Microsoft Entra ID
Algolia
Alpha Vantage
Amazon SQS
Bitbucket
Brevo
ClickUp
Close
Cloudflare
Coda
Cohere
Contentful
Datadog
Discord
DocuSign eSignature
ElevenLabs
Figma
Front
GitLab
Gorgias
Harvest
Hiver
Jira Service Management
Klaviyo
Linear
Mailgun
Microsoft Outlook Calendar
Mixpanel
Netlify
NewsAPI
OAuth 2.0 HTTP
OpenWeatherMap
PagerDuty
PayPal
Pinecone
Pipedrive
Postmark
QuickBooks Online
Re:amaze
Resend
SendGrid
Sentry
Shopify
Smartsheet
Snowflake
Square
Supabase
TMDB
Todoist
Unsplash
Vercel
Webflow
WooCommerce
YouTube
Zoho CRM
How Dex differs from replay-based engines
| Replay-based engines | Dex | |
|---|---|---|
| Changing code of running processes | Recovery replays workflow code against its history, so a change that alters the sequence of steps needs a version branch in the code. | Each Step's result is recorded. Running Flows continue on new code from their next Step. |
| Seeing a run | A list or timeline of history events. | A graph generated from the code, with each run drawn on it: where it is, what it waits for, what happened. |
| Business data | Kept in workflow variables or in your own database; searching across runs needs extra setup. | Attributes: durable, indexable and searchable across runs, with optional writes to PostgreSQL, MySQL, Snowflake, Databricks or MongoDB. |
| Calling other systems | You write the client code. | More than 100 open-source connectors, such as Slack, Gmail, Salesforce and Stripe. |
| Running the server | A server cluster with a database, often with a search cluster beside it. | A single binary that stores everything in object storage such as S3, managed for you or run yourself. |
Run it where you want
Run it yourself
Dex is source available: one binary and your own S3. Your code does not change.
Self-hosting guide