Cloud Computing and Data Centers

Cloudflare Officially Enables Python Workers to Run Python Applications on Its Platform

Cloudflare announced the general availability of Python Workers, making Python an officially supported language within the Workers environment with direct integration with services such as Workers AI, R2, D1, and Hyperdrive. The release supports the FastAPI, Django, and Flask frameworks and artificial intelligence libraries, while compatibility with WebAssembly packages continues to expand.

2026-09-21
4 min read
336 views
certi.news Editorial Team
Cloudflare Officially Enables Python Workers to Run Python Applications on Its Platform

Cloudflare announced the general availability (GA) of Python Workers, two years after introducing it as a way to run Python applications within the Cloudflare Workers environment. With this step, Python has become an officially supported language within the Cloudflare Developer Platform, with the ability to use well-known libraries and frameworks and connect them to Cloudflare services without writing a JavaScript integration layer.

The new environment enables the use of the FastAPI, Django, and Flask frameworks, along with other frameworks compatible with WSGI or ASGI. Cloudflare provides connectors such as workers.asgi and workers.wsgi to convert Workers requests into the structure expected by Python applications, while the Workers platform handles request reception, scaling, and load balancing.

Direct integration with Cloudflare services

One of the main practical changes is support for Cloudflare bindings directly within Python. Previously, passing Python objects to services such as Queues required manually converting them into JavaScript objects using Pyodide and JavaScript interfaces. Now, the Workers environment and Python package handle type conversion, allowing calls to be used with ordinary Python syntax.

This includes Workers AI, R2, D1, Hyperdrive, Durable Objects, Queues, and Workflows. Cloudflare also enables the creation of a Python Worker inside another Worker using Dynamic Workers.

Databases and network connections

Python applications can now use Hyperdrive to connect to PostgreSQL and MySQL databases. The lack of TCP socket support had been an obstacle to running database drivers inside WebAssembly, because these drivers typically rely on POSIX system calls for networking. According to Cloudflare, the company addressed this by implementing socket calls using the Workers connect API, allowing drivers such as aiomysql and asyncpg to work without modification or knowledge of the underlying environment’s details.

What is changing for AI developers?

It is now possible to run libraries such as openai, langchain, and mcp inside Python Workers. Cloudflare has also worked to enable HTTP clients such as requests and httpx to route requests through JavaScript fetch in WebAssembly environments. Developers can combine these libraries with Workers AI to perform inference on GPU units across the Cloudflare network, or route requests through Cloudflare AI Gateway.

The company presents examples of applications that include orchestrating AI tasks using Queues, Workflows, Workers AI, and R2; processing event streams in real time through Bluesky Jetstream and Durable Objects; as well as MCP servers and RAG systems with Vectorize.

Limitations and open questions

Python Workers relies on a Python interpreter compiled to WebAssembly using Pyodide. Therefore, packages that include native extensions written in C, C++, or Rust require a custom build for the WebAssembly platform. Cloudflare says that the PyEmscripten standard, associated with proposal PEP 783, and updated build tools will help expand the package ecosystem, but the company acknowledges that adoption of this standard is still ongoing and that some packages may not yet be supported.

certi.news analysis: The change is not merely the addition of a new programming language, but a reduction in reliance on JavaScript when building Python services distributed at the edge. This matters to development teams that have Python applications or libraries and want to connect them to Cloudflare services, but it does not eliminate the need to check package compatibility and WebAssembly limitations before moving existing applications into production. Cloudflare’s future promises to improve performance and memory efficiency and support more packages also make clear that general availability represents an important maturity milestone, not the end of work on the platform.

News source
Cloudflare Blog
Open original source ↗
c
Author

certi.news Editorial Team

What you need to know

Cloudflare has made the Python Workers platform generally available, allowing Python applications and frameworks such as FastAPI, Django, and Flask to run within the Workers environment and connect directly to Cloudflare services. Some packages that rely on native extensions still require WebAssembly compatibility or a custom build.

  • Python is now an officially supported language on the Cloudflare Developer Platform following the general availability of Python Workers.
  • The environment supports FastAPI, Django, and Flask, as well as WSGI- and ASGI-compatible applications through workers.wsgi and workers.asgi.
  • Python applications can connect directly to Workers AI, R2, D1, Hyperdrive, Durable Objects, Queues, and Workflows.
  • Python Workers supports libraries such as openai, langchain, and mcp, with the option to use Workers AI or Cloudflare AI Gateway.
  • Python Workers uses a WebAssembly-based Python interpreter through Pyodide, so some packages with extensions written in C, C++, or Rust may not work without a custom build.
  • Hyperdrive can now be used to connect to PostgreSQL and MySQL databases, with support for drivers such as aiomysql and asyncpg through the Workers connect API.

FAQ

What are Python Workers?

They are a Cloudflare environment for running Python applications within the Cloudflare Workers platform, with direct integration with Cloudflare services.

Which frameworks do Python Workers support?

The release supports FastAPI, Django, and Flask, as well as other WSGI- or ASGI-compatible frameworks.

Do all Python packages work on Python Workers?

Not necessarily. Packages containing native extensions written in C, C++, or Rust may require a custom build for the WebAssembly platform, and some packages may not yet be supported.

Which Cloudflare services can Python applications use?

They include Workers AI, R2, D1, Hyperdrive, Durable Objects, Queues, and Workflows. Cloudflare AI Gateway can also be used.

In the same category

You may also like

View all news