Skip to content

Commit 2e6f4fa

Browse files
committed
rename to workflows-starter
1 parent 1e77cce commit 2e6f4fa

File tree

1 file changed

+18
-19
lines changed
  • src/content/docs/workflows/get-started

1 file changed

+18
-19
lines changed

src/content/docs/workflows/get-started/guide.mdx

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ To continue:
4242
To create your first Workflow, use the `create cloudflare` (C3) CLI tool, specifying the Workflows starter template:
4343

4444
```sh
45-
npx create cloudflare@latest workflows-tutorial -- --template "cloudflare:workflows-tutorial"
45+
npx create cloudflare@latest workflows-starter -- --template "cloudflare:workflows-starter"
4646
```
4747

48-
This will create a new folder called `workflows-tutorial`.
48+
This will create a new folder called `workflows-starter`.
4949

5050
Open the `src/index.ts` file in your text editor. This file contains the following code, which is the most basic instance of a Workflow definition:
5151

@@ -148,25 +148,24 @@ The term "Durable Execution" is widely used to describe this programming model.
148148

149149
Before you can deploy a Workflow, you need to configure it.
150150

151-
Open the `wrangler.toml` file at the root of your `workflows-tutorial` folder, which contains the following `[[workflows]]` configuration:
151+
Open the `wrangler.toml` file at the root of your `workflows-starter` folder, which contains the following `[[workflows]]` configuration:
152152

153153
```toml title="wrangler.toml"
154-
name = "workflows-tutorial"
154+
#:schema node_modules/wrangler/config-schema.json
155+
name = "workflows-starter"
155156
main = "src/index.ts"
156-
compatibility_date = "2024-08-20"
157+
compatibility_date = "2024-10-16"
157158

158159
[[workflows]]
159-
# The name of the Workflow
160-
name = "workflows-tutorial"
161-
# The binding name, which must be a valid JavaScript variable name. This will
162-
# be how you call (run) your Workflow from your other Workers handlers or
163-
# scripts.
160+
# name of your workflow
161+
name = "workflows-starter"
162+
# binding name env.MYWORKFLOW
164163
binding = "MY_WORKFLOW"
165-
# script_name is required during for the beta.
166-
# Must match the "name" of your Worker at the top of wrangler.toml
167-
script_name = "workflows-tutorial"
168-
# Must match the class defined in your code that extends the Workflow class
164+
# this is class that extends the Workflow class in src/index.ts
169165
class_name = "MyWorkflow"
166+
# script_name is required during for the beta.
167+
# Must match the "name" of your Worker at the top of wrangler.toml
168+
script_name = "workflows-starter"
170169
```
171170

172171
:::note
@@ -269,7 +268,7 @@ Because Workflows can be long running, it's possible to have running instances t
269268
To trigger our Workflow, we will use the `wrangler` CLI and pass in an optional `--payload`. The `payload` will be passed to your Workflow's `run` method handler as an `Event`
270269

271270
```sh
272-
npx wrangler workflows trigger my-workflow '{"hello":"world"}'
271+
npx wrangler workflows trigger workflows-starter '{"hello":"world"}'
273272
```
274273
```sh output
275274
# Workflow instance "12dc179f-9f77-4a37-b973-709dca4189ba" has been queued successfully
@@ -278,12 +277,12 @@ npx wrangler workflows trigger my-workflow '{"hello":"world"}'
278277
To inspect the current status of the Workflow instance we just triggered, we can either reference it by ID or by using the keyword `latest`:
279278

280279
```sh
281-
npx wrangler@workflows workflows instances describe my-workflow latest
280+
npx wrangler@workflows workflows instances describe workflows-starter latest
282281
# Or by ID:
283-
# npx wrangler@workflows workflows instances describe my-workflow 12dc179f-9f77-4a37-b973-709dca4189ba
282+
# npx wrangler@workflows workflows instances describe workflows-starter 12dc179f-9f77-4a37-b973-709dca4189ba
284283
```
285284
```sh output
286-
Workflow Name: my-workflow
285+
Workflow Name: workflows-starter
287286
Instance Id: f72c1648-dfa3-45ea-be66-b43d11d216f8
288287
Version Id: cedc33a0-11fa-4c26-8a8e-7d28d381a291
289288
Status: ✅ Completed
@@ -363,7 +362,7 @@ In the previous step, we also bound a Workers script to our Workflow. You can tr
363362

364363
```sh
365364
# This must match the URL provided in step 6
366-
curl -s https://workflows-tutorial.YOUR_WORKERS_SUBDOMAIN.workers.dev/
365+
curl -s https://workflows-starter.YOUR_WORKERS_SUBDOMAIN.workers.dev/
367366
```
368367
```sh output
369368
{"id":"16ac31e5-db9d-48ae-a58f-95b95422d0fa","details":{"status":"queued","error":null,"output":null}}

0 commit comments

Comments
 (0)