Note: pricing and features may have changed since publication. Check each provider’s documentation for current details.
The best infrastructure for background AI agents depends on the agent's hardest requirement: recovering long runs, isolating untrusted code, or reaching application data. Most production setups combine two layers: an orchestrator and an execution environment.
Unlike a background job, which runs fixed steps, a background agent chooses its next step at runtime, so it needs limits on runtime, cost, and permissions. Its runs typically move from queued to running to waiting (on a tool, a model, or a person) and end as completed, failed, or cancelled.
The term covers two cases:
Key takeaway: A background agent needs seven things from its infrastructure, and no single category covers all seven equally well.
Platform | Type | Runs start from | Longest run | Recovery | Runs on |
| Upsun Cloud task containers | App platform | API, CLI, Console | 24 h (default 1 h) | Caller retries | Containers beside app services |
| Render Workflows | App platform | SDK, API, CLI | 24 h | Retries, step replay | On-demand Render instances |
| Trigger.dev | Durable engine | SDK, schedules | No default limit | Retries, checkpointed waits | Managed or self-hosted workers |
| Inngest | Durable engine | Events, cron | 2 h per step | Step-level retries | Your own compute |
| Temporal | Durable engine | API, schedules, signals | No default limit | Event-history replay | Your own workers |
| Cloudflare Workflows | Durable engine | API, Worker bindings | No wall-clock limit per step | Step retries | Cloudflare Workers |
| Vercel Workflow and Sandbox | Durable engine plus sandbox | Function calls | 24 h (Sandbox, Pro) | Step checkpoints | Firecracker microVMs |
| Modal | Serverless compute | SDK, schedules, web endpoints | 24 h | Configurable retries | Modal containers, GPUs |
| E2B | Sandbox | SDK | 24 h (Pro), 1 h (Hobby) | Pause and resume | Firecracker microVMs |
| Amazon Bedrock AgentCore Runtime | Managed runtime | Invoke API | 8 h per session | New session at limit | MicroVM per session |
| Google Cloud Run jobs | Batch compute | API, scheduler | 168 h (1 h with GPUs) | Up to 10 retries | Cloud Run containers |
| LangSmith Deployment | Framework runtime | API, cron, webhooks | 1 h default, configurable | Per-step checkpoints | Cloud, hybrid, or self-hosted |
Temporal, Inngest, Cloudflare Workflows, and Vercel Workflow save each completed step, so a retried run skips work it already finished. Trigger.dev checkpoints a run while it waits, but a retry re-runs the task from the start unless the work is split into subtasks with idempotency keys.
The trade-off: the engine tracks progress, but the team still decides where the agent runs and how it reaches application data.
E2B and Vercel Sandbox run each sandbox in its own Firecracker microVM, and Modal adds GPU options.
The trade-off: each sandbox starts without the application's data, so database and service access has to be wired in and maintained.
Amazon Bedrock AgentCore Runtime, LangSmith Deployment (formerly LangGraph Platform), and Google Cloud Run jobs host the agent inside one cloud's or one framework's ecosystem.
The trade-off: when agents and applications sit on different providers, each accumulates its own pipeline, runbook, and audit process.
Upsun Cloud and Render run the agent as another workload beside the application. Render Workflows, launched in April 2026, adds durable tasks with retries and step replay.
The trade-off: isolation, GPU support, and built-in recovery vary by platform.
Temporal, Inngest, and Render Workflows replay a failed run and reuse the steps it already completed. Trigger.dev, Google Cloud Run jobs, and Modal retry a failed attempt from the start, up to a configured count. Upsun Cloud does not retry tasks and cancels running tasks before a deploy on the same environment, so an agent there should catch SIGTERM, save progress to a service such as PostgreSQL, and let the caller start a new run.
On any platform, split the work into steps that record their results, keep state in a database rather than on local disk, and set a timeout close to the expected duration so a looping agent stops early.
Inngest's step.waitForEvent, Cloudflare Workflows' step.waitForEvent, and Trigger.dev's waits pause a run without holding compute. On Upsun Cloud, where tasks cannot receive inbound traffic, the agent saves its proposed action to a service and exits, and a webhook or app action starts a follow-up task with the approval as a run-time variable.
How should a background AI agent be isolated and connected to data?
E2B and Vercel Sandbox give each sandbox its own Firecracker microVM, Amazon Bedrock AgentCore Runtime gives each session a dedicated microVM, and AgentCore Identity manages outbound credentials.
Upsun Cloud tasks run in the same Linux containers as applications, with namespace isolation, capability dropping, a seccomp profile, cgroup limits, and network isolation. Upsun recommends running bubblewrap inside the task for untrusted code; it is not built in, and egress scoping is not yet available.
For data access, a task declares relationships only to the services it needs, model keys arrive as sensitive environment variables through Upsun's secrets and environment configuration, and calls to the Upsun API use workload-authorization tokens that last 60 to 900 seconds. Any agent that reads tickets, emails, or web pages can be steered by prompt injection, so scoped credentials are the main limit on what a steered agent can do.
Always-on workers bill while they wait. Run-to-completion compute (Upsun Cloud task containers, Render Workflows, Modal, E2B, Google Cloud Run jobs) bills per second only while a run is active. Trigger.dev does not bill compute while a run is checkpointed, and Cloudflare Workflows charges no CPU time while a run sleeps or waits, although each step is billed.
Upsun Cloud bills tasks per second at application CPU and memory rates, listed on the Upsun pricing page, and does not track token spend, so teams log tokens per run in their own code.
A task is declared under tasks: beside applications: and services:, with its own image, build, and command. It starts on demand, runs that command, and is removed when the command exits. Task containers became generally available on 12 August 2026 and are available on every Upsun Cloud project.
Upsun Cloud regions run on AWS, Google Cloud, Azure, and OVHcloud, with IBM Cloud available through the IBM Cloud marketplace, all under one workflow. Teams whose applications and agents are spread across providers get consistent configuration and audit evidence without manually reconciling separate consoles.
Upsun holds ISO 27001 certification, a SOC 2 Type 2 report, and PCI DSS Level 1 compliance for its regions on AWS, Azure, and Google Cloud; the OVHcloud region is excluded, and HIPAA workloads run only in the US-4 region. Every Git branch can have its own environment, so a new agent version can run on a branch before it reaches production.
Upsun Cloud fits agents that belong to an application, need its data, deploy with it, and finish within a day. For longer workflows, a durable engine can sit on top, because Temporal workers and Inngest functions run on infrastructure the team chooses.
Products in this category include OpenAI Codex cloud, Cursor Cloud Agents (formerly called background agents), the GitHub Copilot coding agent, and Ona. They differ mainly in where the agent's environment runs, what starts a run, and how review works.
Upsun Dispatch connects to GitHub, Jira, Linear, and GitLab. Mentioning @upsun-dispatch implement on an issue starts a run that plans, writes, and self-reviews changes, then opens a linked pull request; @upsun-dispatch review or a push leaves inline review comments. Every run is recorded in the Dispatch console for the whole organization, and a person owns the merge, because agents cannot merge, deploy, or read secrets.
Use case | Consider |
| Runs many multi-step jobs with long waits | Trigger.dev, Inngest |
| Must survive failures across days | Temporal |
| Executes untrusted, model-generated code | E2B, Vercel Sandbox, Modal |
| Needs GPUs | Modal, Google Cloud Run jobs |
| Runs in an AWS-standardized organization | Amazon Bedrock AgentCore Runtime |
| Is built on LangGraph | LangSmith Deployment |
| Is one of many mostly idle, stateful agents | Cloudflare Agents and Workflows |
| Already deploys on Vercel | Vercel Workflow and Sandbox |
| Uses the app's own database and finishes within 24 hours | Upsun Cloud task containers |
| Works on your repositories with human review | Upsun Dispatch, Codex cloud, Copilot coding agent |
Do background AI agents need durable execution?
Background agents need durable execution when runs are long, wait on people or external events, or have side effects that must not repeat. Short runs that can restart from scratch at low cost can run on run-to-completion compute, as long as state is written to a database and actions are idempotent.
Can background AI agents run on serverless functions?
Serverless functions suit only short agent runs, because each invocation has a maximum duration; Vercel Functions, for example, default to 300 seconds. Longer agents run better on a durable engine, a sandbox, a managed runtime, or run-to-completion containers, with the function only starting the run.
How long can an AI agent run in the background?
As of 9 November 2026, published single-run limits range from 8 hours (Amazon Bedrock AgentCore Runtime sessions) to 24 hours (Modal, E2B Pro, Vercel Sandbox on Pro, Render Workflows, and Upsun Cloud task containers) and 168 hours (Google Cloud Run jobs). Temporal and Trigger.dev set no run limit by default.
Can Upsun Cloud run a background agent that needs GPUs?
No. Upsun Cloud does not provide GPUs or host models. Agents on Upsun Cloud call external model APIs, and GPU-bound steps run on a separate GPU platform.
Is Upsun Dispatch the same as Upsun Cloud task containers?
No. Upsun Cloud task containers are a runtime for agents that teams build themselves. Upsun Dispatch is a separate product that runs governed coding-agent workflows on a team's repositories, and each product works without the other.