← Back to demos
Developer Platform

What can you build with Workers?

More than edge scripts. Workers can host full-stack web apps, APIs, AI agents, static sites, mobile backends, and framework-based applications on Cloudflare's global network.

Full-stackSSR, routing, forms, assets, and APIs in one deploy target
BindingsStorage, AI, queues, media, and services without tokens in code
FrameworksBring the tools your team already knows
Start the story
Why this matters now

AI is changing how many apps get built.

Code is cheaper. App count goes up. The bottleneck moves from writing software to running it safely, globally, and without infrastructure glue.

The platform job changed

More apps More agents More integrations More bursty work

Absorb the spike. Give every app platform services. Scale to zero when the work disappears.

Code costDownmore prototypes and internal tools
App countUpmore routes, APIs, workers, agents
Runtime shapeBurstyshort-lived task-specific runs
Platform jobAbsorb itcompute + bindings + observability

More apps only helps if the runtime can absorb them. So the next question is overhead: how small can the deployable unit become?

Runtime evolution

From server fleets to lightweight isolates.

Workers uses V8 isolates instead of provisioning a VM or container per unit of work. Less runtime per app, more apps per machine, faster scale-down to zero.

Why it matters

The less runtime you duplicate per app, the easier it is to run many small, globally distributed pieces of code — bursty APIs, full-stack routes, and agent workloads included.

Servers

One box, one app, operational ownership of OS, runtime, packages, and capacity.

VMs

Better isolation and scheduling, but each unit still carries a lot of runtime surface.

Containers

Great packaging model, but still a heavier unit than code running in a shared isolate runtime.

{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}
{}

Workers isolates

Lightweight user code running on Cloudflare's global runtime, surrounded by platform bindings.

Lightweight compute is the start, not the whole platform. The real leverage appears when storage, AI, media, and orchestration are native bindings.

One Worker, many bindings

The platform shows up as native capabilities.

A Worker is the request path. Bindings are the platform around it — data, AI, media, orchestration, and network controls — exposed directly to code without hand-rolled API-token plumbing between every service.

Worker
runtime
Workers · WfP · DOcompute and state
D1 · R2 · KVdata and files
Workers AI · Vectorizemodels and context
Stream · Images · Realtimemedia pipelines
WAF · CDN · DNSnetwork controls
Queues · Workflowsbackground work

Groups to remember

Compute Storage AI Workers for Platforms Media Network Orchestration

This is the mental model to land: Workers is not isolated from the platform. It is the place where the platform is composed.

Multi-tenant computeWorkers for Platforms lets a platform run customer or tenant logic on top of Workers.
Storage choicesKV for global low-latency key/value, D1 for SQLite, R2 for objects, Hyperdrive for existing Postgres/MySQL.
Media primitivesStream, Images, and Realtime keep video, image, and live media workflows close to the app.

Once the platform is available inside the Worker, the same model can host websites, APIs, tenant code, agents, storage-backed apps, and media workflows.

Full-stack web apps

Use the framework your team already knows.

Workers becomes the deployment target for modern web applications: server-rendered routes, APIs, static assets, and edge logic all living close to users.

Production web frameworks

React Router Next.js Astro Vite Nuxt SvelteKit Vue Angular TanStack Start Solid Qwik and more
React Routernpm create cloudflare@latest -- rr-app
# choose React Router
Next.jsnpm create cloudflare@latest -- next-app
# choose Next (via @opennextjs/cloudflare)
Astronpm create cloudflare@latest -- astro-app
# choose Astro
Vite + Reactnpm create cloudflare@latest -- vite-app
# choose Vite
BuildC3 scaffolds framework projects for Workers.npm create cloudflare@latest
BindConnect to D1, R2, KV, Durable Objects, Queues, Workers AI, and more.bindings → env.DB / env.AI / env.BUCKET
DeployUpload a version, preview at a per-version URL, then promote with gradual rollouts (1% → 100%). Instant rollback to any prior version. Logs, traces, and version metadata in the dashboard.wrangler versions upload → wrangler versions deploy

Not every workload starts as a full-stack app. Some begin as one route, one API, or one integration point.

APIs and backends

Start tiny. Add structure when the API earns it.

Workers can be a single request handler, a structured API, or a backend that sits in front of other services. You choose how much framework you need.

Backend options

Plain Workers Hono FastAPI

Use vanilla JavaScript or TypeScript for small APIs, Hono for lightweight routing, or Python support where that ecosystem fits the workload.

HTTP APIsAuth, routing, middleware, webhooks, and request normalization at the edge.
BackendsRead and write to storage bindings without exposing API tokens.
IntegrationQueue slow work, call services, or front existing origins with Worker logic.

Then the same request path can become intelligent: retrieve context, choose a model, call tools, keep state, and queue follow-up work.

AI and agents

AI runs as a binding. Agents compose on top.

Workers AI runs 50+ open-source models on Cloudflare's GPU network — Llama, Mistral, Stable Diffusion, Whisper, BGE embeddings — billed per request, no GPUs to provision. AI Gateway puts the same code path in front of external providers (OpenAI, Anthropic, Replicate, Google AI, Groq) with caching, logging, rate limits, and BYOK key management.

AI building blocks

Workers AI AI Gateway Vectorize Agents SDK BYOK LangChain

Workers AI is the inference layer. AI Gateway is the control plane. Vectorize and Agents SDK compose on top.

User promptmessages[]
Workercalls env.AI.run()
Workers AImodel response
env.AI.run("@cf/meta/llama-3.1-8b-instruct", { messages: [{ role: "system", content: SYSTEM_PROMPT }, { role: "user", content: userContent }], max_tokens: 300 })

Open models on Workers AI

50+ open-source models on Cloudflare's GPU network. One binding (env.AI). Pricing uses Neurons, a metric for the actual processing power used: $0.011 per 1,000 Neurons, with 10,000 free Neurons per day.

Llama 3.1 Mistral Stable Diffusion Whisper BGE embeddings + 45 more

External providers via AI Gateway

Same code path, BYOK, cached and logged. Switch providers without changing the Worker.

OpenAI Anthropic Replicate Google AI Groq + more
InferenceWorkers AIOpen models on Cloudflare's GPU network via env.AI.
GatewayAI Gateway + BYOKCache, log, rate-limit, and centralize provider keys.
ContextR2 + VectorizeDocuments, chunks, embeddings, and retrieval.
StateDurable Objects + WorkflowsCoordination, long-lived sessions, multi-step tasks.

Compute and AI need state. The platform exposes storage as Worker bindings — pick the shape that matches the access pattern.

Storage

Pick the storage shape that fits the workload.

Different access patterns deserve different storage. The platform exposes each primitive as a Worker binding, so the same code path can read from key/value, SQL, objects, an existing relational database, or strongly consistent per-key state.

Storage primitives

KV D1 R2 Hyperdrive Durable Objects

Five bindings cover most application data needs. Mix per app — KV for the hot path, D1 for relations, R2 for files, Hyperdrive in front of an existing database, Durable Objects when state must be strongly consistent.

Edge readsKV serves config, sessions, and feature flags from a globally replicated key/value store at sub-millisecond latency.env.KV.get(key)
RelationalD1 is SQLite at the edge with read replicas. Hyperdrive pools and caches in front of existing Postgres or MySQL.env.DB.prepare(sql)
Objects and stateR2 stores files with zero egress. Durable Objects give strongly consistent per-key state for coordination and real-time.env.BUCKET.put(key, body)
Key/valueKVGlobally replicated, eventually consistent. Config, sessions, feature flags, edge cache.
SQLD1SQLite at the edge with read replicas. Relational data without a separate database service.
ObjectsR2S3-compatible object storage with zero egress fees. Media, backups, datasets, build artifacts.
Bring your DBHyperdriveConnection pool plus cache in front of existing Postgres or MySQL. Keep the database, gain edge speed.
Per-key stateDurable ObjectsStrongly consistent state and compute per key. Coordination, sessions, real-time, multiplayer.
Spotlight

Durable Objects: one global object per key.

A Durable Object is a tiny serverless actor with its own SQLite database, WebSockets, timers, and one globally agreed identity — perfect for anything that must coordinate live state.

  • One identity, one living object: chatRoom:42, match:abc, or userSession:xyz always routes to the same global instance — no lookup service, no sticky-session hacks.
  • Business logic sits beside its data: code runs next to embedded SQLite, so the decision, the write, and the read happen inside the same tiny actor.
  • Concurrency gets simple: execution is single-threaded per object, so inventory counts, room state, reservations, and game moves do not race each other.
  • Real-time is a primitive, not a sidecar: WebSockets, alarms, and timers are built in for presence, live sessions, coordination, and background follow-ups.
  • Globally reachable, locally useful: any Worker can call the object, and Cloudflare keeps the canonical instance close to the users who need it.

Mental model: a tiny serverless actor with a database that the entire world agrees on — the missing stateful building block for global applications.

Where customers feel the magic Chat rooms · multiplayer matches · collaborative docs · bookings with no double-books · live auctions · presence · leaderboards · rate limiters · workflow state.

Worker A
Worker B
Worker C
id: chatRoom:42
Code SQLite WebSockets Alarms

One instance worldwide. Strong consistency by default.

Put it together — compute, AI, storage, media, network, orchestration. This is what changes when "serverless" becomes "platform".

The bigger picture

Workers is not a serverless function. It is the platform.

Lambda gave us isolates without the platform around them. Workers is the inverse: a real runtime with storage, AI, media, queues, security, and network controls all bound directly to code. One programmable edge. No glue between services. No infrastructure to provision. Scale to zero, scale with the internet.

Why it lands

Compute is the start, not the product. The product is what you can compose around it — inference next to data, retrieval next to context, state next to coordination, the CDN and WAF already in the request path. That is the platform Workers ships.

5.5M+ developers already building on the Cloudflare developer platform
Cost & scalability

Scale up and down to zero.

No pre-provisioned GPUs, VMs, or containers. Compute-based pricing — pay nothing when idle, pay per request when busy. Apps that wait on I/O do not pay for the wait.

Performance

Deploy from region: Earth.

Code runs within 50 ms of ~95% of the internet-connected world. Smart Placement and bindings keep compute next to the data, models, and services it needs.

Developer experience

All the products you need.

Inference, state, storage, media, queues, deployment, observability — in one platform, behind one binding model. Local dev with Wrangler, idea to production in seconds.

What's next

Built for agents — Dynamic Workers.

The same platform that runs the request path is the one agents will deploy into. Cloudflare is the fastest, most secure, and most cost-effective place to build, deploy, and scale agents and the code they generate.

Because isolates can share the runtime across many runs, user or agent code can run with dramatically less process overhead — up to 100x more efficiently.

▱ Containers

More duplicated process overhead

[·] Isolate model

Many runs share one lightweight runtime
See it live

The build patterns become real demos.

The categories above explain what you can build. These demos show the same platform primitives in motion: media, agents, retrieval, queues, AI, and multi-cloud ingress.

Stream · Access Control

Three videos, three postures: public, origin-restricted, signed-URL gated. Signed video uses the Stream binding to mint short-lived JWTs server-side.

StreamWorkers bindingJWT

AI Agents · Zero Trust

One Agent, one MCP Server Portal, three MCP servers behind Access. Tools discovered at runtime; every call crosses a real Zero-Trust boundary. Workers AI generates images; D1 / R2 / KV store results.

Agents SDKMCP PortalAccessAI Gateway

RAG on the edge

Docs into R2 → QueueWorkflow → Workers AI embeds → vectors in Vectorize. At chat time, query vector + top matches stitched into the LLM prompt. Six bindings, one Worker.

Workers AIVectorizeR2QueuesWorkflows
View slides

Edge ingress · multi-cloud

Cloudflare edge validates and normalises events, pushes clean payloads into a Queue. A GCP Cloud Run backend pulls via HTTP and acks. Bot mitigation, queueing, and AI visibility in one path via AI Gateway.

QueuesAI GatewayWorkersMulti-cloud

Workflows · durable execution

A 9-step space mission: SWAPI fetch → AI analysis → AI risk assessment → human-in-the-loop pause → AI report → KV archive. Arm a mid-flight "bomb" to fail a step — previous outputs stay preserved, retry recovers without re-running the AI calls.

WorkflowsWorkers AIKVstep.waitForEvent