<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-workerd-the-cloudflare-workers-runtime-is-built-jripr3oyh" -->

---
title: How workerd, the Cloudflare Workers runtime, is built
description: A deep technical walkthrough of workerd, the open-source runtime powering Cloudflare Workers. Covers the full request lifecycle from HTTP socket to JavaScript...
canonical: https://daily.dev/posts/how-workerd-the-cloudflare-workers-runtime-is-built-jripr3oyh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How workerd, the Cloudflare Workers runtime, is built | daily.dev
og:description: A deep technical walkthrough of workerd, the open-source runtime powering Cloudflare Workers. Covers the full request lifecycle from HTTP socket to JavaScript...
og:url: https://daily.dev/posts/how-workerd-the-cloudflare-workers-runtime-is-built-jripr3oyh
og:image: https://api.daily.dev/og/posts/jripR3oYH.png
og:image:alt: How workerd, the Cloudflare Workers runtime, is built
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How workerd, the Cloudflare Workers runtime, is built

**[Flavio Copes](https://daily.dev/sources/flaviocopes)** · 23 min read · 0 upvotes · 0 comments

## Summary

A deep technical walkthrough of workerd, the open-source runtime powering Cloudflare Workers. Covers the full request lifecycle from HTTP socket to JavaScript handler, including the Cap'n Proto configuration system, V8 isolate management, JSG (JavaScript Glue) layer, IoContext per-request ownership, compatibility date system, service bindings and nanoservice model, and the significant gaps between self-hosted workerd and the full managed Cloudflare platform. Also includes practical examples of running workerd directly and compiling self-contained executables.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://flaviocopes.com/workerd>

## Questions this post answers

### What does the compatibilityDate field do in a workerd configuration?

It selects the runtime behavior flags an isolate uses, not just deployment metadata. The compileCompatibilityFlags() function combines the date with explicit enable/disable flags to compile the API surface and semantics for that Worker, letting a newer workerd version still serve old behavior to older Workers so V8 can be updated without breaking every application at once.

_Track how compatibility dates shape Workers behavior on daily.dev before locking in a runtime upgrade._

### Can I run Cloudflare Workers in production without Cloudflare's platform using workerd?

Yes, workerd can be compiled into a self-contained executable with `npx workerd compile config.capnp` and run in production with systemd socket activation, but the standalone binary uses NullIsolateLimitEnforcer so it applies no CPU, memory, or subrequest limits, lacks Cloudflare's global network, multi-tenant security layers, managed storage, and automatic scaling.

_Compare self-hosted workerd against managed Cloudflare Workers on daily.dev before committing to either path._

### Does waitUntil() in a Cloudflare Worker guarantee background tasks complete?

No, waitUntil() only adds a promise to the current request's IoContext so the runtime drains it after the response finishes; a normal process stop can drain these tasks but a sudden process failure removes any unfinished ones. Cloudflare Queues should be used instead when background work must survive failures and retry safely.

_Developers debugging dropped background work can weigh waitUntil() versus Queues on daily.dev._

## Similar posts on daily.dev

- [Cloudflare Workers: your first serverless function](https://daily.dev/posts/cloudflare-workers-your-first-serverless-function-zkqoxjdgf) · Flavio Copes · 0 upvotes · 0 comments
- [Introducing OpenWorkers – Self-hosted Cloudflare Workers in Rust](https://daily.dev/posts/introducing-openworkers-self-hosted-cloudflare-workers-in-rust-ag9dqgae1) · Hacker News · 34 upvotes · 3 comments
- [Introduction to Cloudflare Workers for Web Apps – Master.dev Blog](https://daily.dev/posts/introduction-to-cloudflare-workers-for-web-apps-master-dev-blog-9jviflkpb) · Frontend Masters · 0 upvotes · 0 comments
- [Sandboxing AI agents, 100x faster](https://daily.dev/posts/sandboxing-ai-agents-100x-faster-eysqs4ykc) · Cloudflare · 0 upvotes · 0 comments

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#webassembly](https://daily.dev/tags/webassembly), [#cloudflare](https://daily.dev/tags/cloudflare), [#v8](https://daily.dev/tags/v8)

[View this post on daily.dev](https://daily.dev/posts/how-workerd-the-cloudflare-workers-runtime-is-built-jripr3oyh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How workerd, the Cloudflare Workers runtime, is built","url":"https://daily.dev/posts/how-workerd-the-cloudflare-workers-runtime-is-built-jripr3oyh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-workerd-the-cloudflare-workers-runtime-is-built-jripr3oyh"},"datePublished":"2026-08-09T10:09:21.521Z","dateModified":"2026-09-13T21:45:44.915Z","description":"A deep technical walkthrough of workerd, the open-source runtime powering Cloudflare Workers. Covers the full request lifecycle from HTTP socket to JavaScript...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7219243bb6b6113ecc90bd933965a4ef?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7219243bb6b6113ecc90bd933965a4ef?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Flavio Copes","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Flavio Copes","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/1f2dbd275797411bbd37bfdaaf0951a9","url":"https://daily.dev/sources/flaviocopes"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-workerd-the-cloudflare-workers-runtime-is-built-jripr3oyh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"javascript,webassembly,cloudflare,v8","timeRequired":"PT23M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Flavio Copes","item":"https://daily.dev/sources/flaviocopes"},{"@type":"ListItem","position":3,"name":"How workerd, the Cloudflare Workers runtime, is built"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-workerd-the-cloudflare-workers-runtime-is-built-jripr3oyh#faq","mainEntity":[{"@type":"Question","name":"What does the compatibilityDate field do in a workerd configuration?","acceptedAnswer":{"@type":"Answer","text":"It selects the runtime behavior flags an isolate uses, not just deployment metadata. The compileCompatibilityFlags() function combines the date with explicit enable/disable flags to compile the API surface and semantics for that Worker, letting a newer workerd version still serve old behavior to older Workers so V8 can be updated without breaking every application at once. Track how compatibility dates shape Workers behavior on daily.dev before locking in a runtime upgrade."}},{"@type":"Question","name":"Can I run Cloudflare Workers in production without Cloudflare's platform using workerd?","acceptedAnswer":{"@type":"Answer","text":"Yes, workerd can be compiled into a self-contained executable with `npx workerd compile config.capnp` and run in production with systemd socket activation, but the standalone binary uses NullIsolateLimitEnforcer so it applies no CPU, memory, or subrequest limits, lacks Cloudflare's global network, multi-tenant security layers, managed storage, and automatic scaling. Compare self-hosted workerd against managed Cloudflare Workers on daily.dev before committing to either path."}},{"@type":"Question","name":"Does waitUntil() in a Cloudflare Worker guarantee background tasks complete?","acceptedAnswer":{"@type":"Answer","text":"No, waitUntil() only adds a promise to the current request's IoContext so the runtime drains it after the response finishes; a normal process stop can drain these tasks but a sudden process failure removes any unfinished ones. Cloudflare Queues should be used instead when background work must survive failures and retry safely. Developers debugging dropped background work can weigh waitUntil() versus Queues on daily.dev."}}]}
```

