Cloudflare changelogs | Developer platform
Cloudflare changelogs for Developer platform products
马上订阅 Cloudflare changelogs | Developer platform RSS 更新: https://developers.cloudflare.com/changelog/rss/developer-platform.xml
Workflows, Workers - Build durable multi-step applications in Python with Workflows (now in beta)
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!")Cloudflare changelogs | Developer platform
Cloudflare changelogs for Developer platform products
马上订阅 Cloudflare changelogs | Developer platform RSS 更新: https://developers.cloudflare.com/changelog/rss/developer-platform.xml
Workflows, Workers - Build durable multi-step applications in Python with Workflows (now in beta)
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!")