Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Remote-procedure call (RPC)

Implements a JavaScript-native remote procedure call system to allow Workers and Durable Objects to call methods on each other via Service Bindings.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Remote-procedure call (RPC)

Implements a JavaScript-native remote procedure call system to allow Workers and Durable Objects to call methods on each other via Service Bindings.

When To Use

Use when you need to enable one Cloudflare Worker or Durable Object to invoke methods on another Worker within the same account using a native JavaScript syntax.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-runtime-apis-rpc-remote-procedure-call-workflow-guide.mdA documentation guide explaining the implementation, asynchronous nature, and structured clonable types of the Cloudflare Workers Remote Procedure Call (RPC) system.Questions about a documentation guide explaining the implementation, asynchronous nature, and structured clonable types of the Cloudf...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wr.textA wrangler configuration file demonstrating the setup for a Cloudflare Workers RPC implementation.Exact payloads, commands, or snippets shown in A wrangler configuration file demonstrating the setup for a Cloudflare Workers RPC implementation.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wr-2.textA wrangler configuration file demonstrating the setup for a worker named workerb using a local schema reference.Exact payloads, commands, or snippets shown in A wrangler configuration file demonstrating the setup for a worker named workerb using a local schema reference.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wo.textA JavaScript code example demonstrating how to extend the WorkerEntrypoint class to implement Remote Procedure Call (RPC) functionality in a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to extend the WorkerEntrypoint class to implement Remote Procedure Call (...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wo-2.textA TypeScript implementation of a WorkerEntrypoint class demonstrating how to define and export methods for remote procedure calls.Exact payloads, commands, or snippets shown in A TypeScript implementation of a WorkerEntrypoint class demonstrating how to define and export methods for remote pro...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-py.textA Python implementation of a Cloudflare Worker using the WorkerEntrypoint class to define RPC methods.Exact payloads, commands, or snippets shown in A Python implementation of a Cloudflare Worker using the WorkerEntrypoint class to define RPC methods.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-se.textA wrangler configuration file defining a service binding to enable remote procedure calls between workers.Exact payloads, commands, or snippets shown in A wrangler configuration file defining a service binding to enable remote procedure calls between workers.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wr-3.textA wrangler.toml configuration file defining a service binding between two workers to enable RPC communication.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file defining a service binding between two workers to enable RPC communication.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-fe.textA JavaScript code example demonstrating how to invoke a remote procedure call within a Cloudflare Workers fetch handler.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to invoke a remote procedure call within a Cloudflare Workers fetch handler.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-py-2.textA Python code example demonstrating how to implement a WorkerEntrypoint to handle remote procedure calls within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to implement a WorkerEntrypoint to handle remote procedure calls within a Clo...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wr-4.textA wrangler configuration file defining a counter-service worker for testing Remote Procedure Call functionality.Exact payloads, commands, or snippets shown in A wrangler configuration file defining a counter-service worker for testing Remote Procedure Call functionality.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wr-5.textA wrangler configuration file defining a counter-service worker using a JSON schema reference.Exact payloads, commands, or snippets shown in A wrangler configuration file defining a counter-service worker using a JSON schema reference.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wo-3.textA JavaScript code example demonstrating how to extend the WorkerEntrypoint class to implement a Remote Procedure Call (RPC) service.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to extend the WorkerEntrypoint class to implement a Remote Procedure Call...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wr-6.textA wrangler configuration file defining a client worker service binding to a counter service for RPC communication.Exact payloads, commands, or snippets shown in A wrangler configuration file defining a client worker service binding to a counter service for RPC communication.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wr-7.textA wrangler.toml configuration file defining a service binding for a client worker to communicate with a counter service via RPC.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file defining a service binding for a client worker to communicate with a counter servi...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-fe-2.textA JavaScript code example demonstrating how to use the Workers RPC API within a fetch handler to interact with a service instance.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the Workers RPC API within a fetch handler to interact with a serv...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-fe-3.textA JavaScript code example demonstrating how to use the Workers RPC API within a fetch handler to interact with a service instance.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the Workers RPC API within a fetch handler to interact with a serv...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wr-8.textA wrangler configuration file defining the name and entry point for a Cloudflare Workers RPC project.Exact payloads, commands, or snippets shown in A wrangler configuration file defining the name and entry point for a Cloudflare Workers RPC project.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wr-9.textA wrangler configuration file snippet demonstrating the use of a JSON schema for worker configuration.Exact payloads, commands, or snippets shown in A wrangler configuration file snippet demonstrating the use of a JSON schema for worker configuration.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-en.textA JavaScript code example demonstrating how to implement a WorkerEntrypoint and use RpcTarget to facilitate remote procedure calls between Workers.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to implement a WorkerEntrypoint and use RpcTarget to facilitate remote pr...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-en-2.textA TypeScript code example demonstrating how to implement a WorkerEntrypoint and an RpcTarget to facilitate remote procedure calls.Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to implement a WorkerEntrypoint and an RpcTarget to facilitate remote pro...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-cl.textA wrangler configuration file defining a client worker with a service binding to a counter service for RPC communication.Exact payloads, commands, or snippets shown in A wrangler configuration file defining a client worker with a service binding to a counter service for RPC communicat...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wr-10.textA wrangler.toml configuration file defining a client worker service binding to a remote RPC service.Exact payloads, commands, or snippets shown in A wrangler.toml configuration file defining a client worker service binding to a remote RPC service.
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-fe-4.textA JavaScript code example demonstrating how to use the Workers RPC API within a fetch handler to interact with a service class.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the Workers RPC API within a fetch handler to interact with a serv...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-co.textA TypeScript example demonstrating how to use Workers Remote Procedure Call (RPC) to interact with a counter service instance.Exact payloads, commands, or snippets shown in A TypeScript example demonstrating how to use Workers Remote Procedure Call (RPC) to interact with a counter service...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-co-2.textA text example demonstrating two round trips using a counter service via Workers Remote Procedure Call (RPC).Exact payloads, commands, or snippets shown in A text example demonstrating two round trips using a counter service via Workers Remote Procedure Call (RPC).
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-pr.textA code example demonstrating how to call a remote procedure using a promise to avoid multiple round trips in Cloudflare Workers RPC.Exact payloads, commands, or snippets shown in A code example demonstrating how to call a remote procedure using a promise to avoid multiple round trips in Cloudfla...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-wo-4.textA JavaScript code example demonstrating how to extend the WorkerEntrypoint class to implement a Remote Procedure Call (RPC) service.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to extend the WorkerEntrypoint class to implement a Remote Procedure Call...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-ja.textA JavaScript code example demonstrating how to invoke a remote procedure call within a Cloudflare Workers fetch handler using the 'using' keyword.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to invoke a remote procedure call within a Cloudflare Workers fetch handl...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-se-2.textA text-based example demonstrating how to invoke methods on a service binding using the Workers Remote Procedure Call (RPC) syntax.Exact payloads, commands, or snippets shown in A text-based example demonstrating how to invoke methods on a service binding using the Workers Remote Procedure Call...
examples/workers-runtime-apis-rpc-remote-procedure-call-cloudflare-workers-rpc-se-3.textA text example demonstrating how to define a service using the WorkerEntrypoint class for Remote Procedure Call functionality.Exact payloads, commands, or snippets shown in A text example demonstrating how to define a service using the WorkerEntrypoint class for Remote Procedure Call funct...

What This Skill Covers

  • To use RPC, define a compatibility date of 2024-04-03 or higher, or include rpc in your compatibility flags.
  • Main sections: Tags, Example, All calls are asynchronous, Structured clonable types, and more, Functions.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/runtime-apis/rpc