Cloudflare Python Workers Are Now Generally Available
On September 21, 2026, Cloudflare announced that Python Workers are generally available, making Python "a first-class, fully supported language" on its developer platform. The headline isn't just "another language at the edge." FastAPI, Django and Flask, plus AI libraries like openai, langchain and mcp, now run inside the same Workers runtime your JavaScript already lives in.
The problem: two teams, two languages, one glue layer
Plenty of teams write the frontend and the thin backend in TypeScript, while the AI and data logic lives in Python. The usual result is a separate Python service on a container, a JavaScript layer in front of it forwarding requests, and double the deploy and monitoring surface.
Even inside Workers, the earlier Python support leaked the JavaScript boundary. Sending a message to a Queue meant converting a dict into a JS object by hand:
from pyodide.ffi import to_js
import js
self.env.QUEUE.send(to_js({"key": "value"}, dict_converter=js.Object.fromEntries))What changed
- Pythonic bindings. That line is now just
self.env.QUEUE.send({"key": "value"}). Coverage includes Workers AI, R2, D1, Hyperdrive, Durable Objects, Queues, Workflows and Vectorize. - Frameworks run as-is. Any WSGI or ASGI framework works through the built-in
workers.asgiandworkers.wsgiconnectors. - Databases over TCP. Cloudflare implemented socket syscalls on top of the Workers connect API, so drivers like
asyncpgandaiomysqlreach PostgreSQL and MySQL through Hyperdrive. - A packaging standard. PEP 783 (Emscripten Packaging) was accepted. It standardizes WebAssembly wheels with platform tags such as
pyemscripten_2026_0for Python 3.14, and lets maintainers build them withcibuildwheel.
Under the hood it's Pyodide, the Python interpreter compiled to WebAssembly, running in a runtime that has supported WebAssembly since 2018.
A practical example: FastAPI with Workers AI
Scaffolding and running go through uv and pywrangler (Node.js must also be installed):
uvx --from workers-py pywrangler init
uv run pywrangler dev
uv run pywrangler deployDependencies are declared in pyproject.toml:
[project]
name = "edge-api"
version = "0.1.0"
requires-python = ">=3.13"
dependencies = ["fastapi"]
[dependency-groups]
dev = ["workers-py", "workers-runtime-sdk"]The app is plain FastAPI, with bindings reachable through request.scope["env"]:
from fastapi import FastAPI, Request
from workers import asgi
app = FastAPI()
@app.get("/")
async def root(request: Request):
env = request.scope["env"]
return await env.AI.run(
"@cf/openai/gpt-oss-120b",
{
"instructions": "You are a friendly assistant.",
"input": "What is the origin of the phrase Hello, World?",
},
)
Default = asgi.entrypoint(app)Remember to add the python_workers compatibility flag to your Worker configuration.
Real-world caveats before you migrate
- Not every package is ready. Supported are pure-Python packages, PyEmscripten packages on PyPI, and packages bundled with Pyodide. The docs themselves say WebAssembly support for Python packages "is still in early stages," and the ecosystem is still adopting PEP 783. A library that depends on a native extension without a matching wheel won't load.
- No threading, no multiprocessing. Both import but don't function under the WebAssembly VM, and modules like
fcntl,termiosandvenvaren't available at all. Thread-based code needs to move toasyncio. - No performance numbers in the announcement. There are no published cold-start or memory figures in the GA post, so benchmark against your real workload before production.
- Server habits don't all carry over. A Worker has no persistent filesystem and no long-lived process; state belongs in D1, R2 or Durable Objects.
Takeaway
The value here is fewer systems, not one more language. Python AI logic can now share the same platform, bindings and deploy pipeline as your TypeScript. Start with a small endpoint with few dependencies, confirm your packages are supported, and measure before moving a whole service. If you already build on Workers, see also how Cloudflare rebuilt the Workers module registry.
Source: Cloudflare's GA announcement · Python Workers docs · PEP 783