
What Is Cloudflare Workers? Features, Pricing & Alternatives (2026)
Everything you need to know about Cloudflare Workers: features, pricing, pros & cons, and the best alternatives.
Cloudflare Workers
Deploy serverless code globally on Cloudflare's edge network
What Is Cloudflare Workers?
Cloudflare Workers is a serverless compute platform that runs code at the edge of Cloudflare's global network. Unlike traditional serverless platforms that execute functions in regional data centers, Workers deploys code across hundreds of locations worldwide, positioning it physically closer to end users. This architecture reduces latency for API calls, dynamic content generation, and middleware logic.
Workers supports JavaScript, TypeScript, Python, Rust, C, and C++ through WebAssembly compilation. The platform uses V8 isolates rather than containers, which eliminates cold starts and allows functions to begin executing in under 5 milliseconds. Each request routes to the nearest Cloudflare point of presence, where the code runs and returns a response without traveling back to a centralized origin server.
The platform integrates natively with Cloudflare's CDN, DDoS mitigation, and WAF capabilities. Developers can handle authentication, rate limiting, A/B testing, image optimization, and HTML rewriting directly at the edge. Workers also supports persistent storage through KV (key-value), Durable Objects (stateful coordination), R2 (object storage), and D1 (SQL databases), creating a complete edge-native stack without managing infrastructure.
Cloudflare positions Workers as suitable for microservices, API gateways, backend-for-frontend patterns, serverless websites, and middleware that manipulates requests or responses before they reach origin servers. Organizations use it to reduce time-to-first-byte (TTFB), offload compute from overloaded origins, and build applications that respond quickly regardless of user location.
Key Features and Specs
Cloudflare Workers executes code across the company's global network, which spans 300+ cities in over 100 countries. The platform routes each request to the nearest location based on Anycast routing, typically resulting in sub-50ms response times for users worldwide.
Execution Environment: Workers run inside V8 isolates, the same sandboxing technology Chrome uses for browser tabs. Each Worker gets isolated memory and CPU resources but shares the V8 runtime with other Workers on the same machine. This approach delivers faster startup than container-based serverless platforms—Cloudflare reports sub-5ms initialization compared to 100-500ms cold starts on AWS Lambda or Google Cloud Functions.
CPU Time Limits: Free tier Workers receive 10ms of CPU time per request. Paid plans increase this to 50ms on the Bundled plan and 30 seconds on the Unbound plan. CPU time measures actual computation—I/O operations like fetching from KV, making subrequests, or waiting for database queries don't count against the limit. Heavy computation workloads like image processing, cryptographic operations, or large JSON parsing may hit these limits quickly.
Language Support: JavaScript and TypeScript are first-class citizens with full Node.js compatibility layers for many APIs. Python support entered beta in late 2023, allowing standard library usage and integration with Cloudflare's Vectorize and AI bindings. Rust, C, and C++ compile to WebAssembly and run alongside JavaScript. Cloudflare provides Wrangler, a CLI tool for local development, testing, and deployment.
Storage Options: Workers KV provides eventually consistent key-value storage replicated globally, suitable for configuration data, static assets, or session tokens. Read latency typically measures under 20ms. Durable Objects offer strongly consistent, stateful coordination for chat rooms, game servers, or collaborative editing. R2 object storage competes with S3 at lower egress costs. D1, a SQLite-based edge database, handles relational data with automatic replication.
Request Handling: Each Worker can make up to 50 subrequests to external APIs or other Workers. Free tier accounts get 100,000 requests daily. The Bundled plan includes 10 million requests monthly, with additional requests costing $0.50 per million. Unbound pricing charges $2 per million requests plus $12.50 per million GB-seconds of CPU time.
Routing and Domains: Workers attach to routes on domains managed through Cloudflare DNS. A single Worker can handle all traffic for a hostname, or multiple Workers can split traffic based on path patterns. Custom domains require adding the domain to Cloudflare's nameservers, though Workers can proxy requests to any origin regardless of DNS provider.
Cloudflare Workers Pricing
Cloudflare Workers operates on a freemium model with three pricing tiers based on CPU time limits and request volumes.
Free Tier: Developers get 100,000 requests daily across all Workers on an account, with each request receiving up to 10ms of CPU time. This tier includes unlimited Workers scripts (previously capped at 30) and basic access to Workers KV, R2, and D1 with separate free allowances. The free tier suits prototyping, personal projects, or low-traffic APIs handling simple transformations. Organizations hitting the 10ms CPU limit for requests involving complex logic or computation will need to upgrade.
Bundled Plan ($5/month): Includes 10 million requests monthly, with 50ms CPU time per request. Additional requests cost $0.50 per million. This plan works for production applications with moderate traffic and predictable request patterns. The 50ms CPU limit handles most API calls, middleware logic, and HTML transformations without issue. Companies processing dozens of megabytes of data per request or running intensive algorithms may still hit limits.
Unbound Plan ($0 base + usage): Charges $2 per million requests plus $12.50 per million GB-seconds of CPU time. Each request gets up to 30 seconds of CPU time and 128MB of memory (versus 10ms and 128MB on free, 50ms and 128MB on Bundled). This pricing model favors compute-intensive workloads where CPU time varies significantly per request. Organizations running ML inference, image processing, or data transformations benefit from paying only for computation used rather than a flat rate.
Storage Add-ons: Workers KV charges $0.50 per million reads and $5 per million writes after free tier allowances (100,000 reads/day, 1,000 writes/day). Durable Objects bill $0.15 per million requests plus $12.50 per million GB-seconds of active time. R2 storage costs $0.015 per GB monthly with no egress fees. D1 pricing varies by database size and query volume, with a free tier supporting small applications.
Egress Costs: Unlike AWS Lambda or Google Cloud Functions, Cloudflare doesn't charge for bandwidth between Workers and the internet. This creates significant savings for API gateways or applications serving large responses. Organizations previously paying hundreds monthly for Lambda data transfer can eliminate those costs by migrating to Workers.
Pricing scales differently than regional serverless platforms. A Workers application handling 100 million requests monthly with 5ms average CPU time would cost approximately $50 on the Bundled plan ($5 base + $45 for 90 million additional requests). The same workload on AWS Lambda might cost $20 for compute plus $40-80 for data transfer, depending on response sizes and regions.
Performance and Locations
Cloudflare Workers execute across the company's global Anycast network, which includes points of presence in 300+ cities across North America, Europe, Asia-Pacific, Latin America, Africa, and the Middle East. Major metro areas typically have multiple locations—San Francisco, New York, London, Tokyo, Singapore, and Sydney all host Cloudflare infrastructure.
The platform automatically routes requests to the nearest available location based on latency, not static geography. A user in São Paulo connects to Cloudflare's São Paulo or Rio de Janeiro edge, while someone in Mumbai hits the Mumbai location. This differs from regional serverless platforms where developers select specific zones like us-east-1 or eu-west-2 and accept higher latency for distant users.
Workers excel at latency-sensitive workloads requiring global distribution. API gateways, authentication middleware, and request routing benefit from sub-50ms time-to-first-byte regardless of user location. Organizations serving APIs to mobile applications, IoT devices, or geographically distributed customers see measurable improvements compared to single-region deployments.
Cold start performance distinguishes Workers from container-based serverless platforms. Cloudflare's isolate architecture allows Workers to begin execution in under 5ms, compared to 100-500ms for AWS Lambda or Azure Functions when containers must initialize. This makes Workers suitable for synchronous request paths where every millisecond counts—payment processing, real-time bidding, or interactive applications that can't tolerate variable latency.
The platform performs less well for compute-heavy batch processing. CPU time limits of 10ms (free), 50ms (Bundled), or 30 seconds (Unbound) restrict workloads like video transcoding, large dataset transformations, or training machine learning models. Organizations needing hours of continuous computation should use traditional cloud VMs or batch processing services rather than Workers.
Workers integrate directly with Cloudflare's caching layer, DDoS protection, and WAF. A Worker can modify requests before cache lookup, transform responses before caching, or implement custom security logic without deploying additional infrastructure. This positioning between the client and origin server makes Workers effective for header manipulation, A/B testing, personalization, and dynamic content assembly.
Network egress from Workers to external APIs happens from the edge location handling the request. A Worker in Tokyo calling a Tokyo-hosted database experiences lower latency than routing through a central region. However, Workers calling APIs in distant regions still incur round-trip latency—a Worker in Europe fetching from a US-only database won't perform better than a regional serverless function unless the Worker implements caching or request batching.
Who Is Cloudflare Workers Best For?
Cloudflare Workers serves organizations prioritizing global latency reduction, developers building edge-native applications, and teams already invested in Cloudflare's ecosystem.
API Gateway and Middleware: Companies operating APIs consumed by mobile apps, IoT devices, or international customers benefit from Workers' global distribution. Authentication services, rate limiting, request validation, and response transformation execute close to users regardless of origin server location. Teams migrating from regional API gateways like Kong or Tyk gain lower latency for distributed users at comparable or lower cost.
Static Site Enhancement: Developers using static site generators like Next.js, Astro, or Hugo can add dynamic features without provisioning servers. Workers handle form submissions, A/B testing, personalization, authentication, and server-side analytics while static assets serve from Cloudflare's CDN. This architecture keeps infrastructure costs low while enabling interactivity.
Backend-for-Frontend Patterns: Organizations with separate backend services for different client types (web, mobile, third-party integrations) use Workers to aggregate, transform, and route requests. A single Worker can call multiple microservices, combine responses, and return optimized payloads tailored to each client. This reduces bandwidth usage and simplifies client-side logic.
Serverless Websites: Full-stack frameworks like Remix, SvelteKit, and Hono support deploying entirely to Workers, combining server-side rendering, API routes, and static assets on Cloudflare's edge. Developers get sub-50ms TTFB globally without managing load balancers, auto-scaling groups, or CDN configurations. Small-to-medium web applications with moderate compute requirements fit comfortably within Workers' CPU limits.
Image and Content Optimization: Workers transform images, compress responses, minify HTML/CSS/JavaScript, and implement adaptive loading based on client capabilities. Organizations already using Cloudflare for CDN benefit from adding these optimizations without routing traffic to separate image processing services.
Workers suit teams comfortable with JavaScript/TypeScript and willing to adopt Cloudflare-specific APIs. Companies deeply invested in AWS ecosystem services (Lambda, Step Functions, EventBridge) face migration friction. Organizations requiring sustained computation over 30 seconds, GPU access, or workloads with complex dependencies on Node.js filesystem APIs should consider regional serverless platforms or traditional VMs.
Pros and Cons of Cloudflare Workers
Pros:
Global sub-50ms latency: Workers execute in hundreds of locations worldwide, positioning code near users automatically. API calls, authentication checks, and dynamic content generation complete faster than routing to regional data centers. Organizations serving international audiences eliminate the latency penalty of centralized infrastructure.
No cold starts: V8 isolate architecture initializes Workers in under 5ms, compared to 100-500ms container cold starts on AWS Lambda or Google Cloud Functions. Applications with sporadic traffic patterns avoid the unpredictable latency spikes common to container-based serverless platforms. This makes Workers reliable for synchronous request paths where consistent performance matters.
Integrated security and caching: Workers run behind Cloudflare's DDoS protection, WAF, and Bot Management without additional configuration. Developers can implement custom security logic, cache responses with fine-grained control, and manipulate requests before they reach origin servers. This consolidation reduces infrastructure complexity compared to stitching together separate WAF, CDN, and compute services.
No egress charges: Cloudflare doesn't bill for bandwidth from Workers to the internet, unlike AWS, GCP, or Azure. Organizations serving large responses or high request volumes save significantly on data transfer costs. A Workers application returning 1TB monthly in API responses incurs zero egress fees versus $90+ on AWS Lambda.
Multiple language support: JavaScript, TypeScript, Python, Rust, C, and C++ (via WebAssembly) provide flexibility for different use cases. Teams can reuse existing codebases or choose languages optimized for specific tasks—Python for data manipulation, Rust for performance-critical paths, JavaScript for rapid development.
Cons:
CPU time restrictions: The 10ms free tier limit and 50ms Bundled limit constrain computation-intensive workloads. Image processing, cryptographic operations, large JSON parsing, or complex business logic can exceed these caps quickly. The 30-second Unbound limit helps but still prohibits long-running batch jobs, video encoding, or ML training.
Edge computing learning curve: Developers accustomed to traditional serverless or VMs encounter different constraints. Workers discourage filesystem access, long-lived connections, and background processing. Understanding request lifecycle, isolate limitations, and statelessness requires mental model shifts. Teams migrating existing applications must refactor code rather than lift-and-shift.
Vendor lock-in: Durable Objects, Workers KV, and Cloudflare-specific APIs create dependency on Cloudflare's platform. Migrating to AWS Lambda, Google Cloud Functions, or self-hosted infrastructure requires significant rewrites. Organizations uncomfortable with vendor lock-in face difficult trade-offs between Workers' performance benefits and portability.
Limited Node.js compatibility: While Cloudflare implements many Node.js APIs, gaps remain. Packages relying on native modules, filesystem operations, or specific Node.js behaviors may fail. Developers must verify library compatibility or implement workarounds, adding friction to dependency management.
State management complexity: Serverless platforms generally discourage state, but Workers' global distribution amplifies this. Durable Objects provide stateful coordination but introduce consistency and cost considerations. Applications requiring shared mutable state across requests need careful architecture compared to traditional servers with in-memory caches or session storage.
Cloudflare Workers Alternatives
AWS Lambda: Runs functions in specific AWS regions with 1-15 minute execution limits and full access to AWS services. Lambda offers more CPU time per invocation, deeper integration with AWS ecosystem (S3, DynamoDB, SQS), and broader third-party tooling. However, Lambda charges for egress, experiences cold starts of 100-500ms, and requires manual multi-region deployment for global latency. Organizations already on AWS or needing long-running compute should consider Lambda over Workers.
Fastly Compute@Edge: Executes WebAssembly at the edge of Fastly's CDN across 70+ locations. Compute@Edge supports Rust, JavaScript, and Go with sub-millisecond cold starts and no CPU time limits per request. Fastly targets similar use cases as Workers—API gateways, middleware, edge logic—but with a smaller global footprint and higher pricing for most workloads. Teams requiring specialized CDN features or stronger WebAssembly support might prefer Fastly.
Vercel Edge Functions: Provides serverless edge execution optimized for Next.js, SvelteKit, and other frontend frameworks. Edge Functions run globally with sub-50ms latency, similar to Workers, but integrate tightly with Vercel's deployment pipeline and preview environments. Pricing includes generous free tiers for small projects and scales based on execution time. Developers prioritizing frontend frameworks and DX over platform flexibility often choose Vercel. However, Vercel's edge runtime has more restrictive API compatibility than Workers and higher costs at scale.
Deno Deploy: Offers global serverless execution using Deno's JavaScript/TypeScript runtime across 30+ regions. Deno Deploy emphasizes web standards, TypeScript-first development, and compatibility with npm packages. The platform provides simpler pricing ($20/month for 5 million requests) and fewer proprietary APIs than Workers, reducing lock-in. Deno Deploy suits teams valuing standards compliance and portability over the absolute largest edge network.
Final Verdict
Cloudflare Workers delivers on its core promise: globally distributed serverless execution with minimal latency and no cold starts. The platform excels for API gateways, middleware, authentication services, and edge-native applications where sub-50ms response times matter worldwide. Organizations already using Cloudflare for CDN or DNS gain integrated security, caching, and compute without managing additional infrastructure.
The CPU time limits present real constraints. Developers must architect applications to complete meaningful work within 10ms (free), 50ms (Bundled), or 30 seconds (Unbound). Teams accustomed to AWS Lambda's generous execution time or traditional servers with unbounded CPU will need to optimize aggressively or accept Unbound plan costs. Compute-heavy workloads like batch processing, video encoding, or ML training don't fit Workers' execution model.
Workers shine brightest for latency-sensitive synchronous requests
Tools mentioned in this article
Cloudflare Workers
Deploy serverless code globally on Cloudflare's edge network
Ready to try Cloudflare Workers?
Deploy serverless code globally on Cloudflare's edge network
View Cloudflare Workers on ServerSpotter →ServerSpotter Team
Compiled by the ServerSpotter editorial team from provider documentation, published pricing, and published third-party benchmarks. This article is desk research — it is not based on our own hands-on testing of the provider.
Share this article
Stay in the loop
Get weekly updates on the best new hosting and infrastructure providers, deals, and comparisons.
No spam. Unsubscribe anytime.