You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Define one or more steps that optionally return state.
107
111
let state =step.do("my first step", async () => {
108
112
@@ -125,9 +129,9 @@ When trying to decide whether to break code up into more than one step, a good r
125
129
126
130
For example, each of the below tasks is ideally encapsulated in its own step, so that any failure — such as a file not existing, a third-party API being down or rate limited — does not cause your entire program to fail.
127
131
128
-
* Reading or writing files from R2
132
+
* Reading or writing files from [R2](/r2/)
129
133
* Running an AI task using [Workers AI](/workers-ai/)
130
-
* Querying a D1 database or a database via [Hyperdrive](/hyperdrive/)
134
+
* Querying a [D1 database](/d1/) or a database via [Hyperdrive](/hyperdrive/)
131
135
* Calling a third-party API
132
136
133
137
If a subsequent step fails, your Workflow can retry from that step, using any state returned from a previous step. This can also help you avoid unnecessarily querying a database or calling an paid API repeatedly for data you have already fetched.
@@ -150,7 +154,7 @@ Open the `wrangler.toml` file at the root of your `workflows-starter` folder, wh
150
154
#:schema node_modules/wrangler/config-schema.json
151
155
name = "workflows-starter"
152
156
main = "src/index.ts"
153
-
compatibility_date = "2024-10-23"
157
+
compatibility_date = "2024-10-22"
154
158
155
159
[[workflows]]
156
160
# name of your workflow
@@ -159,7 +163,7 @@ name = "workflows-starter"
159
163
binding = "MY_WORKFLOW"
160
164
# this is class that extends the Workflow class in src/index.ts
161
165
class_name = "MyWorkflow"
162
-
# script_name is required during for the beta.
166
+
# script_name is required during the beta.
163
167
# Must match the "name" of your Worker at the top of wrangler.toml
164
168
script_name = "workflows-starter"
165
169
```
@@ -328,7 +332,7 @@ Your worker has access to the following bindings:
328
332
- MY_WORKFLOW: MyWorkflow (defined in workflows-starter)
0 commit comments