Build2 publishers2 min readPublished
The Python Workers queue send that needed two imports now takes a plain dict
Cloudflare made Python Workers generally available on September 21, moving binding type conversion into the runtime and adding ASGI and WSGI connectors for FastAPI, Django and Flask. Outbound TCP still goes through JavaScript's connect().
The Engineer · Build desk

What happened
- Cloudflare made Python Workers generally available on September 21, making Python a fully supported language across its developer platform after a two-year beta.
- Type conversion at the RPC boundary now happens inside the Workers runtime and the Python SDK, so platform bindings accept Python objects directly.
- New WSGI and ASGI connectors run Django, Flask and FastAPI apps, with the Workers platform doing the job a Uvicorn or Gunicorn process would normally do.
- For outbound TCP, the documented path is still JavaScript's connect() API, not a Python socket bridge.
Compiled by The EngineerSomething wrong?How this is made
Why it matters
- capability One Python service can now take an API request through FastAPI, call an orchestration library, send inference to Workers AI, enqueue work and write to R2 with no JavaScript service sitting between those steps, according to runtimewire.
- decision Porting an existing service becomes an entrypoint change plus a dependency audit, and the audit decides it: any package that needs a native socket is still work, because WebAssembly compatibility does not carry those across.
- cost The announcements describe capabilities and not startup latency, so a team porting a service has to measure Pyodide's interpreter load against its own traffic before committing.
Pyodide is CPython compiled to WebAssembly, loaded inside a V8 isolate [3]. Workers has supported WebAssembly since 2018, and the Python beta opened in April 2024 [4]. Everything in the GA release is shaped by that sandbox.
Call a binding and a Python object has to become the object the RPC layer expects on the JavaScript side. In the beta you wrote that conversion by hand: `from pyodide.ffi import to_js`, `import js`, then `self.env.QUEUE.send(to_js({"key": "value"}, dict_converter=js.Object.fromEntries))` [5]. Nobody typed `dict_converter=js.Object.fromEntries` happily. GA puts the conversion inside the Workers runtime and the Python SDK, so the send is `self.env.QUEUE.send({"key": "value"})` [6]. Two imports and a wrapper call collapse into one line [19].
Gyeongjae Choi, Dominik Picheta and Hood Chatham, who authored the announcement, wrote that the old boundary "required Python developers to keep the JavaScript environment and code in mind while writing Python Workers, and it was a common source of error for both humans and AI agents" [7][8].
The framework support leans on a contract Python already had. WSGI and its asynchronous counterpart ASGI let an application stay server-agnostic, so a connector only has to hand requests over in the shape the framework expects [22]. In a Python Worker the whole wiring for a FastAPI app is `Default = asgi.entrypoint(app)`, and a Django app goes through `wsgi.entrypoint(app)` [9].
Whether existing code deploys unchanged comes down to the requirements file. Cloudflare patched asynchronous Python HTTP clients to route through the Workers Fetch API, which is what lets the OpenAI library, LangChain and the Python MCP package run at all [12][11]. Those clients had expected low-level socket behaviour the WebAssembly sandbox did not provide [12]. Database access goes through Hyperdrive, which now covers PostgreSQL and MySQL for Python Workers [14]. Anything else that opens a native socket is still a porting problem, because WebAssembly compatibility does not make every socket-dependent package portable [15].
One more detail worth knowing before you plan an architecture around this: a Python Worker can be created inside another Worker using Dynamic Workers [18]. Cloudflare's own sample in the post is a FastAPI route that awaits `env.AI.run` against the model `@cf/openai/gpt-oss-120b` [17].
What to watch
- Whether Cloudflare publishes Pyodide cold-start times and package size limits for GA Python Workers.
- Whether a Python socket bridge lands so outbound TCP stops going through JavaScript's connect().
- Which Python packages get Pyodide builds, and whether Cloudflare maintains a supported package list.