Ai Engineering 3 min read

Live Object Sharing Connects Python and JS Cloudflare Workers

Cloudflare's Workers RPC now allows Python and JavaScript runtimes to invoke remote methods and exchange live objects without manual serialization.

On August 3, 2026, Cloudflare updated its Workers RPC system to support direct cross-language execution between Python and JavaScript. Developers can now pass live object references across the two runtimes and invoke methods synchronously without REST APIs, JSON schemas, or Protobuf serialization.

The release extends the JavaScript-native Remote Procedure Call infrastructure introduced in April 2024. Under the hood, the system is built on Cap’n Proto RPC, but it abstracts away the serialization layer entirely. When a TypeScript Worker returns a class instance to a Python Worker, the system automatically translates the data types and exposes a proxy object. The Python code can then call methods on that TypeScript object exactly as if it were a local Python class.

Object-Capability Security

Cross-runtime communication introduces distinct security boundaries. Cloudflare manages this via an object-capability model rather than open network ports. A runtime cannot arbitrarily probe or invoke methods on another Worker.

Execution requires an explicit stub. A Worker must receive this stub either through a pre-configured service binding in the environment or as a return value from an established RPC connection. This guarantees that access rights are scoped strictly to the objects passed between the runtimes, preventing unauthorized lateral movement between isolated scripts.

Infrastructure for Multi-Agent Systems

Cloudflare framed the Python support as a core primitive for its Agents Week compute rollout. Modern autonomous systems frequently mix languages based on the task domain. Data analysis and machine learning operations naturally default to Python, while web scraping and browser automation rely heavily on JavaScript.

If you implement multi-agent coordination patterns, this RPC layer fundamentally changes how agents collaborate. Instead of dropping intermediate results into a database or serializing heavy payloads over HTTP, a Python-based coding agent can instantiate a data processing pipeline and pass the live pipeline object directly to a TypeScript-based routing agent. Both scripts remain on the edge compute network, executing with minimal latency overhead.

Expanded Edge Capabilities

The cross-language RPC shipped alongside three major compute primitives designed for heavy AI execution. Cloudflare launched @cloudflare/computer, a dedicated agent runtime that dynamically shifts workloads between lightweight V8 isolates and full Linux containers depending on the computational demand.

The network edge now supports inbound TCP and gRPC connections natively. Through Cloudflare Spectrum, developers can route direct socket connections into Durable Objects or isolated containers. This removes the HTTP-only restriction that previously complicated stateful, long-running agent connections. To manage the financial overhead of these persistent connections, a new Billable Usage API exposes programmatic cost visibility across the compute platform.

If you deploy enterprise MCP with Cloudflare Workers, review your microservice boundaries. By replacing HTTP boundaries with direct RPC bindings, you can eliminate the boilerplate serialization code traditionally required to bridge machine learning backends with JavaScript components.

Get Insanely Good at AI

Get Insanely Good at AI

The book for developers who want to understand how AI actually works. LLMs, prompt engineering, RAG, AI agents, and production systems.

Keep Reading