Skip to content

Commit bf33ba3

Browse files
authored
- created changelog entry for Python Workflows beta release (cloudflare#24669)
1 parent 76e7afb commit bf33ba3

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Build durable multi-step applications in Python with Workflows (now in beta)
3+
description: Python Workflows is now open beta - build Workflows in Python.
4+
products:
5+
- workflows
6+
- workers
7+
date: 2025-08-22
8+
---
9+
10+
import { Render, PackageManagers, TypeScriptExample } from "~/components"
11+
12+
You can now build [Workflows](/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](/workers/languages/python/) runtime.
13+
14+
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](/workflows/python/dag/), where you can define complex dependencies between steps using the depends parameter.
15+
16+
Here’s a simple example:
17+
18+
```python
19+
from workers import Response, WorkflowEntrypoint
20+
21+
class PythonWorkflowStarter(WorkflowEntrypoint):
22+
async def run(self, event, step):
23+
@step.do("my first step")
24+
async def my_first_step():
25+
# do some work
26+
return "Hello Python!"
27+
28+
await my_first_step()
29+
30+
await step.sleep("my-sleep-step", "10 seconds")
31+
32+
@step.do("my second step")
33+
async def my_second_step():
34+
# do some more work
35+
return "Hello again!"
36+
37+
await my_second_step()
38+
39+
async def on_fetch(request, env):
40+
await env.MY_WORKFLOW.create()
41+
return Response("Hello Workflow creation!")
42+
```
43+
44+
:::note
45+
Python Workflows requires a `compatibility_date = "2025-08-01"`, or lower, in your wrangler toml file.
46+
:::
47+
48+
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.
49+
50+
To learn more and get started, refer to [Python Workflows documentation](/workflows/python/).

src/content/docs/workflows/python/bindings.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ sidebar:
99
---
1010
import { WranglerConfig } from "~/components"
1111

12+
:::caution[Python Workflows are in beta, as well as the underlying platform.]
13+
14+
You must add both `python_workflows` and `python_workers` compatibility flags to your `wrangler.toml` file.
15+
16+
Also, Python Workflows requires `compatibility_date = "2025-08-01"`, or lower, to be set in your `wrangler.toml` file.
17+
:::
18+
1219
The Python Workers platform leverages FFI to access bindings to Cloudflare resources. Refer to the [bindings](/workers/languages/python/ffi/#using-bindings-from-python-workers) documentation for more information.
1320

1421
From the configuration perspective, enabling Python Workflows requires adding the `python_workflows` compatibility flag to your `wrangler.toml` file.
@@ -67,6 +74,7 @@ Create (trigger) a new instance of a given Workflow.
6774

6875
```python
6976
from pyodide.ffi import to_js
77+
from js import Object
7078

7179
async def on_fetch(request, env, ctx):
7280
event = {"foo": "bar"}
@@ -93,6 +101,7 @@ Each element of the `batch` list is expected to include both `id` and `params` p
93101

94102
```python
95103
from pyodide.ffi import to_js
104+
from js import Object
96105

97106
# Create a new batch of 3 Workflow instances, each with its own ID and pass params to the Workflow instances
98107
listOfInstances = [
@@ -134,6 +143,7 @@ Send an event to a workflow instance.
134143

135144
```python
136145
from pyodide.ffi import to_js
146+
from js import Object
137147

138148
await env.MY_WORKFLOW.send_event(to_js({ "type": "my-event-type", "payload": { "foo": "bar" } }, dict_converter=Object.fromEntries))
139149
```

src/content/docs/workflows/python/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Refer to [Python Workers](/workers/languages/python) for more information about
1515

1616
You must add both `python_workflows` and `python_workers` compatibility flags to your `wrangler.toml` file.
1717

18+
Also, Python Workflows requires `compatibility_date = "2025-08-01"`, or lower, to be set in your `wrangler.toml` file.
19+
1820
Join the #python-workers channel in the [Cloudflare Developers Discord](https://discord.cloudflare.com/) and let us know what you'd like to see next.
1921
:::
2022

src/content/release-notes/workflows.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ entries:
99
Workflows can now be tested with new test APIs available in the "cloudflare:test" module.
1010
1111
More information available in the Vitest integration [docs](/workers/testing/vitest-integration/test-apis/#workflows).
12+
- publish_date: "2025-08-22"
13+
title: "Python Workflows is now open beta"
14+
description: |-
15+
[Python Workflows](/workflows/python/) is now in open beta, and available to any developer a free or paid Workers plan.
16+
17+
More information available in the [changelog](/changelog/2025-08-22-workflows-python-beta/).
1218
- publish_date: "2025-05-07"
1319
title: "Search for specific Workflows"
1420
description: |-

0 commit comments

Comments
 (0)