Skip to content

Research: Cloudflare Workers for Platforms as the managed execution path #307

Closed

Description

@allisonmahmood

Part of #294.

Question

Is Cloudflare Workers for Platforms a serious managed path for tier 2 handler execution, given that company data stays in Azure behind Patchy's broker and every data call would cross Cloudflare to Azure? Establish from primary sources: dispatch namespaces and per-script upload API, per-request CPU-ms and subrequest limits set by the dispatcher, Outbound Workers for egress interception, memory and script-size limits, WebSocket and Durable Object options for live connections and whether they are needed under Patchy-owned subscriptions, deployment lifecycle (upload latency, versioning, rollback, deletion), secrets and bindings, data residency and jurisdiction controls, logging and error surfaces, pricing at 1,000 and 10,000 mostly idle patches, and the contractual terms for hosting customers' code. Then the data path: measured or documented latency between Cloudflare's edge and Azure regions, and what a chatty CRM handler (ten callbacks per invocation) would pay. Name the concrete disqualifiers, if any, for a private-cloud promise made to companies, and what the spike must measure.

Output: findings as the resolution comment on this ticket. Two models in parallel per the map's Notes.

Activity

  1. added
    wayfinder:research
    on Sep 19, 2026
  2. allisonmahmood commented on Sep 19, 2026

    @allisonmahmood
    OwnerAuthor

    Report A: Claude Opus 5 (full findings)

    R2 — Cloudflare Workers for Platforms as the managed execution path

    Research for #307, part of the tier-2 map (#294). Primary sources only; every claim below carries the URL it came from, and each source was re-opened in a verification pass.

    Summary

    • Workers for Platforms is explicitly sold for this job: "Workers for Platforms lets you run untrusted code written by your customers, or by AI, in a secure hosted sandbox" (overview). Patchy would upload one script per patch into a dispatch namespace and route to it from a dispatch Worker via env.DISPATCHER.get(name, { props }, { limits, outbound }) (dynamic dispatch).
    • The dispatcher can cap each invocation: limits: { cpuMs, subRequests }, and "If a user Worker hits either of these limits, the user Worker will immediately throw an exception" (custom limits). No default or maximum for either value is documented.
    • Outbound Workers are in-runtime egress interception: they "sit between your customer's Workers and the public Internet", give "visibility into all outgoing fetch() requests", support "allow, or block lists for hostnames", and when enabled the raw TCP connect() API becomes unavailable. They do not intercept fetches from Durable Objects or mTLS bindings (outbound workers).
    • Platform limits are the standard Workers ones: 128 MB memory per isolate, 64 MiB uncompressed Worker size with "no compressed size limit", 1 second startup time, 10,000 subrequests per request on paid, 6 simultaneous open connections awaiting response headers, 128 env vars/Worker at 5 KB each (Workers limits).
    • Billing is CPU-time, not wall-clock: "you are billed based on CPU time, and never for the idle time that your Worker spends waiting on network requests" (pricing blog), and "No charge or limit for duration" (Workers pricing). A handler blocked 300 ms on Azure costs nothing for the waiting.
    • Pricing: $25/month including 1,000 scripts, 20 M requests and 60 M CPU-ms; +$0.02 per additional script, +$0.30 per additional million requests, +$0.02 per additional million CPU-ms (W4P pricing). 1,000 idle patches ≈ $25/month; 10,000 idle patches ≈ $205/month before traffic.
    • A chatty handler is nearly free in money: "Workers for Platforms only charges for 1 request across the chain of dispatch Worker -> user Worker -> outbound Worker", "CPU time is charged across these Workers", and "Cloudflare does not bill for subrequests you make from your Worker" (same pricing page). Ten Azure callbacks add CPU-ms for the Outbound Worker, not ten request charges.
    • The ten-callback cost is latency, not dollars. Cloudflare's own figure for sequential queries to a regional database is "20-30ms from a distant region, or 1-3ms when placed nearby" (how Hyperdrive works). Ten sequential callbacks therefore sit somewhere between ~10 ms and ~300 ms of added round trips, depending entirely on placement.
    • Placement is the lever, and Cloudflare names Azure directly: placement.region = "azure:eastus" runs the Worker "in the Cloudflare data center with the lowest latency to the specified cloud region", and the feature is "most useful when your Worker makes multiple round trips" (placement, changelog). Smart Placement claims "4-8x" improvement on a three-round-trip workload (Smart Placement blog). Neither doc says whether placement applies to user Workers in a dispatch namespace.
    • Deployment is one synchronous PUT /accounts/{id}/workers/dispatch/namespaces/{ns}/scripts/{name} multipart upload, deletion is the matching DELETE, and since Feb 2025 "First-time uploads of User Workers are now deployed synchronously" so a 200 means dispatchable (API, changelog).
    • There is no version/rollback surface for user Workers: the scripts resource exposes only content, settings and assets, and "Gradual Deployments is not supported yet for user Workers" (W4P limits). Rollback means re-uploading a stored bundle — which is exactly what Patchy's own immutable-version-plus-pointer model already does.
    • Secrets are write-only after creation: PUT/GET/DELETE …/scripts/{name}/secrets, and the get endpoint "retrieves a given secret binding (value omitted)" (Workers for Platforms API). Bindings must be declared in the multipart metadata object; KV, D1, R2, Durable Objects, Queues, Workflows, Containers, VPC Services/Networks, Hyperdrive and Analytics Engine are supported (bindings).
    • Residency is the sharp edge: "Workers code and secrets are deployed globally to all Cloudflare data centers." Regional Services "restricts where Workers are executed (where requests are processed)" only, applies only to custom domains, and "does not extend to outgoing subrequests from Workers to other services" (data localization for Workers).
    • Live connections do not need Durable Objects if Patchy owns the subscription. A plain Worker can accept a WebSocket with WebSocketPair (example); Durable Objects are only needed as a "single-point-of-coordination" for fan-out, which Patchy's Azure broker already is. DO adds 128 MB-based GB-s billing "regardless of actual usage" and a second data-location story (DO pricing).
    • Contractually Cloudflare permits the arrangement — "you may use Workers for Platforms to make available certain Workers functionality for use by your End Users on your Internet Properties" — but "you are solely responsible for the acts of your End Users" and Cloudflare "may … limit or suspend your or your End Users access" (developer platform terms). One account-level suspension takes every company's tier-2 patches down at once.

    Detail

    Dispatch namespaces and the per-script upload API

    A dispatch namespace is bound to the dispatch Worker in Wrangler config (dispatch_namespaces: [{ binding: "DISPATCHER", namespace: "…" }]), and routing is env.DISPATCHER.get(workerName) with optional props for per-request data and a third argument carrying limits and outbound (dynamic dispatch). Cloudflare documents KV-based, subdomain-based and path-based routing patterns; Patchy already resolves patch → version server-side, so the dispatch Worker would look up a script name from the address rather than from KV.

    Upload is PUT /accounts/{account_id}/workers/dispatch/namespaces/{dispatch_namespace}/scripts/{script_name} as multipart/form-data with a metadata JSON part (main_module, bindings, compatibility_date, observability) and one or more module files; "bindings must be specified in the metadata object of your multipart upload request. You cannot upload the Wrangler configuration file" (bindings). A content-only replace is available at …/scripts/{name}/content, settings at …/scripts/{name}/settings, and deletion at DELETE …/scripts/{name} (API resource index). Up to eight tags per script are allowed (W4P limits) — enough for company, patch, version, tier, release.

    Client API rate limits bound the deploy path: 1,200 requests per 5 minutes per account token, 200 per second per IP, 500 API tokens per account (same limits page).

    Dispatcher-set CPU-ms and subrequest limits

    limits: { cpuMs, subRequests } on the get() call. The doc's example is { cpuMs: 10, subRequests: 5 }. Exceeding either makes the user Worker "immediately throw an exception", which the dispatch Worker catches — so Patchy can turn a runaway patch into a first-party error page rather than a hung request. Neither a default nor a maximum is published; the account-wide ceiling is 30 seconds of CPU per invocation on the W4P plan (W4P pricing) and 10,000 subrequests on paid (Workers limits).

    This is the single feature that no other managed candidate in the tier-2 prior art (#13) offers: a per-invocation CPU and subrequest budget set by the platform, per request, from outside the tenant's code.

    Outbound Workers

    Every fetch() from a user Worker fires a FetchEvent on the Outbound Worker, which receives binding-declared parameters (for example customer_name, url) plus per-request outbound.requestContext passed at dispatch time. Hostname allow/block lists are the documented use. Enabling an Outbound Worker disables connect() for TCP sockets, "ensuring all outbound communication routes through the Outbound Worker's fetch method" (outbound workers).

    For Patchy this maps almost exactly onto ADR-0010's model: patch code has no ambient authority, and every data call is a brokered operation. The Outbound Worker becomes the server-side twin of the tier-1 broker — it can refuse anything that is not Patchy's own broker host, and stamp the patch/version/principal headers itself so patch code cannot forge them. The documented gaps are Durable Objects and mTLS bindings, neither of which Patchy would grant a patch.

    Memory and script size

    128 MB per isolate, all plans. Worker size 64 MiB uncompressed, with "no compressed size limit. Only the uncompressed bundle size counts." Startup time 1 second. 6 simultaneous open connections awaiting response headers — this one matters: a handler that fans out ten parallel callbacks will serialise past six. Workers per account is 100/500 on Free/Paid, with a footnote that W4P is the escape hatch; the W4P limits page says "Cloudflare provides an unlimited number of scripts for Workers for Platforms customers", which is a cap statement, not a price statement — the pricing page still bills $0.02 per script above 1,000.

    caches.default "is disabled for namespaced scripts" for isolation.

    WebSockets and Durable Objects

    A plain Worker can terminate a WebSocket via WebSocketPair, returning the client half in a 101 response. Cloudflare's caveat is about coordination: "If your application needs to coordinate among multiple WebSocket connections … you will need clients to send messages to a single-point-of-coordination", and that is what Durable Objects are for (WebSockets example).

    Patchy's tier-2 shape already names Patchy as that point: the product doc promises that "two people with the same patch open can be kept in sync", and the subscription is Patchy-owned, running in front of Patchy-owned primitives in Azure. Under server-owned subscriptions Durable Objects are not needed, and avoiding them removes the DO billing model (requests $0.15/M including "HTTP requests, RPC sessions, WebSocket messages, and alarm invocations" with a 20:1 ratio on incoming WebSocket messages; duration $12.50 per million GB-s against "128 MB of memory your Durable Object is allocated, regardless of actual usage") and the second residency story. Hibernation does remove idle duration charges — "Billable Duration (GB-s) charges do not accrue during hibernation" (DO WebSockets) — but that is a mitigation for a complexity Patchy does not have to take on.

    Deployment lifecycle

    Upload is synchronous since 20 Feb 2025: previously "there was a short delay before it became available for dispatch … even though an API request could return a 200 OK response, the script might not yet be ready to handle requests, causing unexpected failures". No wall-clock figure for the upload itself is published — that is a spike measurement.

    There is no per-script version history, no gradual deployment, and no rollback API for user Workers. This is fine for Patchy and arguably better: Patchy already stores immutable versions and moves a pointer, so "rollback" is "re-upload the bundle for version N". It does mean the source of truth for what is deployed stays in Patchy's Postgres, and Cloudflare holds only the currently-served script per patch. Deletion is a single DELETE; retire/delete flows already exist in the portal and would map to it.

    Secrets and bindings

    Secrets: PUT …/scripts/{script_name}/secrets to set, GET to list or read a binding with the value omitted, DELETE to remove. Write-only after creation, matching every other platform surveyed in #13. Under Patchy's model the handler should hold no secrets at all — credentials stay behind the broker — so this surface is mostly unused, which is the right amount of use.

    Bindings are declared in the upload metadata and are per-script, so "Each User Worker can only access bindings explicitly attached to it". Patchy would likely attach none beyond, at most, a VPC Service binding. Workers VPC (open beta, "available for free to all Workers plans" during beta) connects a Worker to "private networks in any external cloud (AWS, Azure, GCP, etc.)" over Cloudflare Tunnel, with a fetch() binding (Workers VPC overview, open beta blog). That would let the broker in Azure stay off the public internet.

    Data residency and jurisdiction controls

    The governing sentence is "Workers code and secrets are deployed globally to all Cloudflare data centers." Regional Services can regionalize execution on a Workers custom domain, but the docs are explicit that "Regional Services does not prevent the code itself from being present outside the configured region — only its execution is regionalized", it applies only to custom domains and *.workers.dev, not to Queues or Cron Triggers, and it "does not extend to outgoing subrequests from Workers to other services".

    Durable Objects are the only surface with real jurisdiction controls: eu, us, fedramp jurisdictions "create Durable Objects that only run and store data within a region to comply with local regulations", plus best-effort location hints (wnam, enam, weur, apac, …) that are "a best effort and not a guarantee", with DOs never relocating after creation (DO data location). Since the recommendation is to avoid DOs, that control does not help.

    Logging and error surfaces

    All four surfaces work per-script in a dispatch namespace (W4P observability):

    • Workers Logs — enabled per script via observability.enabled / logs.enabled in upload metadata, with head_sampling_rate; queried by the Observability API filtering $metadata.service to isolate one patch. Retention 3 days free / 7 days paid, $0.60 per additional million logs, 256 KB max log size, 5 billion logs/day account cap (Workers Logs).
    • Logpush — per namespace or per script, with filters on Outcome or Script Name, to Patchy's own storage.
    • Tail Workers — real-time HTTP statuses, console.log() output and uncaught exceptions; "billed by CPU time, not by the number of requests" (Tail Workers).
    • GraphQL Analytics — dispatchNamespaceName dimension, scriptName filter, returning request counts, error counts and CPU time quantiles.

    A patch author's error surface would be Patchy's, not Cloudflare's: the dispatch Worker catches the thrown exception (including limit trips) and renders it.

    Pricing at 1,000 and 10,000 mostly idle patches

    Formula: $25 + max(0, scripts − 1000) × $0.02 + max(0, Mreq − 20) × $0.30 + max(0, Mcpums − 60) × $0.02.

    • 1,000 patches, 1,000 requests/patch/month (1 M requests), 10 CPU-ms each (10 M CPU-ms): everything inside the included allotment. $25/month.
    • 10,000 patches, same per-patch traffic (10 M requests, 100 M CPU-ms): $25 + 9,000 × $0.02 + $0 requests + 40 × $0.02 = $205.80/month.
    • 10,000 patches, ten times busier (100 M requests, 1,000 M CPU-ms): $25 + $180 + 80 × $0.30 + 940 × $0.02 = $247.80/month.

    Storage of the script itself is the $0.02; there is no idle charge beyond it. Money is not the deciding factor here even without Cloudflare credits — at 10,000 patches this is roughly one small Azure VM.

    The Cloudflare-to-Azure data path, and a ten-callback handler

    Every handler data call is Worker → Outbound Worker → Patchy broker in Azure. Cost: one billed request for the whole chain regardless of callbacks, no subrequest charges, CPU-ms summed across dispatch + user + outbound Workers. Ten callbacks therefore cost roughly ten Outbound-Worker invocations' worth of CPU-ms — single-digit ms if the Outbound Worker only checks a hostname — and nothing for the waiting.

    Latency is the real bill. Cloudflare publishes no measured PoP-to-Azure-region figure. The nearest primary anchors are its own sequential-query numbers, "20-30ms from a distant region, or 1-3ms when placed nearby", and the Smart Placement blog's "4-8x" improvement on a three-round-trip Sydney-to-Frankfurt workload. Taking those at face value, ten sequential callbacks are ~200–300 ms of added round trips unplaced, ~10–30 ms placed. Placement hints name Azure regions directly (azure:eastus, azure:westeurope), Smart Placement triggers when "your Worker makes more than one subrequest to a back-end resource", and placement "only affects fetch event handlers". Whether either works for user Workers inside a dispatch namespace is undocumented and is the single most important spike question.

    Note also the 6-simultaneous-connection cap: a handler issuing ten parallel callbacks queues after six, so the parallel case is not simply max(RTT).

    Contractual terms for hosting customers' code

    Cloudflare's developer-platform service-specific terms permit the arrangement explicitly and push the responsibility down: Patchy "may use Workers for Platforms to make available certain Workers functionality for use by your End Users on your Internet Properties"; Patchy is "solely responsible for the acts of your End Users" and for any "warranty, liability or obligation to any End User"; prohibited content is the usual CSAM/IP/malware/phishing list; Cloudflare "may, but is not obligated to, limit or suspend your or your End Users access" for suspected violations, with notice generally attempted; customers retain IP in their source code and Cloudflare affirms it will not use customer content to build competing products (terms).

    Concrete disqualifiers for a private-cloud promise made to companies

    1. Patch code and its secrets physically leave the company's region. "Workers code and secrets are deployed globally to all Cloudflare data centers", and Regional Services regionalizes execution only, on custom domains only, and not for outgoing subrequests. If Patchy's promise is "your company's cloud", a company's uploaded handler source sitting in every Cloudflare PoP contradicts it in a way no configuration fixes. This is survivable only if the tier-2 promise is scoped to data residency (which Patchy can keep, since data stays in Azure and handlers hold no credentials), not code residency.
    2. One vendor account, all tenants. Every company's patches live in Patchy's Cloudflare account. Cloudflare's suspension right runs against "your or your End Users access"; an account-level action is an all-companies outage, and there is no per-company contractual boundary to point at in a security review.
    3. No jurisdiction control on the execution path. The only jurisdiction primitive (eu/us/fedramp) belongs to Durable Objects, which this design deliberately avoids, and DO location hints are "a best effort and not a guarantee".
    4. Every data call is an extra internet hop by construction. A tier-1 patch calls the broker from the viewer's browser; a tier-2 patch on Cloudflare calls it from a third network. Ten callbacks turn that into 200–300 ms unless placement works for user Workers — and placement near Azure defeats the "run near the user" reason to be on Cloudflare at all.

    None of these is fatal to the technology; (1) and (2) are fatal to a literal reading of the private-cloud promise. Nothing found disqualifies it on cost, isolation, egress control, or terms.

    What the spike must measure

    1. Does placement.region = "azure:<region>" work for a user Worker in a dispatch namespace? Measure p50/p95/p99 broker RTT with explicit hint, with Smart Placement, and with neither. This is pass/fail for the whole idea.
    2. One callback vs ten sequential vs ten parallel, end to end from the viewer, against a real broker in the production Azure region — and whether the 6-connection cap changes the parallel curve.
    3. Upload latency, p50/p95, for a first upload and for a replace, at 1,000 and at 10,000 scripts in one namespace. Patchy's publish flow is synchronous today; the CLI's exit-code contract (ADR-0004) assumes a bounded publish.
    4. Cold dispatch for a rarely-invoked script: time-to-first-byte for a script untouched for 1 h, 24 h and 7 days, with 10,000 scripts resident. Cloudflare publishes no number for this and it is the load-bearing assumption behind "costs nothing when nobody has it open".
    5. Outbound Worker overhead: added CPU-ms and added latency per intercepted fetch, and whether a deny-by-default posture (only Patchy's broker host) can be expressed without per-patch configuration.
    6. Limit-trip behaviour: what the dispatch Worker observes when cpuMs or subRequests trips, and whether it is distinguishable from an ordinary patch exception — Patchy needs to tell a reader "your patch ran out of budget", not "something broke".
    7. Real CPU-ms per invocation of a representative CRM-shaped handler, to check the $0.02/M assumption and to pick a sane default cpuMs.
    8. Namespace-per-company feasibility: whether one dispatch namespace per company is supported and what it costs in API rate limit against the 1,200-per-5-minutes ceiling during a busy publish window.
    9. Delete-then-reupload consistency: is dispatch on the same script name globally consistent immediately after a delete, or is there a window where the old script serves?

    Open questions

    • Default and maximum values for cpuMs and subRequests in dispatcher custom limits — undocumented.
    • Whether Smart Placement or explicit placement hints apply at all to user Workers in a dispatch namespace — neither placement doc nor the W4P docs say.
    • Any measured Cloudflare-PoP-to-Azure-region latency from a primary publisher. The 20–30 ms / 1–3 ms figures are Cloudflare's own database-round-trip framing, not an Azure measurement.
    • Maximum number of dispatch namespaces per account.
    • Reconciling "Cloudflare provides an unlimited number of scripts" (limits page) with "1000 scripts" included and "+$0.02 per additional script" (pricing page) — presumably no cap, still billed, but not stated.
    • Whether the $25/month W4P plan is fully self-serve or requires a sales contract; the pricing page lists the price without stating plan gating.
    • Whether any Cloudflare DPA or regional commitment covers the residency of Worker code and secrets, as opposed to request processing.
    • Cold-start and eviction behaviour for scripts at 10,000-script scale; Cloudflare's isolate cold-start claims are not published as a W4P-specific figure.
    • Workers VPC pricing after open beta, and whether a VPC Service binding is available to user Workers in a dispatch namespace (the bindings page lists it; no W4P-specific confirmation).
    • Whether Workers Logs' 7-day paid retention is per-account or per-script at W4P scale, and the cost at 10,000 patches' log volume.

    Recommendation for Patchy

    Keep Workers for Platforms as the leading managed candidate, and run the spike — but do not let it carry the private-cloud promise.

    It is unusually well-matched on the two things that normally kill a two-person team's tier-2 plan. Cost at idle is near zero by construction, because Cloudflare bills CPU-ms and not duration: 10,000 mostly-idle patches is about $205/month, which is not a number that needs credits or a decision. And it is the only surveyed platform (#13) that hands the platform operator a per-invocation CPU and subrequest budget plus in-runtime egress interception. Outbound Workers are, almost line for line, the server-side version of ADR-0010's broker: patch code with no ambient authority, every outbound call mediated, no raw sockets. The absence of a version/rollback API is a non-issue because Patchy already owns versioning.

    The mismatch is the promise, not the machine. "Workers code and secrets are deployed globally to all Cloudflare data centers" is incompatible with telling a company its patch runs in its cloud. The honest scope is: company data stays in Azure behind Patchy's broker; a tier-2 handler is a stateless function Patchy runs on its own infrastructure, holding no credentials and reaching nothing except Patchy. Patchy's existing model already makes that true — credentials never reach patch code at any tier — so this is a wording decision, taken now, rather than a retrofit. If a company ever needs code residency too, that is a second execution backend, not a configuration of this one.

    Three concrete calls:

    • No Durable Objects in v1. Keep subscriptions server-owned in Azure and terminate WebSockets, if at all, in a plain Worker. DO buys coordination Patchy already has, and charges 128 MB-based GB-s and a second residency story for it.
    • Put the spike behind a broker-shaped interface. The dispatch Worker, the Outbound Worker and the upload call are a thin adapter over "run this bundle, enforce this budget, allow only this host". Keep that seam explicit so the execution vendor stays replaceable when AWS credits arrive.
    • Gate the decision on spike item 1. If placement does not work for user Workers in a dispatch namespace, a ten-callback CRM handler pays 200–300 ms on every interaction and the answer is no regardless of how good everything else looks.
  3. allisonmahmood commented on Sep 19, 2026

    @allisonmahmood
    OwnerAuthor

    Report B: astra via omp, with tools (full findings)

    Workers for Platforms as Patchy's tier 2 execution path

    Summary

    • Workers for Platforms is a serious managed handler runtime, but not the runtime currently specified by Patchy's map. The map requires a container runnable inside Patchy's Azure backend and later AWS; Cloudflare executes Workers on its own network. Selecting it requires an explicit change to that decision. 1
    • A dispatch namespace holds customer scripts without the ordinary per-account script-count ceiling. A platform-owned dispatcher selects a script by name; the upload API accepts an individual multipart script bundle. 5
    • The dispatcher can set cpuMs and subRequests per invocation. Exceeding either throws an exception. Waiting for Azure does not consume CPU time, but still adds user-visible latency. 7
    • A request-scoped RPC capability can expose Patchy's broker without exposing its credentials or private context. Workers rejects reuse of that capability from a later request. This fits the no-ambient-authority requirement. 11
    • Outbound Workers intercept user fetch() and disable outbound TCP connect(). They do not intercept Durable Object or mTLS-binding fetches. Keep tenant bindings empty and test every enabled networking API before claiming complete egress confinement. 8
    • Current limits document 128 MB per isolate and 64 MiB uncompressed code, with no compressed-size limit. Memory is shared by concurrent requests in an isolate, not allocated separately per invocation. 9
    • WebSockets and Durable Object hibernation are available. Neither is needed for handler execution when Patchy owns presence and subscriptions, as the map already specifies. 113
    • User-Worker updates deploy to all traffic; gradual deployments are unsupported. Immutable script names per Patchy version offer a straightforward platform-owned rollback, at the cost of more billed scripts. 14
    • Workers Logs now explicitly supports user Workers and per-script queries. Tail Workers, Logpush and GraphQL metrics provide other options; logs must be tenant-filtered by Patchy, not by user-supplied filters. 16
    • One deployed script per patch costs $25/month at 1,000 patches and $205 at 10,000 while usage stays within the included allowances. Ten deployed versions per patch raise those figures to $205 and $2,005. 18
    • Ten Azure callbacks do not become ten separately billed Cloudflare requests. Their main penalties are repeated network round trips, Azure response-byte egress and broker work. Published placement guidance is not an Azure-specific latency measurement. 1820
    • Azure placement hints are present in the WfP upload schema. They select a nearby Cloudflare location, not execution inside Azure or a jurisdiction guarantee. Regional Services also leaves Worker code and secrets globally deployed. 624
    • Cloudflare's Developer Platform terms expressly permit WfP end-user functionality. Patchy remains responsible for customer content, licenses, end-user support and abuse; Cloudflare retains suspension and removal rights. 22

    Detail

    1. Dispatch namespaces and per-script upload

    Cloudflare recommends one production namespace containing all customers' Workers, with a separate staging namespace if needed. The dispatcher invokes env.DISPATCHER.get(scriptName).fetch(request). Namespace Workers default to untrusted mode, which isolates their caches and disables caches.default and request.cf; trusted mode can expose shared cached responses. Keep untrusted mode for customer-authored code. 5

    The deployment endpoint is PUT /accounts/{account_id}/workers/dispatch/namespaces/{namespace}/scripts/{script_name}. Multipart metadata identifies main_module, bindings, compatibility settings and placement; other parts contain modules. It requires Workers Scripts Write. Patchy should own this metadata rather than accept a customer's Cloudflare configuration. That is where a customer could otherwise acquire unintended capabilities. 6

    2. Per-request CPU and subrequest limits

    The documented call shape is get(name, {}, { limits: { cpuMs: 10, subRequests: 5 } }). These are per-invocation limits, not monthly company quotas. Hitting either immediately throws. Generic Workers documentation distinguishes CPU execution from network waiting and gives HTTP requests no fixed wall-time ceiling while the client remains connected. Patchy still needs a broker deadline and admission budget. 7

    There is a documentation discrepancy worth preserving: WfP pricing lists a 30-second CPU maximum, while general Workers limits lists a 30-second default expandable to five minutes. Do not promise the latter for WfP without confirmation. Small CRM handlers should use a much lower explicit policy regardless. 18

    General paid Workers limits currently document 10,000 subrequests by default. Redirects count. Six simultaneous outgoing connections may wait for response headers; further connections queue. Ten sequential HTTP callbacks fit, but ten parallel calls are not necessarily ten simultaneous network operations. Exact accounting of broker RPC calls against WfP's custom subrequest budget remains a spike question. 9

    3. Outbound interception and no ambient authority

    An Outbound Worker configured on the dispatch binding receives user-Worker fetch() requests and can deny them, authenticate approved calls or replace their destinations. Enabling it disables cloudflare:sockets.connect(). However, Cloudflare explicitly excludes fetches originating from Durable Objects and mTLS bindings. Attaching KV, databases, storage or service bindings also grants access independently of an HTTP allowlist. 8

    The better fit is a request-scoped BROKER RPC stub passed through ctx.props. Its implementation lives in trusted dispatcher code; its private props and credentials do not become user props. The user calls exposed methods, and cross-request reuse is rejected. Use an Outbound Worker that rejects every direct network request as a backstop, not the documentation's permissive example that forwards unmatched requests. This is a design recommendation based on documented mechanisms, not a completed confinement test. 11

    The broker should derive company, patch, version, principal and invocation identity from trusted admission. It should reject substituted identities and expired invocations. No database password or integration credential belongs in the user Worker.

    4. Memory, code size and runtime compatibility

    Current general limits specify 128 MB of memory per isolate, including JavaScript and WebAssembly allocations; a single isolate may handle concurrent requests. The code limit is 64 MiB uncompressed, with no compressed-size limit. Global-scope initialization must complete within one second of CPU time. 9

    Workers provides a subset of Node APIs, not an arbitrary Linux process. Some modules, including child_process and worker_threads, are non-functional stubs. Compatibility dates from 2026-08-04 enable Node compatibility by default. Pin the date and flags, and test the release's package allowlist and networking behavior together. A dependency importing successfully is not proof that its required APIs work. 29

    5. WebSockets, Durable Objects and live subscriptions

    Workers supports WebSocket connections. Cloudflare recommends Durable Objects when multiple sockets need a single coordination point. Hibernation keeps clients connected while the object leaves memory, and duration charges do not accrue during that hibernation. WfP imposes no Durable Object namespace-count limit. 1214

    For Patchy, this is optional functionality rather than a requirement. The map assigns presence and subscriptions to Patchy and makes handlers request-scoped. Keep browser subscriptions on the Patchy server; invoke a Worker for each admitted handler execution. Adding tenant Durable Objects would duplicate that responsibility and introduce an egress path outside Outbound Workers. This conclusion follows from the chosen ownership, not from a claim that Cloudflare cannot support live applications. 1

    6. Upload latency, versioning, rollback and deletion

    First-time user-Worker uploads are synchronous: Cloudflare documents that 200 OK guarantees immediate dispatch readiness. It publishes no upload-latency distribution, and this statement does not establish overwrite or deletion propagation. WfP updates create a new version deployed all-at-once to 100% of traffic; gradual deployments are unsupported. The published namespace-script API does not establish the ordinary Workers versions/deployments rollback workflow as a WfP contract. 316

    Recommendation: name a script by immutable Patchy version, upload and verify it, then move Patchy's served-version pointer. Rollback selects a retained script without overwriting code. Preserve source artifacts in Patchy independently of Cloudflare. Retaining every version as a deployed script is simple but changes the script-count bill. 6

    Deletion uses DELETE on the same namespace/script path. Its force option can also delete associated bindings and Durable Objects, so it is not a routine cleanup flag. Stop admitting the version before deletion; no deletion-propagation or in-flight-cancellation bound was established. API provisioning also shares the documented 1,200 requests per five minutes quota, so bulk fleet deployment needs throttling. 30

    7. Secrets and bindings

    WfP has a per-script secrets API. Adding a secret creates a new version, and secret_text is explicitly a value accessible through a binding. Such a secret is not hidden from the code receiving it. Upload-time bindings remain available to every invocation; request-scoped RPC capabilities are the documented alternative. 1511

    Keep customer credentials in Azure's broker. Any Cloudflare-side authentication material should belong only to trusted platform Workers and authorize narrowly scoped broker calls. Treat code publication, binding configuration and compatibility flags as one reviewed deployment artifact.

    8. Data residency and jurisdiction

    Data Localization Suite is an Enterprise-only paid add-on. For Workers on a configured custom domain, Regional Services restricts TLS termination and execution to a selected region. It does not keep code or secrets out of other regions, and it does not extend its guarantee to outgoing subrequests. [INFERENCE] Keeping the database in Azure does not keep all company data processing there: returned rows must reach the Cloudflare handler. 2319

    Customer Metadata Boundary separately restricts covered customer-log storage to the EU or US. It supports no other region, and no boundary applies by default. This is a log control, not an execution or source-code residency control; product-specific compatibility still governs. 32

    The compatibility matrix names Workers deployed on a zone, not WfP dispatch-namespace user Workers. It marks Smart Placement incompatible with Regional Services and Customer Metadata Boundary. It also says Workers logs and analytics are unavailable outside the US when using that boundary, recommending Logpush instead. Obtain a written answer covering dispatcher, user Worker, broker callback and telemetry together. Do not extrapolate ordinary custom-domain support into a WfP compliance promise. 25

    There is an unresolved documentation conflict: the Workers localization guide says Customer Metadata Boundary applies to workers.dev, while the compatibility matrix marks it unsupported. Placement hints, including azure:eastus, are latency controls, not a substitute for resolving these jurisdiction questions. 2419

    9. Logging and error surfaces

    The WfP observability documentation explicitly supports managed Workers Logs. Enable it through upload metadata, then query dataset cloudflare-workers with $metadata.service fixed to the authorized script name. Patchy's server must supply those filters. GraphQL workersInvocationsAdaptive exposes per-script request/error counts and CPU quantiles even without log collection. 16

    Tail Workers receive statuses, console output and uncaught exceptions; Logpush exports execution logs. Generic errors include runtime 1101 for JavaScript exceptions, resource-limit 1102, deployment validation 10021 and oversized upload 10027. CPU and memory outcomes are distinguished in analytics. WfP custom-limit exception details still need measurement rather than parsing an assumed error string. 169

    Record invocation IDs across Cloudflare and Azure. Keep broker audit records separate from sampled developer logs, and decide whether customer console output may enter Cloudflare-managed storage.

    10. Pricing at 1,000 and 10,000 mostly idle patches

    The $25 monthly WfP plan includes 1,000 scripts, 20 million requests and 60 million CPU-ms. Overages are $0.02/script, $0.30/million requests and $0.02/million CPU-ms. A dispatch/user/outbound chain counts as one request, with CPU summed across it. Subrequests and duration carry no separate charge. 18

    The following is calculated, not measured. Assume 100 invocations per patch per month and 10 CPU-ms total per invocation. 18

    Patches Monthly invocations Total CPU-ms One deployed version each Ten deployed versions each
    1,000 100,000 1 million $25 $205
    10,000 1 million 10 million $205 $2,005

    Both traffic examples fit the included usage. Zero invocations produce the same script-count floor. Idle execution is not a per-VM reservation, but an installed patch is not unconditionally free. These are WfP execution estimates, excluding Azure, telemetry, optional storage/Durable Objects, localization, taxes and negotiated terms. The map records credits on Azure/AWS/Neon/Daytona and none on Cloudflare. 18

    11. Azure latency and a ten-callback CRM handler

    Cloudflare documents explicit Azure region hints, and the WfP upload schema accepts placement.region. Workers still execute in Cloudflare locations. Placement only affects fetch handlers, not RPC methods or named entrypoints. An RPC broker implemented on the dispatcher makes the dispatcher's location relevant too. Smart Placement needs consistent traffic and may take up to 15 minutes to analyze; explicit hints avoid relying on sparse patches generating sufficient training traffic. 6

    No reviewed primary source gives an Azure-region-specific p50/p95/p99 distribution for this complete path. Cloudflare says single-digit milliseconds are achievable and illustrates 1–3 ms, but publishes no corresponding Patchy workload measurement. No Cloudflare or Azure deployment was created for this desk research. 19

    For ten dependent callbacks, the added network time is approximately 10 × callback RTT, plus ingress, serialization, broker/database work and handler execution. Assumed RTTs of 3, 20 and 80 ms imply 30, 200 and 800 ms respectively. These are sensitivity calculations, not benchmarks. Batching helps independent operations; it cannot erase genuine sequential dependencies.

    Ten callbacks remain one billed WfP invocation. At an assumed total 10 CPU-ms, the marginal execution price after both allowances are exhausted is $0.50 per million invocations: $0.30 requests plus $0.20 CPU. It is not a tenfold request charge. 18

    Azure ingress is free. For North America/Europe internet egress over Microsoft's premium network, the first 100 GB/month is free and the next tier is $0.087/GB. Calculated for one million invocations with ten responses each, using decimal bytes: 20

    Response per callback Azure response traffic Cost with 100 GB allowance available Cost with allowance already used
    10 kB 100 GB $0 $8.70
    100 kB 1,000 GB $78.30 $87

    These omit protocol overhead, other traffic, broker compute and database costs. The allowance is not per patch. Cloudflare's Azure discount instructions use Internet Routing Preference, with storage-specific setup; they do not establish universally free broker egress. Model the actual Azure service's route and bill. 20

    12. Contractual permission to host customers' code

    The Developer Platform terms, updated June 2, 2026, explicitly name WfP. Section 10 permits making Workers functionality available to end users on the customer's Internet Properties, notwithstanding contrary agreement provisions, provided end-user use complies with the agreement. This is affirmative permission for the platform model, not a generic resale assumption. 22

    Sections 2–4 assign content and license responsibility, support, end-user liability and anti-malware obligations to Patchy. Sections 3 and 8 permit suspension or content removal, including without notice. Section 5 preserves source-code IP; section 9 does not promise retention after termination. Confirm the applicable order, DPA and regulated-data permissions before a customer contract promises more. Maintain an independent copy of deployable artifacts. 22

    13. Concrete disqualifiers and the required spike

    WfP fails the current portable-container requirement. It also fails a promise that execution and all processed company data stay inside Patchy's Azure/AWS environment. Regionalizing execution does not solve global code/secret distribution. These are product or contractual disqualifiers, not latency tuning problems. 124

    If Patchy considers an explicit managed-runtime exception, the spike should produce:

    1. Latency distributions. Measure real dispatch, user execution, RPC broker and Azure timings at p50/p95/p99. Compare default placement and Azure hints, cold and warm scripts, one versus ten sequential callbacks, and a batched CRM equivalent. Include transaction duration and held database connections.
    2. Confinement evidence. Attempt direct fetch, redirects, WebSocket constructors/upgrades, TCP and enabled Node networking. Reuse a saved broker stub across requests and forge principal/version data. Any unauthorized data access or egress is a failure.
    3. Lifecycle measurements. Time upload acknowledgement to first successful execution, overwrite visibility, rollback and deletion. Exercise concurrent invocations, stale served versions, retirement and client disconnects.
    4. Limits and billing evidence. Force CPU, memory, subrequest and wall-deadline failures. Check callback accounting, cancellation, log delivery and actual invoice meters at the intended script/version count.

    These are proposed acceptance checks, not experiments completed in this report. They follow the documented controls and gaps above. 791418

    What each candidate cannot do

    • Managed WfP, default edge or Azure-adjacent. Neither mode becomes an Azure/AWS container or removes cross-provider callbacks. Placement cannot guarantee jurisdiction. Bound-resource authority is not contained by an Outbound Worker alone. 19
    • WfP plus Durable Objects. Hibernation solves idle socket coordination, not Azure transaction latency, private-cloud execution or broker-only egress. It is unnecessary under Patchy's chosen subscription ownership. 138
    • Self-hosted workerd beside Azure/AWS. It does not provide Cloudflare's managed defense-in-depth. Its own README warns that it is not a hardened sandbox and requires an appropriate secure outer sandbox for possibly malicious code. Portability does not remove that engineering responsibility. 26
    • Daytona. Its documented unit is a full sandbox computer, with a default small container reserving 1 vCPU and 1 GiB. It does not supply Patchy's request-scoped handler/broker contract merely by hosting that container. Retain the prior research's distinction between sandbox environments and the selected handler product rather than choosing it because credits exist. 271

    Open questions

    • What are actual Azure callback, cold invocation and publish-readiness distributions? No workload measurements were made.
    • Does Regional Services cover dispatched user Workers and RPC callbacks, and where can their logs reside? Resolve the conflicting workers.dev documentation in writing. 24
    • Does every enabled networking API respect deny-all outbound? Do broker RPC calls consume custom subrequest limits, and which code's CPU is charged against the custom cap? 711
    • Which WfP CPU ceiling applies, and is there a supported namespace-native rollback API with defined propagation and in-flight behavior? 918
    • How are retained scripts counted during partial-month creation/deletion, and what localization/support terms would apply to Patchy's actual account? The cited public pricing does not settle that commercial configuration. 18

    Recommendation for Patchy

    Keep WfP as the managed comparison, not the selected runtime under the current map. Reuse the earlier conclusions: compare handler isolation rather than reopen a whole-app product, retain the Azure broker and its bounded database resources, and do not let Daytona credits dictate the handler model. 24

    If Patchy explicitly relaxes container portability, WfP merits the first managed spike. Use untrusted namespaces, immutable version scripts, a request-scoped broker capability, no tenant secrets/resource bindings, deny-all direct outbound and Patchy-owned subscriptions. Start with explicit low execution limits and measure the real CRM path before choosing their values. 108

    The trade-off for a two-person team is concrete: Cloudflare operates the execution platform, but Patchy adds another vendor, cross-cloud failure and latency, non-credit spending, and residency obligations. Azure placement can reduce the callback penalty; it does not remove those costs or satisfy the existing hosting promise. Do not describe this option as computation remaining inside the company's private cloud. 51

    Verification: cited vendor pages and internal decision records were re-opened and checked; pricing and latency sensitivity arithmetic was recomputed. No production resources, repository files, branches or GitHub discussions were changed.

  4. allisonmahmood commented on Sep 19, 2026

    @allisonmahmood
    OwnerAuthor

    Resolution

    Two reports ran in parallel (Opus and astra with tools, full text above); this is the merge with the charting session's own checks and opinion.

    What both established

    • Workers for Platforms is built for this job ("run untrusted code written by your customers, or by AI, in a secure hosted sandbox"): one script per patch version in a dispatch namespace, a Patchy-owned dispatch Worker selecting it by name, limits: { cpuMs, subRequests } per invocation with an exception on breach, and Outbound Workers that intercept every fetch() and disable raw connect(). That is the server-side twin of ADR-0010's broker. A request-scoped RPC capability can expose the broker without exposing a token, and Workers rejects reuse of that capability from a later request.
    • Cost at idle is near zero by construction. Billing is CPU time, never duration; a handler waiting 300 ms on Azure pays nothing for the wait. $25/month includes 1,000 scripts, 20 M requests and 60 M CPU-ms; 10,000 idle patches is about $205/month. Ten callbacks to Azure are one billed request, not ten. Immutable script names per version multiply the script count (ten versions per patch: $205 and $2,005), so old versions should be deleted from the namespace and re-uploaded from Patchy's stored bundle on rollback.
    • Limits: 128 MB per isolate shared by concurrent requests, 64 MiB uncompressed code, 1 s startup, six simultaneous open connections awaiting headers, no version or gradual-deployment surface for user Workers (Patchy's immutable-version-plus-pointer model already covers rollback). Uploads are synchronous since February 2025.
    • Live connections need no Durable Objects when Patchy owns presence and subscriptions; a plain Worker can terminate a WebSocket if ever needed. Durable Objects would add per-object GB-s billing and a second residency story.
    • Residency is the sharp edge. "Workers code and secrets are deployed globally to all Cloudflare data centers"; Regional Services scopes request processing only, on custom domains only, not subrequests. Placement hints exist for Azure regions (the charting session verified azure:eastus and azure:westeurope on the placement page) and select a nearby Cloudflare location, not execution inside Azure. Whether placement applies to user Workers in a dispatch namespace is documented nowhere and is the spike's first measurement.
    • Terms: permitted expressly; Patchy is "solely responsible for the acts of your End Users", and Cloudflare may limit or suspend the account. One account suspension is an all-companies outage.

    Where they differ, and the call

    Opus keeps Workers for Platforms as the leading managed candidate and would scope the promise to data residency, which our credential-free model already keeps true. Astra keeps it as the managed comparison, not the selected runtime, because the map's hosting note requires a container we can run in Azure now and AWS later, and selecting Cloudflare is an explicit change to that decision plus a second vendor, cross-cloud failure modes and non-credit spend.

    The charting session's view: both are right, and the order is astra's. The self-hosted research found that open-source workerd carries the same primitive (the Worker Loader with globalOutbound as one capability), so the managed path's technical advantage reduces to two things we would otherwise build ourselves: per-invocation CPU and memory enforcement, and the operator. Against that stand a second vendor, code in every Cloudflare data centre, one account as the blast radius, and no credits. The spike still runs, because Allison asked for both paths and because it is the only way to learn the cross-cloud callback cost; but it competes against the self-hosted spike rather than against nothing, and it does not carry the private-cloud promise.

    What the spike must measure

    1. Whether placement.region = azure:<region> works for a user Worker in a dispatch namespace: p50/p95 broker round trip with the hint, with Smart Placement, and with neither. Pass/fail for the idea.
    2. One callback, ten sequential, ten parallel, end to end from the viewer against a broker in the production Azure region; whether the six-connection cap bends the parallel curve.
    3. Cold dispatch for a script untouched for 1 h, 24 h and 7 days with thousands resident; upload p50/p95 for first upload and replace.
    4. Outbound Worker overhead per intercepted fetch, and whether deny-all-but-the-broker is expressible without per-patch configuration.
    5. What the dispatcher observes when cpuMs or subRequests trips, so a viewer can be told "your patch ran out of budget" rather than "something broke"; real CPU-ms of a CRM-shaped handler.
    6. Delete-then-reupload consistency on the same script name.

    Merged by Claude Fable 5.1 via Claude Code, 2026-09-19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wayfinder:research

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions