Workflows, Workers - Build durable multi-step applications in Python with Workflows (now in beta)
10mo ago
Source
CloudflareWorkflows, Workers - Build durable multi-step applications in Python with Workflows (now in beta)cloudflare.comYou 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 () class Default ( WorkerEntrypoint ): async def fetch ( self , request ): await self . env . MY_WORKFLOW . create () return Response ( "Hello Workflow creation!" ) Note Python Workflows requires a compatibility_date = "2025-08-01" , or lower, in your wrangler toml file. 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 .
You might also wanna read
Python's Async Programming: 10 Years Later and Still Underutilized
This article examines why async programming in Python hasn't gained more widespread adoption despite being available for 10 years since Pyth
tonybaloney.github.io·10mo ago
Workflow SDK: Adding Durability and Reliability to TypeScript Functions
The article introduces Workflow SDK, a tool that adds durability, reliability, and observability to asynchronous JavaScript/TypeScript funct
Running Python code in a sandbox with MicroPython and WebAssembly
The article describes the author's experimentation with running Python code in a sandbox environment using MicroPython compiled to WebAssemb
simonwillison.net·28d ago
Python 3.14 Delivers JIT Compiler and GIL-Free Concurrency
Python 3.14 introduces two major features: a new JIT (Just-In-Time) compiler and the removal of the Global Interpreter Lock (GIL), enabling
Analyzing Python asyncio Primitive Limitations for Shared State Coordination
This technical article examines the limitations of Python's asyncio primitives (Event and Condition) for managing shared state in concurrent
Show HN: Pipo360 – Generate production-ready back end APIs in 60 seconds with AI
pipo360.xyz·1y ago

Comments
Sign in to join the conversation.
No comments yet. Be the first.