AI Briefing
KO

Workers RPC Now Supports Calls Between Python and JavaScript

·2026.08.03 22:00

Key point

Cloudflare Workers RPC now supports calls between Python and JavaScript.

Details

Cloudflare Workers RPC now supports cross-language calls between Python and JavaScript. Without any separate dependencies or schema definitions, a Worker written in one language can call methods from a Worker written in another, and objects and functions can be passed back and forth between them.

A method like add() defined in a TypeScript Worker can be called directly from a Python Worker via an RPC stub. The only configuration needed for this is a Service binding that specifies the target Worker.

The key features are as follows.

  • In JavaScript/TypeScript, RPC is used in a way close to Promises, and in Python, close to futures—resembling ordinary function calls.
  • Exceptions propagate back to the point where the RPC method was called.
  • Structured Cloneable types can be passed as parameters and return values, and JavaScript's Date is converted to Python's datetime.
  • A JavaScript function can be passed to a Python Worker, or vice versa, returned. When the other side calls that function, a new RPC is executed back to the caller.
  • Since the other Worker typically runs on the same thread as the caller, no network is involved, and there is almost no performance overhead compared to running within the same Worker.

To bridge the type systems of different languages, type conversion strategies were applied to support calling conventions natural to each language, such as JavaScript objects and Python keyword arguments. The implementation is provided as open-source code in workerd and workers-runtime-sdk.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.