The best platform for running an AI agent in production depends heavily on which layer of your AI stack is missing. A production-ready agent needs three of those: a framework to write the agent loop, a durable execution layer to keep it alive, and compute to run it.

With Claude, Codex, and their pals, you can get a local agent working with a few shots of espresso. But then, production happens, and 40 minutes later, a deploy kills the run. The agent restarts from zero, pays for every model call again, and refunds the same customer twice.

This article explains what each layer of the AI stack does and which platforms handle that sort of work so your agent doesn’t reach production without the infrastructure it needs.

TL;DR: Pick a framework by language. If runs are short and restartable, any compute will do. If runs outlive a request, have side effects, or wait on a human, add a durable execution layer. For TypeScript, Trigger.dev gives you that layer and the compute together.

Want a deep dive, framework by framework? See Best AI agent frameworks for production.

What Does "Production" Mean for an AI Agent?

A demo agent works while you watch, then breaks when a run takes too long or a step has to wait. If you leave it unattended, these are the things you should be on the lookout for:

  • Long runs without timeouts: AWS Lambda stops at 30 minutes.
  • Checkpointing: After a crash, the run resumes from its last completed step, not from zero.
  • Retries and idempotency: LLM and tool calls fail. A retry must never refund a customer twice.
  • Human-in-the-loop approvals: Some steps need a person to approve them, and people can take hours (or days, in case of a long weekend).
  • Concurrency and queueing: One noisy tenant shouldn’t starve everyone else.
  • Observability: You need a trace in case a run goes sideways.
  • Safe deploys: Shipping code while 200 runs are in progress shouldn’t corrupt any of them.

In my experience, checkpointing and idempotency hit first, while the rest tend to show up later.

How Do Frameworks, Durable Execution, and Compute Differ?

"Best agent platform" lists usually compare LangGraph, Temporal, and AgentCore, as if they were competing tools. But for the most part, they aren’t. Here’s why:

  • Frameworks define how you write the agent: its reasoning loop, tools, memory, and handoffs.

  • Durable execution defines what the run can survive: crashes, retries, redeploys, and long waits.

  • Compute defines where the code physically runs: containers, serverless functions, or a managed agent runtime.

Three layers of a production AI agent stack - Framework, Durable Execution, and Compute

Trigger.dev covers layers 2 and 3.

Example: LangGraph has built-in checkpointing, but you run the Postgres behind it (or let LangSmith Agent Server run it). Trigger.dev includes compute and durable execution, but you bring the framework.

How Do You Run Durable AI Agents in TypeScript?

If your team writes TypeScript and you’d rather not run your own workers or extra servers, well, Trigger.dev is built for that precisely.

Trigger.dev is open source (Apache 2.0), available as a cloud service or for self-hosting, and sits underneath your framework instead of replacing it:

  • Durability without rewriting: A task is a plain async TypeScript function with a retry policy. No determinism rules.
  • Human-in-the-loop without burning money: On Trigger.dev Cloud, a wait token checkpoints the run and releases the machine. Waiting isn’t billed, and the run gives back its concurrency slot.
  • A runtime, not just an orchestrator: Compute is included, so you don’t need to deploy or scale workers. There’s no platform-imposed cap on run length. You set maxDuration per task, and it counts compute time only, so waits don’t use it up.
  • Production controls: Queues, per-tenant concurrency, retries, traces, OpenTelemetry export, and real-time frontend streaming are included.
  • Built for coding agents: A Model Context Protocol (MCP) server and skills let Claude Code or Cursor write, trigger, and debug tasks.

Here’s how Trigger.dev pairs with a framework. The agent is in plain Vercel AI SDK, inside a child task. The parent task has retries, a three-day approval, and a trace:

import { idempotencyKeys, task, wait } from "@trigger.dev/sdk"; import { generateText, isStepCount } from "ai"; import { anthropic } from "@ai-sdk/anthropic"; import { researchTools } from "./tools"; import { notifyReviewer, publishReport } from "./lib"; type Payload = { topic: string; reportId: string }; // Child task that wraps generateText. On a retry of the parent, // the completed child run is returned as-is: same draft, no rebilling. export const draftReport = task({ id: "draft-report", run: async (payload: Payload) => { const { text } = await generateText({ model: anthropic("claude-sonnet-5-5"), prompt: `Research and draft a short report on: ${payload.topic}`, tools: researchTools, stopWhen: isStepCount(20), }); return text; }, }); export const researchAgent = task({ id: "research-agent", maxDuration: 3600, // compute seconds only; time spent waiting does not count retry: { maxAttempts: 3 }, run: async (payload: Payload) => { // Both keys are scoped to this run: a retry reuses them, a new run gets fresh ones const drafted = await draftReport.triggerAndWait(payload, { idempotencyKey: await idempotencyKeys.create("draft"), }); if (!drafted.ok) throw new Error("Drafting failed"); const draft = drafted.output; const token = await wait.createToken({ timeout: "3d", idempotencyKey: await idempotencyKeys.create("review"), }); await notifyReviewer(token.id, draft); // ignores repeat calls for the same token.id // The run is checkpointed here and the machine is released until someone answers const review = await wait.forToken<{ approved: boolean }>(token); if (!review.ok || !review.output.approved) return { status: "not-published" }; await publishReport(payload.reportId, draft); // ignores repeat calls for the same reportId return { status: "published" }; }, }); 

If the parent fails after the draft is done, a retry gets the same draft and review token back. As a result, you don’t pay for the model calls twice or publish a draft nobody has reviewed. A new run for the same report starts with fresh keys.

The same pattern works with Mastra and the OpenAI Agents SDK. For chat agents, chat.agent() adds durable sessions that survive page refreshes and deploys, with tool approvals in your UI, Slack, or Linear.

Sequence of a three-day human approval on Trigger.dev. The run is checkpointed and restored when the reviewer answers

What happens during the three-day approval? The run is checkpointed, and the machine is released until the reviewer answers.

Best for: TypeScript teams that already have a framework or are choosing one and need long-running, interruptible runs without running workers

Watch out: Retries happen at run-level. A failed attempt runs run() from the top, so side effects need idempotency keys. Replay engines, by contrast, skip completed steps for you. The work you put in child tasks with an idempotency key isn’t repeated. Tasks are TypeScript-only, although Python scripts can run inside them via the Python extension. Checkpointing is cloud-only. When self-hosted, waits hold the machine.

Production Scorecard for AI Agent Platforms

Here’s how the main options compare in a nutshell:

Platform

Layer

Languages

Durability model

Multi-day waits

Who runs the compute

Trigger.dev

Durable execution + compute

TypeScript

Run-level retries, checkpointed waits

Yes

Trigger.dev (or self-hosted)

LangGraph

Framework

Python, TypeScript

Checkpoint per super-step

interrupt(), no built-in timeout

You, or LangSmith Agent Server

Mastra

Framework

TypeScript

Suspend and resume snapshots, workflow restarts

Suspend to storage

You, or the Mastra platform

OpenAI Agents SDK

Framework

Python, TypeScript

Sessions persist history; no crash recovery in core

Serializable approval state

You

Vercel AI SDK

Framework (toolkit)

TypeScript

None in the core loop (WorkflowAgent adds it)

Approval stops the core loop

You

Temporal

Durable execution

Go, Java, TypeScript, Python, .NET and more

Event history replay

Yes

You run Workers (serverless option in preview)

Inngest

Durable execution

TypeScript, Python, Go

Step memoization

Yes

Your app (serverless, servers or Connect workers)

Restate

Durable execution

TypeScript, Python, Java, Go, and more

Step journal

Yes

Your services, serverless or containers

DBOS

Durable execution

TypeScript, Python, Go, Java

Postgres checkpoints, as a library

Yes

Your app process (Conductor for fleet recovery)

Vercel Workflows

Durable execution

TypeScript, Python (beta)

Step event log with replay

Yes

Vercel or other platforms via Worlds

AWS Lambda durable functions

Durable execution + compute

JavaScript, TypeScript, Python, Java, .NET

Checkpoint and replay

Yes, up to one year

AWS

Amazon Bedrock AgentCore

Managed runtime

Any (container)

Ephemeral compute; session storage and AgentCore Memory persist state

8-hour compute lifetime per microVM (14 days on Instances)

AWS

Google Agent Runtime

Managed runtime

Any (container); templates for ADK, LangGraph and more

Managed sessions and Memory Bank

ADK background jobs up to 7 days

Google Cloud

LangSmith Agent Server

Managed runtime (any framework, LangGraph-first)

Python, TypeScript

Managed checkpoints and task queue

interrupt()

LangChain, or self-hosted with a license

Mastra platform

Managed runtime (Mastra)

TypeScript

Mastra suspend and resume, hosted storage

Suspend to storage

Mastra

Based on each vendor's documentation as of November 2026. Features change fast, so verify before committing to one.

Which Framework Should Hold Your Agent Logic?

Here’s where each framework stands out and what to keep an eye on.

LangGraph

LangGraph models the agent as a graph, offering you explicit control over every step. It has the most comprehensive durability design of the open-source frameworks.

Best for: Python or TypeScript teams that want a stateful graph they can reason about

Watch out: In production, you configure a persistent checkpointer (usually Postgres) and run it yourself or use LangSmith Agent Server. On resume, an interrupted node re-runs from its start.

Mastra

Mastra is the most complete TypeScript-native framework on this list, with agents, workflows, memory, evaluations, and a local studio in one package. Suspend and resume survive deploys, too.

Best for: TypeScript teams that want everything in one box.

Watch out: Crash recovery depends on how you run it. Workflow runs restart from their last active step after a crash. Durable agents (beta) recover only when you enable the feature and use persistent storage. For multi-process durability, Mastra workers can run on Redis or Pub/Sub, and workflows can also run on Inngest.

OpenAI Agents SDK

The OpenAI Agents SDK is a lightweight SDK covering agents, tools, handoffs, guardrails, sessions, and tracing. The SDK can serialize a paused approval and resume it in a new process. Pretty neat!

Best for: A light agent layer, in Python or TypeScript

Watch out: The core SDK doesn’t do crash recovery, and model-call retries are opt-in. For durability, its docs list integrations with Temporal, Restate, DBOS, and Dapr.

Vercel AI SDK

The Vercel AI SDK is more of a toolkit than a framework, featuring generateText, streamText, tools, and multi-step loops across almost any model provider. It’s what I reach for most often in TypeScript.

Best for: Teams that want to own the loop with minimal abstraction

Watch out: The core loop doesn’t store state, so you save messages yourself (for example, in onFinish). An approval request stops the loop and hands control back to you. For durability, the AI SDK’s WorkflowAgent runs the loop on the open-source Workflow SDK, and Temporal and Restate have AI SDK integrations too.

Common thread: Every framework here needs a durable runtime, either one you bring or a managed one from the same vendor (LangSmith Agent Server, Mastra platform).

Which Durable Execution Platform Keeps Agents Alive?

The durability layer gives you an answer to "What happens when it breaks?" This layer matters more for agents than for regular background jobs. Every retry re-bills tokens, tools have side effects, and human approval waits can stretch for days.

Temporal

Temporal replays an event history to rebuild state, which is why workflow code must be deterministic and why side effects live in Activities. Temporal has integrations for the Vercel AI SDK, OpenAI Agents SDK, LangGraph, Mastra, Pydantic AI, Google ADK and the Claude Agent SDK, among others.

Best for: Polyglot teams with mission-critical workflows or anyone already running Temporal

Watch out: Expect an adjustment period while the team learns the determinism rules. Temporal Cloud bills per Action, and Signals, Updates, and Timers each count as one.

Inngest

Inngest uses step memoization. Each model or tool call goes in step.run(). When a run resumes, Inngest re-enters your function and returns saved results for completed steps instead of repeating work. Steps run inside your app over HTTP or on long-running workers via Connect. Waits don’t hold a worker, and AgentKit adds agent-specific tooling.

Best for: Event-driven teams that want step-level recovery in TypeScript, Python, or Go

Watch out: Calls you don’t want repeated belong in a step. Durable Endpoints (in beta) make normal API routes durable.

Restate

Restate journals every step and replays the journal after a crash. It integrates with the Vercel AI SDK, OpenAI Agents SDK, Google ADK, Pydantic AI and LangChain. Agents can suspend while waiting, on serverless or containers.

Best for: Teams that want journaled durability and durable agent sessions on serverless or container infrastructure

Watch out: You run the Restate server yourself, use Restate Cloud (free tier, then usage-based), or deploy through BYOC. Tool side effects need ctx.run().

DBOS

DBOS is a library, not a server. DBOS checkpoints workflow steps into an existing Postgres database, and it integrates with the OpenAI Agents SDK, Pydantic AI, Google ADK, LlamaIndex, and the Vercel AI SDK.

Best for: Teams already on Postgres that want durability with no new infrastructure

Watch out: The agent runs inside your own app process, on your own hosts. For recovery across servers and autoscaling signals in production, DBOS recommends its Conductor control plane, which is a paid product.

Vercel Workflows

Vercel Workflows turns async TypeScript functions into durable workflows with two directives, "use workflow" and "use step". Each step records its inputs and outputs in an event log, so after a crash or deploy, the workflow replays and skips finished steps. The Workflow SDK is open source, Python support is in beta, and "Worlds" let it run outside Vercel.

Best for: TypeScript teams on Vercel, or anywhere a World runs, especially with the AI SDK’s WorkflowAgent

Watch out: Each step compiles to its own route on your host, so a long step is bounded by that host’s function limits. The workflow function itself must stay deterministic for replay.

AWS Lambda Durable Functions

AWS Lambda durable functions add steps and waits to regular Lambda functions. Progress is checkpointed, a resumed run replays from the start and skips completed steps, and a single execution can last up to one year. Waits are not billed as compute.

Best for: Teams already on Lambda that want durability without another service

Watch out: Managed runtimes cover Node.js, Python, Java, and .NET. Side effects belong inside steps because the handler replays from the top, and each invocation still runs within Lambda’s per-invocation timeout.

Should You Use a Managed Agent Runtime?

Want someone else to host the whole thing? The big clouds can take some of it off your hands, but with certain limitations.

Amazon Bedrock AgentCore Runtime

AgentCore runs any framework in a container, with a dedicated microVM per session and identity built in.

Best for: AWS teams that want per-session isolation without running containers themselves

Watch out: Per AWS's docs, a session's microVM stops after 15 minutes of inactivity by default and after 8 hours at most (up to 14 days on the newer Instances compute type). The next call gets fresh compute, and in-memory state is lost unless you use session storage or AgentCore Memory.

Google Agent Runtime

Formerly Vertex AI Agent Engine, Agent Runtime is now part of the Gemini Enterprise Agent Platform. It runs any framework in a container, with templates for ADK, LangGraph, and LangChain, plus managed sessions and Memory Bank. ADK background jobs can run for up to 7 days.

Best for: Teams building with Google's Agent Development Kit (ADK) on Google Cloud

Watch out: Idle instances scale down after 15 minutes by default, and an interrupted run doesn’t resume where it stopped. You are also tied to Google Cloud.

LangSmith Agent Server

Formerly LangGraph Platform and LangSmith Deployment, LangSmith Agent Server hosts agents from LangGraph or other frameworks, with managed checkpointing, a task queue, crons, and tracing.

Best for: LangGraph teams, or teams on other frameworks that would rather not run Postgres and Redis

Watch out: Managed Cloud starts on the Plus tier, and self-hosting the Agent Server needs a license key from LangChain.

Mastra platform

The Mastra platform is the quickest way to put a Mastra app into production. mastra deploy builds your app into a Docker image and runs it as an API server, with a hosted database, sandboxes, a model gateway, Studio, and observability included.

Best for: Mastra teams that want to build, deploy, and monitor their agents in one place

Watch out: Long, interruptible runs rely on Mastra's own suspend and resume, so durability works the same way as with the framework. There is a free tier, and dedicated compute starts at $25/month.

When Do You Not Need a Dedicated Agent Platform?

You can skip the durable layer if:

  • Runs finish inside a single request
  • Side effects are safe to repeat
  • Restarting from zero is cheap

If a run outlives a request, has side effects, or waits on a human, you need the durable layer.

Which Stack Should You Pick?

Find your own situation below:

If you need to...

Start with…

Control a graph-heavy agent in Python or TypeScript

LangGraph + Postgres checkpointer or LangSmith Agent Server

Run long, interruptible TypeScript agents without running workers

Trigger.dev, with the Vercel AI SDK or Mastra

Add step-level recovery to event-driven TypeScript, Python, or Go apps

Inngest

Add journaled durability on serverless or in containers

Restate

Run polyglot, mission-critical workflows

Temporal

Add durability with no new infrastructure

DBOS

Stay on Vercel end to end

Vercel AI SDK + Vercel Workflows

Stay on Lambda

Lambda durable functions

Stay all-in on AWS or Google Cloud, within session limits

AgentCore or Agent Runtime

If your agents are written in TypeScript and you don’t want to operate the durable layer yourself, leave the job to Trigger.dev. Keep the framework you like, wrap it in a task, then kill a run midway on the free plan ($5 of monthly credit), and watch the retry skip the child tasks that have already finished.

FAQ

What is the best platform to run AI agents in production?

There is no single best one. Choose a framework for the agent logic and a durable execution layer (Temporal, Inngest, Restate, DBOS, Vercel Workflows, Lambda durable functions, or Trigger.dev) for reliability. Managed runtimes like AgentCore provide compute within their limits.

What is durable execution for AI agents?

Durable execution records an agent's progress so a run recovers after a crash, redeploy, or long wait instead of starting over.

Can Amazon Bedrock AgentCore run long-running agents?

Yes, within limits. Per AWS's docs, a session's microVM runs for 8 hours at most (up to 14 days on the newer Instances compute type) and stops after 15 minutes of inactivity by default. The session carries on with fresh compute, but in-memory state is lost unless you use session storage or AgentCore Memory.

Is Trigger.dev an agent framework?

No. It runs TypeScript tasks with retries, queues, checkpointed waits, and tracing. You bring the agent loop (Vercel AI SDK, Mastra, OpenAI Agents SDK, or your own code).