Infra & Deploy · Cloudflare

Cloudflare Workers

The edge — run JavaScript, TypeScript or Rust in 330+ cities, with KV, D1, R2 and Durable Objects behind the same SDK.

Visit workers.cloudflare.com
CategoryPricingCompanyOfficial siteBest for
Infra & DeployFreemiumCloudflareworkers.cloudflare.comLatency-critical APIs, edge personalization and backends that live next to the user

What it is

Cloudflare Workers is serverless compute that runs on Cloudflare’s global network instead of in one region. You write a fetch handler in JS, TS or Rust; it deploys to hundreds of edge locations at once and executes within milliseconds of the user. There are no cold starts in the traditional sense — Workers spin up in under 5ms because they run in V8 isolates, not containers.

The real pitch is the platform around it: Workers KV (a global key-value store), D1 (SQLite at the edge), R2 (S3-compatible object storage with zero egress fees), Durable Objects (stateful coordination, websockets, rate limiters), Queues, Cron Triggers and Workers AI — all binding to the same Worker through one SDK. It’s less a functions product and more a distributed application runtime.

What it actually does

You write a module exporting a fetch handler. wrangler, the CLI, builds, deploys and tails logs. Requests hit the nearest edge location; your code runs there; responses stream back.

# Scaffold and deploy a Worker
npm create cloudflare@latest my-worker
cd my-worker
npm run deploy          # wrangler deploy under the hood
wrangler dev            # local dev with edge bindings emulated
wrangler tail           # live logs from production

# Add bindings: KV, D1, R2, Durable Objects via wrangler.toml

A typical Worker sits in front of your origin and rewrites, redirects, authenticates or personalizes before the cache ever answers. Heavier apps go further: API routes backed by D1, assets served from R2, websockets coordinated through Durable Objects, cron jobs on a schedule. Deploys propagate globally in seconds. Rollbacks and gradual rollouts are built into wrangler versions.

How it compares to alternatives

vs Vercel / Netlify edge functions. All three run code near users. Vercel and Netlify edge functions are conveniences inside a hosting platform; Workers is the whole platform — storage, state, queues, AI, all at the edge, with a decade more edge infrastructure behind it. If you already live on Vercel and need a tiny bit of edge logic, use its edge functions. If you’re building edge-native services, Workers is the deeper bench.

vs AWS Lambda@Edge / CloudFront Functions. Lambda@Edge is powerful but region-pinned deploys, heavier limits and a famously fiddly deploy story. Workers deploys globally in seconds with a saner developer experience. Lambda wins when you’re deep in the AWS ecosystem and need VPC access or 15-minute executions; Workers wins on latency, cost model and iteration speed.

Pricing and free tier

The free plan includes 100,000 requests per day and 10ms CPU time per request — enough to run a real API for a side project at zero cost, forever. The paid plan (around $5/month minimum) lifts to 10 million requests included, with 30s CPU limits on higher tiers and unbound concurrency. KV, D1, R2 and Durable Objects each have their own generous-ish quotas and per-usage pricing; R2’s zero egress fee is uniquely kind. Check workers.cloudflare.com for current numbers.

Where it shines / where it doesn’t

Shines: APIs where latency matters globally, auth and redirect logic before the cache, A/B tests and personalization, webhooks, rate limiting, edge-rendered pages, and any app on Cloudflare’s CDN that wants logic close to users.

Doesn’t: long-running CPU-heavy jobs (ML training, video transcoding), code that needs Node native modules or a filesystem, stateful workloads that don’t fit Durable Objects’ model, and teams allergic to vendor-specific APIs — your Worker is portable-ish, but KV/D1/R2 bindings are Cloudflare-shaped.

Getting started in 3 minutes

# 1. npm create cloudflare@latest my-worker
# 2. cd my-worker && npx wrangler login
# 3. npm run deploy
# Edit src/index.js, redeploy, curl your new *.workers.dev URL

Three minutes to a globally distributed HTTP endpoint. That never used to be a sentence you could type.

PeaBox fit

Workers is where PeaBox puts logic that must run everywhere — redirects on the atlas, auth checks, API glue — without spinning up servers. It pairs well with Vercel or Netlify for the frontend, with Railway or Fly.io holding the stateful backend, and it borrows the same “git push and ship” loop those platforms made normal. For heavier compute that can’t fit the isolate model, drop down to Docker elsewhere.

The honest practitioner take

Workers is the most fun I’ve had shipping backend code in years. Sub-second global deploys, live tail logs, a free tier that actually survives a side project, and an SDK that lets a Worker read a SQLite database at the edge — it’s a genuinely different shape of backend. The mental tax is real: it’s not Node, limits are per-request, and once you wire in KV or Durable Objects you’re married to Cloudflare’s model. For latency-sensitive glue and edge APIs, though, nothing else is close. Start with one Worker sitting in front of your origin; you’ll find more jobs for it than you expected.

Limits and pricing approximate as of Nov 2026; check workers.cloudflare.com before you budget.