You can now build Workflows using Python. With Python Workflows, you get automatic retries, state persistence, and the ability to run multi-step operations that can span minutes, hours, or weeks using Python’s familiar syntax and the Python Workers runtime.
Python Workflows use the same step-based execution model as JavaScript Workflows, but with Python syntax and access to Python’s ecosystem. Python Workflows also enable DAG (Directed Acyclic Graph) workflows, where you can define complex dependencies between steps using the depends parameter.
Here’s a simple example:
from workers import Response, WorkflowEntrypoint
class PythonWorkflowStarter(WorkflowEntrypoint): async def run(self, event, step): @step.do("my first step") async def my_first_step(): # do some work return "Hello Python!"
await my_first_step()
await step.sleep("my-sleep-step", "10 seconds")
@step.do("my second step") async def my_second_step(): # do some more work return "Hello again!"
await my_second_step()
async def on_fetch(request, env): await env.MY_WORKFLOW.create() return Response("Hello Workflow creation!")
Python Workflows support the same core capabilities as JavaScript Workflows, including sleep scheduling, event-driven workflows, and built-in error handling with configurable retry policies.
To learn more and get started, refer to Python Workflows documentation.
Source: Cloudflare
Latest Posts
- (Updated) Microsoft Copilot Studio: Agent ownership reassignment [MC1162291]
- Power Platform – Upcoming permission enforcement for Dataverse Solutions [MC1167434]
- (Updated) Microsoft Purview: IRM RBAC Change (related to Data Security Investigations) Preview [MC1041756]
- WAF – WAF Release – 2025-10-07 – Emergency
I’m curious about the real-world use cases for Python Workflows that might take advantage of this feature. I can imagine workflows for data processing or complex web scraping tasks that could benefit from the durability and retries.
Really interestingBlog comment creation update—bringing Workflows to Python feels like a big step for developers who are already comfortable in that ecosystem. The ability to handle long-running, multi-step processes with built-in retries and state persistence should make it much easier to build reliable apps without duct-taping different tools together. I’m curious to see how this compares in performance and flexibility to the existing JavaScript Workflows over time.