Service bindings: let one Worker call another without the public internet
Service bindings (Worker-to-Worker calls and RPC with WorkerEntrypoint)
What it is
Until now each of your Workers has stood alone: it answers its own hostname and, if it needs something from another Worker, the only obvious way is a normal fetch to that Worker's public URL. A service binding is the direct line instead. You declare it in the calling Worker's wrangler.toml, and the other Worker appears in your code as env.SOMETHING, just like the KV, D1, and R2 bindings from lessons 6 to 8.
The config is three lines in the caller: [[services]], then binding = "HELPER" (the name your code uses), then service = "the-other-worker" (its Worker name). There are two ways to use it. You can forward a request with await env.HELPER.fetch(request), or, more neatly, the other Worker can export a class that extends WorkerEntrypoint with ordinary methods, and you call them directly, for example await env.HELPER.formatDate("2026-11-04"). That second style is called RPC, and it means no URLs, no JSON parsing, just a function call.
You can also add a binding in the dashboard: Workers and Pages, the calling Worker, Settings, Bindings, Add binding, then Service binding, and pick the target Worker from a list. Either way, the binding belongs to the caller; the Worker being called needs no change unless you want RPC methods.
Why it matters
It is free and fast. Cloudflare's pricing page says a call through a service binding does not add a request fee: Worker A calling Worker B is billed as one request plus the CPU time of both. By default both Workers even run on the same thread of the same server, so there is no network hop.
It is private. A helper Worker can have workers_dev turned off and no route or custom domain at all, so nobody on the internet can reach it, and only Workers that declare a binding to it can call it. That is a good home for something shared, such as a function that checks a password or writes to a shared D1 table, that you never want exposed as a web page.
It keeps small apps small. Instead of copying the same date formatting, header, or lookup code into ten Workers across kosan.xyz and drkotha.com, you write it once in one Worker and bind the others to it. Each Worker can still be deployed on its own schedule.
On your account
From your own setup, read only: this desk's Worker, cloudflare-tutor, has no [[services]] block in its wrangler.toml. Its only config is the name, workers_dev = true, and two routes on cloudflare.kosan.xyz, so it calls nothing else and is called by nothing.
A natural fit for you: several of your daily digest Workers on kosan.xyz and drkotha.com each render their own page header, dates in Brisbane time, and footer. A private helper Worker, say site-helpers with no hostname, could export a WorkerEntrypoint class with formatBrisbaneDate() and pageShell() methods, and each digest Worker would add [[services]] binding = "HELPERS" service = "site-helpers" and call env.HELPERS.pageShell(...). One fix to the helper would then update every site's footer at once.
Nothing was bound or changed for this lesson. This desk only redeployed its own Worker, cloudflare-tutor, and did not add any binding, change any DNS record, or touch the AI News root redirect rule, ainews, aiweekly, or any other Worker.
Do this yourself
These stay in the dashboard, on your side. This site does not change DNS, routes, or other Workers.
- In the Cloudflare dashboard, open Workers and Pages, then cloudflare-tutor, then Settings, then Bindings, choose Add binding, pick Service binding, and look at which of your Workers appear in the list and whether an entrypoint field is offered, then cancel without saving so nothing changes.