Skip to content

Commit 7a8f86c

Browse files
committed
Update minor typo in Python Workflows docs
1 parent a274b6b commit 7a8f86c

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

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

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ pcx_content_type: concept
44
sidebar:
55
order: 3
66
group:
7-
hideIndex: true
8-
7+
hideIndex: true
98
---
10-
import { WranglerConfig } from "~/components"
9+
10+
import { WranglerConfig } from "~/components";
1111

1212
:::caution[Python Workflows are in beta, as well as the underlying platform.]
1313

14-
You must add both `python_workflows` and `python_workers` compatibility flags to your `wrangler.toml` file.
14+
You must add both `python_workflows` and `python_workers` compatibility flags to your Wrangler config file.
1515

16-
Also, Python Workflows requires `compatibility_date = "2025-08-01"`, or lower, to be set in your `wrangler.toml` file.
16+
Also, Python Workflows requires `compatibility_date = "2025-08-01"`, or later, to be set in your Wrangler config file.
1717
:::
1818

1919
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.
@@ -40,7 +40,6 @@ class_name = "MyWorkflow"
4040

4141
</WranglerConfig>
4242

43-
4443
And this is how you use the payload in your workflow:
4544

4645
```python
@@ -54,23 +53,22 @@ class DemoWorkflowClass(WorkflowEntrypoint):
5453
return payload
5554
```
5655

57-
5856
## Workflow
5957

6058
The `Workflow` binding gives you access to the [Workflow](/workflows/build/workers-api/#workflow) class. All its methods are available
6159
on the binding.
6260

63-
Under the hood, the `Workflow` binding is a Javascript object that is exposed to the Python script via [JsProxy](https://pyodide.org/en/stable/usage/api/python-api/ffi.html#pyodide.ffi.JsProxy).
61+
Under the hood, the `Workflow` binding is a Javascript object that is exposed to the Python script via [JsProxy](https://pyodide.org/en/stable/usage/api/python-api/ffi.html#pyodide.ffi.JsProxy).
6462
This means that the values returned by its methods are also `JsProxy` objects, and need to be converted back into Python objects using `python_from_rpc`.
6563

66-
6764
### `create`
6865

6966
Create (trigger) a new instance of a given Workflow.
7067

71-
* <code>create(options=None)</code>
72-
* `options` - an **optional** dictionary of options to pass to the workflow instance. Should contain the same keys
73-
as the [WorkflowInstanceCreateOptions](/workflows/build/workers-api/#workflowinstancecreateoptions) type.
68+
- <code>create(options=None)</code>* `options` - an **optional** dictionary of
69+
options to pass to the workflow instance. Should contain the same keys as the
70+
[WorkflowInstanceCreateOptions](/workflows/build/workers-api/#workflowinstancecreateoptions)
71+
type.
7472

7573
```python
7674
from pyodide.ffi import to_js
@@ -82,6 +80,7 @@ async def on_fetch(request, env, ctx):
8280
await env.MY_WORKFLOW.create(options)
8381
return Response.json({"status": "success"})
8482
```
83+
8584
:::note
8685

8786
Values returned from steps need to be converted into Javascript objects using `to_js`. This is why we explicitly construct the payload using `Object.fromEntries`.
@@ -94,8 +93,9 @@ The `create` method returns a [`WorkflowInstance`](/workflows/build/workers-api/
9493

9594
Create (trigger) a batch of new workflow instances, up to 100 instances at a time. This is useful if you need to create multiple instances at once within the [instance creation limit](/workflows/reference/limits/).
9695

97-
* <code>create_batch(batch)</code>
98-
* `batch` - list of `WorkflowInstanceCreateOptions` to pass when creating an instance, including a user-provided ID and payload parameters.
96+
- <code>create_batch(batch)</code>* `batch` - list of
97+
`WorkflowInstanceCreateOptions` to pass when creating an instance, including a
98+
user-provided ID and payload parameters.
9999

100100
Each element of the `batch` list is expected to include both `id` and `params` properties:
101101

@@ -117,8 +117,7 @@ await env.MY_WORKFLOW.create_batch(listOfInstances);
117117

118118
Get a workflow instance by ID.
119119

120-
* <code>get(id)</code>
121-
* `id` - the ID of the workflow instance to get.
120+
- <code>get(id)</code>* `id` - the ID of the workflow instance to get.
122121

123122
Returns a [`WorkflowInstance`](/workflows/build/workers-api/#workflowinstance) object, which can be used to query the status of the workflow instance.
124123

@@ -137,9 +136,8 @@ await instance.terminate()
137136

138137
Send an event to a workflow instance.
139138

140-
* <code>send_event(options)</code>
141-
* `type` - the type of event to send to the workflow instance.
142-
* `payload` - the payload to send to the workflow instance.
139+
- <code>send_event(options)</code>* `type` - the type of event to send to the
140+
workflow instance. * `payload` - the payload to send to the workflow instance.
143141

144142
```python
145143
from pyodide.ffi import to_js

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ sidebar:
77
text: Beta
88
---
99

10-
1110
Workflow entrypoints can be declared using Python. To achieve this, you can export a `WorkflowEntrypoint` that runs on the Cloudflare Workers platform.
1211
Refer to [Python Workers](/workers/languages/python) for more information about Python on the Workers runtime.
1312

1413
:::caution[Python Workflows are in beta, as well as the underlying platform.]
1514

16-
You must add both `python_workflows` and `python_workers` compatibility flags to your `wrangler.toml` file.
15+
You must add both `python_workflows` and `python_workers` compatibility flags to your Wrangler config file.
1716

18-
Also, Python Workflows requires `compatibility_date = "2025-08-01"`, or lower, to be set in your `wrangler.toml` file.
17+
Also, Python Workflows require `compatibility_date = "2025-08-01"`, or later, to be set in your Wrangler config file.
1918

2019
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.
2120
:::
@@ -42,4 +41,4 @@ To deploy a Python Workflow to Cloudflare, run [`wrangler deploy`](/workers/wran
4241

4342
```bash
4443
npx wrangler@latest deploy
45-
```
44+
```

0 commit comments

Comments
 (0)