# Python Workers Are Now Generally Available: A New Era for Serverless Python Development
## Introduction
After two years of development and iteration, Python Workers have reached a significant milestone: general availability. This launch marks the moment when Python becomes a first-class, fully supported language within a leading cloud serverless runtime, joining the ranks of TypeScript and other established languages.
The vision has always been straightforward — make it as simple to write serverless applications in Python as it is in any other language, while ensuring the vast ecosystem of Python packages and frameworks works seamlessly out of the box. Today, that vision is a reality.
## Why Python on a Serverless Platform Matters
Python has long been one of the most popular programming languages in the world, particularly dominant in data science, machine learning, and web development. However, bringing Python into a serverless environment required solving unique technical challenges.
The serverless runtime has supported WebAssembly since 2018, which provided the ideal foundation for running a WebAssembly-compiled Python interpreter. By leveraging Pyodide, the team was able to quickly support a wide range of Python applications in the serverless environment, paving the way for what would eventually become a production-ready platform.
## First-Class Cloud Platform Integrations
One of the most important updates is that Python Workers now natively support all major platform bindings. Previously, developers had to write intermediate glue code to convert Python objects into the JavaScript objects expected by the runtime. Sending a Python dictionary into a queuing service, for instance, required explicit type conversion at the boundary.
This friction has been completely eliminated. The entire type conversion process is now encapsulated within the runtime and the Python software development kit. Developers can now use all platform bindings — from AI inference services and object storage to relational databases, key-value stores, and durable stateful objects — in a fully Pythonic way without writing a single line of JavaScript or TypeScript.
## Running Popular Web Frameworks
Python Workers now support the most popular Python web frameworks, including FastAPI, Django, and Flask. A built-in connector bridges the gap between standard web application interfaces and the serverless runtime.
For asynchronous frameworks like FastAPI, the `asgi` package provides a thin, optimized layer that translates incoming requests into the standard ASGI structures that Python applications expect. For synchronous frameworks like Django, a corresponding `wsgi` package handles the same translation for WSGI-compliant applications.
This approach is elegant because it does not require running a separate web server. The serverless platform itself handles load balancing and scaling globally, so the connectors simply act as a bridge between the native runtime and the application framework. This means developers can focus entirely on writing application logic while the platform handles traffic distribution and scaling across the globe.
The connectors are not limited to just FastAPI, Django, or Flask — any Python web framework that implements the WSGI or ASGI interface can be used.
## Connecting to Relational Databases via Hyperdrive
Historically, one of the biggest limitations of running Python in a WebAssembly sandbox was the inability to use TCP sockets. Python database drivers like `aiomysql` and `asyncpg` rely on the standard library’s socket module, which made POSIX system calls that simply could not work inside a WebAssembly environment.
The team solved this by implementing socket system calls using the platform’s native connection API. When a database driver attempts to open a TCP connection, it goes through a custom socket syscall implementation that translates standard Python socket operations into the corresponding JavaScript calls used by the runtime. Because this translation happens at the system call level, existing database drivers work without any modifications.
This breakthrough enables Hyperdrive integration for Python Workers, allowing developers to connect to PostgreSQL and MySQL databases directly from serverless functions using the familiar database drivers they already know.
## Expanding the WebAssembly Package Ecosystem
Running Python inside WebAssembly means that any packages with native C, C++, or Rust extensions must be cross-compiled to WebAssembly to function correctly. Previously, there was no standardized way to do this, so only a limited number of packages could be manually compiled and hosted.
To address this at scale, a proposal was introduced to standardize a platform for running Python in browser and edge runtimes, building on top of Pyodide. After extensive community discussion and refinement, the proposal was accepted, creating a path for package maintainers to build and publish packages that work across all environments supporting this standard.
The existing build toolchain has been stabilized and made accessible to all package maintainers. Additionally, support for this platform has been added to widely used packaging tools, making it easier for the broader community to adopt. The long-term goal is for every Python package to eventually have a wheel that works with WebAssembly, and the team is actively working with major package maintainers to make this a reality.
## Building AI Agents and Pipelines
The extensive ecosystem of data science and machine learning libraries makes Python the natural choice for building intelligent agents and AI pipelines. However, libraries like `openai`, `langchain`, and `mcp` historically had issues in serverless Python environments because they relied on HTTP clients that required low-level socket operations that were not supported.
This has been resolved through upstream contributions that allow these HTTP clients to route requests directly through the native fetch API in WebAssembly environments. Combined with the newly supported low-level socket operations, the entire networking stack now works seamlessly inside Python Workers.
Developers can now run AI libraries natively in serverless functions and combine them with the platform’s AI inference capabilities to run serverless model execution on GPUs, or proxy requests through AI gateway services.
## What You Can Build Today
A collection of production-ready patterns has been assembled to demonstrate the capabilities of Python Workers in combination with the broader cloud platform. Example use cases include:
– **Asynchronous AI orchestration** — Building full-stack AI applications that accept user requests, queue tasks, orchestrate image generation via AI inference, and store results in object storage, all written in Python.
– **Real-time stream processing** — Connecting to WebSocket-based event streams and maintaining persistent state using durable, long-lived objects.
– **Model Context Protocol servers** — Deploying AI-facing servers that give assistants access to edge data.
– **Retrieval-Augmented Generation systems** — Combining AI inference with vector databases to build intelligent search and retrieval pipelines.
Additionally, documentation across the entire cloud platform now includes Python code examples alongside JavaScript and TypeScript equivalents, making it easier than ever to follow along with tutorials and guides in Python.
## Frequently Asked Questions
### What does “generally available” mean for Python Workers?
General availability means Python is now a fully supported, production-ready language on the cloud serverless platform. It is no longer in beta or experimental status. Developers can use it confidently in production applications, and it comes with the same level of support, documentation, and integration as other first-class languages on the platform.
### Can I use my existing Python frameworks like FastAPI or Flask?
Yes. Python Workers support popular web frameworks including FastAPI, Django, and Flask. The platform provides built-in ASGI and WSGI connectors that allow you to run these frameworks without modification, simply by adding a small amount of glue code to adapt them to the serverless environment.
### Do I need to know JavaScript or TypeScript to use Python Workers?
No. All type conversions between Python and the underlying runtime are handled automatically. You can use all platform bindings and services entirely in Python without needing to write or understand any JavaScript or TypeScript code.
### What databases can I connect to from Python Workers?
Through Hyperdrive integration, you can connect to PostgreSQL and MySQL databases directly from Python Workers using standard database drivers like `aiomysql` and `asyncpg`. The platform handles the TCP socket translation transparently.
### Are there limitations on which Python packages I can use?
Because Python Workers run in a WebAssembly sandbox, packages with native C, C++, or Rust extensions need to be cross-compiled to WebAssembly. The ecosystem is continuously expanding, and many popular packages are already supported. If you encounter a package that is not yet available, the platform team encourages you to report it so they can work on adding support.
### Can I run AI models directly in Python Workers?
Yes. You can use the platform’s AI inference bindings directly from Python, and you can also integrate with popular AI libraries like LangChain and the official MCP Python package to build sophisticated AI agents and pipelines.
### What is Dynamic Workers?
Dynamic Workers allow you to create a Python Worker programmatically from within another Worker. This enables advanced patterns where one Worker can dynamically generate and deploy another Worker at runtime.
## Conclusion
The general availability of Python Workers represents a major step forward for serverless computing. By combining the simplicity and richness of the Python ecosystem with the global scale and performance of a modern cloud serverless platform, developers now have a powerful way to build everything from simple APIs to complex AI-powered applications — all in Python.
With native framework support, seamless database connectivity, expanded package compatibility, and first-class integrations with AI and data services, Python Workers offer a compelling option for teams that want to leverage their existing Python expertise in a serverless context. The journey is far from over, and the platform team continues to invest in performance improvements, memory efficiency, and broader package support.
Thank you for reading



