Stateful AI agents at the edge: Cloudflare Durable Objects and Agents SDK vs AgentCore, Vertex and Foundry
When we put the AWS, Google and Microsoft agent platforms side by side, all three turned out to be variations on the same idea: a managed, isolated runtime you bring your agent to. Cloudflare takes a different route, and that difference is the point here. Instead of hosting the agent in a distant region, it runs it at the edge, inside an object that combines compute with its own storage.
Deciding where to build your agents?
Book a free 30-min call
The short answer
Cloudflare builds agents on Durable Objects: stateful, edge-local, one instance per conversation or entity. The big three offer managed runtimes with deeper model catalogs and heavier compute. The choice comes down to what matters more to you: state locality and low latency, or model catalog and compute depth for longer, heavier work.
What Durable Objects actually are
This is the crux of the whole model. A Durable Object is a special kind of Cloudflare Worker that combines compute with its own storage: each instance has its own SQLite database, is single-threaded, and is globally addressable by a unique ID. It spins up close to where the first request comes from and sleeps when idle. You can have millions of them, one per conversation, user, or document.
That is the difference the big three do not have in clean form: state does not sit in a separate database the agent reaches over the network, it sits right next to the code, in the same instance. Hence the sentence that ties this together: an agent on Cloudflare runs inside a Durable Object. Durable Objects are now available on the free Workers plan, so getting started carries no commitment.
The Cloudflare agent stack in one pass
- The Agents SDK builds stateful agents on Durable Objects: built-in memory, scheduling, WebSocket connections, email handling, an MCP client and server, and tools. You get state management and real-time communication without building them from scratch.
- Workers AI is edge inference on GPUs, billed in units called Neurons ($0.011 per 1,000, with every account, free or paid, getting 10,000 Neurons a day for free). It now runs large models, and AI Gateway can unify billing across Workers AI and third-party providers. Some models require the Workers Paid plan (from $5 a month).
That is enough to build an agent end to end without leaving Cloudflare, though in practice many projects pair the Cloudflare edge with models hosted elsewhere.
The architectural contrast
The shortest statement of the difference: Cloudflare bets on stateful compute co-located with data at the edge; the big three bet on a managed runtime with a deep model catalog and the gravity of their own data ecosystem.
| Dimension | Cloudflare (Durable Objects + Agents SDK) | Big three (AgentCore / Vertex / Foundry) |
|---|---|---|
| State model | State beside compute, one instance per entity | State usually in a separate memory service |
| Location | At the edge, close to the user | A chosen cloud region |
| Startup | Near-zero, no container boot | Runtime-dependent; scale-to-zero on AWS and Azure |
| Model catalog | Narrower (Workers AI + third parties via AI Gateway) | Broad (Bedrock / Vertex Model Garden / Foundry Models) |
| Long, heavy jobs | CPU-time limits (up to 5 min/invocation, default 30s) | Longer runs and GPU for training |
| Languages | JavaScript/TypeScript/WASM | Python and other stacks natively too |
| Data ecosystem | Standalone edge | Deep data gravity in the home cloud |
As of November 2026; this space moves month to month, so verify rates and limits before deciding.
Where Cloudflare’s model wins
- Real-time and collaborative agents - chat, co-editing, live notifications, where per-session state and low latency matter.
- Per-conversation state - one addressable instance per user or thread, without building your own coordination layer.
- Latency-sensitive tool-calling, when the agent reaches for state and tools constantly.
- Global reach with low startup, when your users are spread around the world.
- Cheap, zero-commitment start, thanks to free Durable Objects and 10,000 Neurons a day.
Where the big three still win
- A broad managed model catalog and access to the latest models through Bedrock, Vertex or Foundry.
- Heavy, long compute and GPU for training, which the edge cannot serve.
- Python-first agent stacks and other languages hosted natively, not just JavaScript/TypeScript.
- Deep data gravity - when data and compute sit in one cloud alongside analytics services.
- Enterprise-grade identity, observability and compliance at broad scope.
What this comparison does not settle
As in the big-three comparison, the most expensive line at real traffic is usually model inference, and that is a model choice, not a platform one. State locality, latency and startup are real architectural differences, but they will not dominate an agent’s bill the way token cost does. On top of that, the cost of moving between models and platforms is real. This is an architecture choice for a specific workload, not a table with a verdict.
How Devopsity approaches this choice
We start from your workload, not from a vendor. If the agent is interactive, latency-sensitive and leans hard on per-session state, Cloudflare’s edge model is often a natural fit. If you need a broad model catalog, heavy compute, or you already live deep in one of the big clouds, a big-three managed runtime fits better. Often the best answer is a combination: the Cloudflare edge as the front door, a cloud-hosted model as the backend. We help choose the architecture and cost it across both billing models, as part of our FinOps and cost optimization practice and our work on governing AI agents.
Choosing where to build your AI agents?
Book a free 30-minute call. We will match the architecture to your workload and cost it on the Cloudflare edge and on a big-three platform, with no vendor favorite.
Frequently asked questions
Can you build AI agents on Cloudflare?
Yes. The Agents SDK builds stateful agents on Durable Objects, with built-in memory, scheduling, WebSocket connections, email handling, an MCP client and server, and tools. Workers AI provides inference, meaning models run at the edge. You can build an entire agent without leaving Cloudflare, though in practice many projects pair the Cloudflare edge with models hosted with another provider.
What is a Durable Object?
A Durable Object is a special kind of Cloudflare Worker that combines compute with its own storage. Each instance has its own SQLite database, is single-threaded, and is globally addressable by a unique ID; it spins up close to the first request and sleeps when idle. You can have millions of them, one per conversation or entity. Agents built with the Agents SDK run on Durable Objects, and they are now available on the free Workers plan.
How does Cloudflare differ from AWS Bedrock AgentCore?
Cloudflare runs stateful agents at the edge, keeping compute and data in one instance close to the user. AWS Bedrock AgentCore is a managed, isolated runtime in a chosen region, with a broad model catalog and deep integration with data in AWS. The choice comes down to what matters more: state locality and low latency (Cloudflare) or model catalog and compute depth for longer jobs (AgentCore). It is an architectural difference, not a simple ranking.
How is Workers AI priced?
Workers AI is billed in Neurons, units of GPU work: $0.011 per 1,000 Neurons, with every account, free or paid, getting 10,000 Neurons a day for free. Some models require the Workers Paid plan (from $5 a month). AI Gateway can unify billing across Workers AI and third-party model providers. Verify rates before budgeting, as this space moves quickly.
When should you NOT use Cloudflare for agents?
When you need heavy or long compute or GPU for training, when you build an agent in Python or another stack hosted natively on the big three, when a broad managed model catalog matters, when you need deep integration with data in one cloud, or when you need broad enterprise compliance scope. In those cases AgentCore, Vertex or Foundry fit better. Workers’ CPU-time limits (up to 5 minutes per invocation) also rule out the longest agent steps.
Is this a replacement for AWS, Azure and GCP agent platforms?
No. It is a different architectural model and often a complement rather than a replacement. Many projects pair the Cloudflare edge as a front door (per-session state, low latency, real-time communication) with a big-three-hosted model as the backend (broad catalog, heavy compute). The choice is not about picking a winner but about matching the model to a specific workload.