Cloudflare Workers — Library index

Canonical reference for Cloudflare Workers — V8-isolate serverless compute on 330+ POPs, with the deepest stack of edge-native primitives in the industry: Durable Objects (strongly-consistent stateful compute with SQLite storage), KV (eventually-consistent global key-value), R2 (S3-compatible zero-egress object storage), D1 (SQLite at edge), Queues, Vectorize (vector DB), Workers AI (open-weight LLM inference), AI Gateway, Cloudflare Agents SDK, Workflows (durable execution), and Hyperdrive (Postgres / MySQL connection pooling). Companion sub-library to _index (the other major edge platform) and the model-provider sub-libraries (_index, _index).

The architectural bet Cloudflare made — that V8 isolates are the right primitive for edge compute, not containers or microVMs — has aged extraordinarily well. A Worker cold-starts in 5-50ms (vs Lambda’s 200ms-2s), runs in 128MB of RAM at every one of 330+ POPs, and has access to a steadily-expanding catalog of edge-native data products. Durable Objects (released 2020, GA 2021) and their evolution into SQL-storage-by-default with WebSocket Hibernation (2024-2025) have quietly become one of the most interesting building blocks for stateful serverless apps — enabling multiplayer games, real-time collaboration, and “serverless databases” that earlier serverless platforms struggled with. The 2024-2025 launches of Workers AI, Vectorize, AI Gateway, Cloudflare Agents SDK, and Workflows position Cloudflare as a credible end-to-end AI / agent platform without ever leaving the edge.

This sub-library lives inside Math-and-Compute/Compute/ as a sibling of _index and the other compute references. Notes are version-pinned to 2026-05-25 — Cloudflare ships features weekly and rebrands aggressively (Workers Sites → Pages → Workers Assets has been three names for nearly-the-same product across 5 years). Verify against developers.cloudflare.com before quoting specific syntax.

See also

Library contents

Foundations

FileWhat it covers
workers-runtime-and-deploymentV8 isolate model, cold-start economics (~5-50ms), memory + CPU limits (Free vs Paid), Wrangler CLI, wrangler.toml, miniflare local dev, smart placement, 330+ POPs, deployment lifecycle
workers-runtime-apisWeb-standard runtime — fetch, Request/Response, Headers, URL, URLPattern, Streams, Crypto, TextEncoder/Decoder, WebSockets server, Email Workers, sockets API, Hyperdrive (Postgres+MySQL pooling), Node.js compatibility (nodejs_compat flag)

Stateful primitives

FileWhat it covers
workers-bindings-and-storageBindings catalog: KV, R2, D1, Durable Objects, Queues, Vectorize, AI binding, Workflows, Browser Rendering, Service Bindings. wrangler.toml syntax for each
durable-objects-and-sqlite-storageDO addressability (idFromName / idFromString / newUniqueId), isolated state per DO, WebSocket Hibernation (alarms not connections drive billing), SQLite-in-DO (default 2024+), DO Containers preview, canonical use cases (multiplayer / rate-limiting / per-user session / serverless databases)

AI

FileWhat it covers
workers-ai-and-agentsWorkers AI catalog (Llama 3.3, Llama 3.1, Phi-3, Mistral Small, DeepSeek-R1, embedding models, image models, audio), AI Gateway (analytics + caching + rate limits + fallbacks across providers), Vectorize, Cloudflare Agents SDK (durable AI agents with DO state, tools, scheduled execution, human-in-the-loop)

Async / orchestration

FileWhat it covers
workers-workflows-and-asyncCloudflare Workflows (durable execution — like Temporal/Inngest at edge), Queues (producer/consumer + DLQ + batching), Cron Triggers, Pipelines (data streaming), Tail Workers (observability)

Operational

FileWhat it covers
hidden-tricks-and-gotchas-cloudflare-workersSQLite-in-DO for free-tier databases, WebSocket Hibernation for cheap long-lived connections, smart placement near origin DBs, Service Bindings for zero-cost worker-to-worker calls, wrangler dev --remote vs --local, compatibility_flags for Node.js compat, R2 zero egress as drop-in S3, Pages Functions vs Workers convergence, Vectorize as cheaper Pinecone, Workers AI as cheaper Anthropic for Llama-tier models

How to use this library

  1. Picking a runtime model — start at workers-runtime-and-deployment for the V8-isolate model + when to use Workers vs Pages Functions.
  2. Building a stateful appdurable-objects-and-sqlite-storage is the canonical primitive. Use DOs over D1 when you need per-entity strong consistency.
  3. Building an AI appworkers-ai-and-agents for the Workers AI catalog + Agents SDK + AI Gateway.
  4. Async / event-drivenworkers-workflows-and-async covers Workflows + Queues + Cron Triggers.
  5. Cost optimizationhidden-tricks-and-gotchas-cloudflare-workers has the WebSocket Hibernation, Service Bindings, and Vectorize-vs-Pinecone math.

Conventions used in this library

  • Code examples use TypeScript with the Env type pattern (Cloudflare’s recommended). wrangler.toml is the legacy format; wrangler.jsonc (JSON with comments) is supported and increasingly preferred in newer projects — examples include both.
  • Pricing is in USD as of 2026-05-25. Where multiple \$ symbols appear on the same line they are backslash-escaped to avoid Obsidian MathJax interpretation.
  • Plan names: Free (5/mo minimum, then usage-based), Enterprise (custom).
  • “Per developers.cloudflare.com 2026-05” tags a claim sourced from official documentation as of the file’s created date.

Sources read while building this library (2026-05-25 pass)

  • developers.cloudflare.com/workers/ (Workers root)
  • developers.cloudflare.com/workers/runtime-apis/
  • developers.cloudflare.com/workers/wrangler/
  • developers.cloudflare.com/workers/configuration/bindings/
  • developers.cloudflare.com/workers/platform/pricing/
  • developers.cloudflare.com/workers/observability/
  • developers.cloudflare.com/durable-objects/
  • developers.cloudflare.com/d1/
  • developers.cloudflare.com/r2/
  • developers.cloudflare.com/kv/
  • developers.cloudflare.com/queues/
  • developers.cloudflare.com/workers-ai/
  • developers.cloudflare.com/agents/
  • developers.cloudflare.com/workflows/
  • developers.cloudflare.com/pages/
  • developers.cloudflare.com/vectorize/
  • developers.cloudflare.com/hyperdrive/
  • github.com/cloudflare/workerd (the runtime, MIT-licensed)
  • github.com/cloudflare/agents (Agents SDK source)

Where official docs are silent but behavior is observable (exact V8 isolate reuse policy, undocumented compatibility_flags, billing edge cases), entries are labelled “Undocumented as of 2026-05-25 — observed behavior” so a future reader knows to verify.