Overview
Pick Workers for per-request logic that should run close to users; pick Lambda for heavier compute and for functions tied to AWS services or a VPC. Workers run in V8 isolates across Cloudflare’s network (348 cities); Lambda runs in microVMs in the AWS Regions you choose. Limits and prices below were checked on 2026-10-01.
Comparison
| Dimension | Cloudflare Workers | AWS Lambda |
|---|---|---|
| Placement | Cloudflare’s global network by default | Chosen AWS Regions |
| Memory | 128 MB per isolate | 128 to 10,240 MB (about one vCPU at 1,769 MB) |
| Time limit | CPU time: 10 ms per invocation on Free; paid default 30 seconds, up to 5 minutes (15 minutes for Cron Triggers and Queue consumers); no limit on wall-clock duration | 15 minutes per invocation (up to 90 minutes for Lambda Managed Instances async and event-source invocations) |
| Billing | Free: 100,000 requests per day. Paid: 0.30 per million requests and $0.02 per million CPU-ms; duration is not billed | $0.20 per million requests plus GB-seconds; 1M requests and 400,000 GB-seconds free per month; init-phase time is billed |
| Languages | JavaScript, TypeScript, Wasm; Python Workers in beta; nodejs_compat is on by default for compatibility dates from 2026-08-04 | Node.js, Python, Java, .NET, Ruby, custom runtimes, container images up to 10 GB |
| Payloads | HTTP-centric; large bodies through R2 or streaming | 6 MB synchronous request and response; 200 MB streamed response |
| Private resources | Hyperdrive and Tunnel | Native VPC attachment |
| Triggers | HTTP, Cron, Queues, Durable Objects | S3, SQS, DynamoDB Streams, EventBridge, API Gateway, and many more |
Pick Workers when
Pick Workers for request-scoped logic on the hot path.
- Auth checks, redirects, header rewrites, geolocation routing, A/B tests, API gateways, and SSR close to users.
- I/O-bound handlers: waiting on upstream calls costs nothing in duration, because only CPU time is billed.
- Storage bindings (KV, R2, D1, Durable Objects, Queues) with no network setup. See cloudflare-kv and cloudflare-r2.
- Workloads outside the isolate limits can use Cloudflare Containers, which are driven from Workers.
Pick Lambda when
Pick Lambda for heavier or AWS-coupled functions.
- Gigabytes of memory, up to 15 minutes of runtime, native dependencies, or container images.
- Direct access to RDS, ElastiCache, and private services inside a VPC.
- Triggers from S3, DynamoDB Streams, SQS, EventBridge, or Kinesis.
- Longer or multi-step jobs: Lambda Managed Instances, durable functions, and Lambda MicroVMs (up to 8 hours per MicroVM) exist for cases the standard model does not fit.
Port from Lambda to Workers
Rewrite handlers to the Workers fetch handler; this is a rewrite, not a redeploy. Replace native modules, move VPC database access to Hyperdrive, split over-limit work into Queues or Containers, and keep AWS-event-driven jobs on Lambda. See aws-vs-cloudflare for the platform decision.