ConfigsMay 18, 2026·3 min read

workerd — Cloudflare Workers JavaScript Runtime

workerd is the open-source JavaScript and WebAssembly runtime that powers Cloudflare Workers. It can be self-hosted to run Workers-compatible code locally or on your own infrastructure with the same V8 isolate-based execution model.

Agent ready

This asset can be read and installed directly by agents

TokRepo exposes a universal CLI command, install contract, metadata JSON, adapter-aware plan, and raw content links so agents can judge fit, risk, and next actions.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
workerd Runtime
Universal CLI install command
npx tokrepo install d7bc2488-52f7-11f1-9bc6-00163e2b0d79

Introduction

workerd is the open-source runtime behind Cloudflare Workers, released by Cloudflare in 2022. It uses V8 isolates to run JavaScript and WebAssembly workloads with sub-millisecond cold starts and strong per-request isolation. Unlike Node.js, it implements Web Platform APIs (fetch, Request, Response, crypto) rather than Node-specific APIs.

What workerd Does

  • Executes JavaScript and TypeScript using V8 isolates with Web Platform APIs
  • Runs WebAssembly modules alongside JavaScript workers
  • Provides per-request isolation without the overhead of separate processes or containers
  • Implements the Service Workers API and Cloudflare-specific bindings (KV, R2, D1)
  • Serves as the local runtime behind wrangler dev for Workers development

Architecture Overview

workerd is written in C++ using the Cap'n Proto framework for its configuration and RPC layer. Each incoming request runs in its own V8 isolate, providing memory isolation without process-level overhead. The runtime implements a subset of Web Platform APIs (Fetch, Streams, Web Crypto, URL, TextEncoder) and adds Cloudflare-specific bindings. Configuration is defined in a Cap'n Proto schema file that specifies services, routes, and bindings.

Self-Hosting & Configuration

  • Build from source using Bazel with a C++20 compiler (clang 15+)
  • Configuration uses Cap'n Proto schema files to define workers and routing
  • Bind workers to specific ports and URL patterns via the config
  • Environment variables and secrets are injected through the binding configuration
  • Can run standalone or be embedded as a library in other C++ applications

Key Features

  • Sub-millisecond cold starts using V8 isolate reuse
  • Per-request memory isolation without container overhead
  • Web Platform API compatibility (not Node.js APIs)
  • WebAssembly support for running compiled code alongside JS
  • Same runtime used in production by Cloudflare Workers globally

Comparison with Similar Tools

  • Node.js — general-purpose JS runtime with OS-level APIs; workerd focuses on Web Platform APIs with isolate-level isolation
  • Deno — secure JS/TS runtime; workerd is more specialized for edge/serverless workloads
  • Bun — performance-focused JS runtime; workerd prioritizes isolation and cold start speed over raw throughput
  • WinterJS — Wasmer-based JS runtime; workerd uses V8 and has battle-tested production parity with Cloudflare
  • Fastly Compute — proprietary edge runtime; workerd is open source and self-hostable

FAQ

Q: Can I run workerd locally for development? A: Yes. The wrangler CLI uses workerd under the hood for local development via wrangler dev.

Q: Does workerd support Node.js APIs? A: Partially. A Node.js compatibility layer is available for common modules like Buffer and crypto, but workerd primarily targets Web Platform APIs.

Q: Is workerd suitable for self-hosted production use? A: workerd is designed for Cloudflare infrastructure. Self-hosting is possible but requires building from source and managing the configuration yourself. Community tooling around self-hosting is limited.

Q: What is the difference between workerd and miniflare? A: miniflare was a Node.js-based Workers simulator. It has been replaced by workerd as the local runtime, providing true parity with the production environment.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets