Skip to content

Runtime APIs

Workers run the Cloudflare-aligned runtime surface in a workerd isolate on this node. For identical APIs, use Workers runtime APIs.

ts
export default {
  fetch(request: Request, env: Env, ctx: ExecutionContext): Response {
    return new Response("ok");
  },
} satisfies ExportedHandler<Env>;

Surfaces

SurfaceCloudflareopen-compute
Handlers (fetch, scheduled, queue)Handlershandlers
Bindings / envBindingsbindings
Cache APICachecache
WebSocketsWebSocketswebsockets; hibernation available
TCP socketsTCP socketstcp-sockets
Node.jsNode.js compatibilitynodejs
fetch / Request / Response / Streams / HTMLRewriter / Web Crypto / RPCRuntime APIsAligned; not restated here
Durable Objects / AlarmsDurable ObjectsDurable Objects product pages
KV / R2 / D1 / Queues / WorkflowsEach product's docsMatching product pages on this site

Compatibility

TopicCloudflareopen-compute
fetch / Request / Response / Streams / HTMLRewriter / Web Crypto / RPCYesYes
Alarms, Version Metadata, WebSocket hibernationYesYes
Workers AI / Vectorize and other non-platform productsYesNot provided
Outbound TCP / fetch network policyCloudflare hosted policySee TCP sockets
Request-scoped CPU / subrequest quotasYesSee Limits