Workers Runtime versus Node.js
Decide whether code will run on Workers by checking Web APIs, compatibility dates, and Node compatibility.
Edited and verified by Orange Book Editorial Team ·
Core decision
Workers is centered on Web Platform APIs; it is not simply a nearby Node server. Check whether an API exists, then the compatibility date, and only then consider a polyfill.
Three compatibility states
| State | Meaning | Action |
|---|---|---|
| Fully supported | Workers implements the API | Add a small runtime test |
| Partially supported | Only some methods or behavior work | Read the API-specific limits |
| Stub | Import works but calls throw | Never treat a successful build as runtime proof |
For a new Worker whose compatibility date is 2026-08-04 or later, Node.js compatibility and v2 are enabled by default and the official guidance says to omit the positive flag. Do not blindly rewrite an older project: preserve its date, run regression tests, and advance the date deliberately.
Think in edge primitives
export default {
async fetch(request: Request): Promise<Response> {
const url = new URL(request.url);
const upstream = await fetch(`https://api.example.com${url.pathname}`);
return new Response(upstream.body, upstream);
},
};This uses Request, Response, URL, and fetch; it assumes no filesystem, resident process, or mutable memory shared reliably across requests.
Review AI-generated code
- Search for
fs,net,child_process, native binaries, and server-listen code. - Classify each API against the current Node compatibility table; an import is not evidence.
- Execute success and failure branches with
wrangler dev. - Update compatibility dates in an isolated change with behavior notes.
Continue across runtimes and toolchains
- When Bun manages dependencies and invokes Wrangler, deployed code still executes in workerd. The Bun guide to Cloudflare Workers focuses on that boundary.
- Deno and Workers expose many Web APIs, but their permission, persistence, deployment, and Node compatibility models are not interchangeable. Read Deno versus Node and Bun, then bring each dependency back to this page for verification.
Use the related technology guide network for the complete cross-site map.
Primary sources
Did this page help you complete your goal?
Beta feedback is generated in this browser and is never uploaded automatically.
Deploy an AI-built Next.js application to Cloudflare Workers
Put compatibility ahead of migration, then choose among static output, vinext, OpenNext, and retaining the current host with a rollback path.
Deploy your first Worker
Start with a minimal Worker and verify AI-generated edge code, development commands, and response output.