Skip to content

Commit 2535e0a

Browse files
committed
wrap get-started guide
1 parent f5b3aaf commit 2535e0a

File tree

1 file changed

+17
-9
lines changed
  • src/content/docs/workflows/get-started

1 file changed

+17
-9
lines changed

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

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To learn more about Workflows, read [the beta announcement blog](https://blog.cl
1919

2020
Workflows allow you to build durable, multi-step applications using the Workers platform. A Workflow can automatically retry, persist state, run for hours or days, and coordinate between third-party APIs.
2121

22-
You can build Workflows to post-process file uploads to [R2 object storage](/r2/), automate generation of [Workers AI](/workers-ai/) embeddings into a [Vectorize](/vectorize/) vector database, or to trigger [user lifecycle emails](TODO) using your favorite email API.
22+
You can build Workflows to post-process file uploads to [R2 object storage](/r2/), automate generation of [Workers AI](/workers-ai/) embeddings into a [Vectorize](/vectorize/) vector database, or to trigger user lifecycle emails using your favorite email API.
2323

2424
This guide will instruct you through:
2525

@@ -183,7 +183,7 @@ We have a very basic Workflow definition, but now need to provide a way to call
183183
1. External HTTP requests via a `fetch()` handler
184184
2. Messages from a [Queue](/queues/)
185185
3. A schedule via [Cron Trigger](/workers/configuration/cron-triggers/)
186-
4. Via the [Workflows REST API](TODO) or [wrangler CLI](/workers/wrangler/commands/#workflows)
186+
4. Via the [Workflows REST API](/api/paths/accounts-account_id--workflows/get) or [wrangler CLI](/workers/wrangler/commands/#workflows)
187187

188188
Return to the `src/index.ts` file we created in the previous step and add a `fetch` handler that _binds_ to our Workflow. This binding allows us to create new Workflow instances, fetch the status of an existing Workflow, pause and/or terminate a Workflow.
189189

@@ -325,7 +325,15 @@ Deploying a Workflow is identical to deploying a Worker.
325325
npx wrangler deploy
326326
```
327327
```sh output
328-
TODO
328+
# Note the "Workflows" binding mentioned here, showing that
329+
# wrangler has detected your Workflow
330+
Your worker has access to the following bindings:
331+
- Workflows:
332+
- MY_WORKFLOW: MyWorkflow (defined in workflows-starter)
333+
Uploaded workflows-starter (2.53 sec)
334+
Deployed workflows-starter triggers (1.12 sec)
335+
https://workflows-starter.silverlock.workers.dev
336+
workflow: workflows-starter
329337
```
330338

331339
A Worker with a valid Workflow definition will be automatically registered by Workflows. You can list your current Workflows using wrangler:
@@ -334,12 +342,14 @@ A Worker with a valid Workflow definition will be automatically registered by Wo
334342
npx wrangler workflows list
335343
```
336344
```sh output
337-
TODO
345+
Showing last 1 workflow:
346+
┌───────────────────┬───────────────────┬────────────┬─────────────────────────┬─────────────────────────┐
347+
│ Name │ Script name │ Class name │ Created │ Modified │
348+
├───────────────────┼───────────────────┼────────────┼─────────────────────────┼─────────────────────────┤
349+
│ workflows-starter │ workflows-starter │ MyWorkflow │ 10/23/2024, 11:33:58 AM │ 10/23/2024, 11:33:58 AM │
350+
└───────────────────┴───────────────────┴────────────┴─────────────────────────┴─────────────────────────┘
338351
```
339352

340-
TODO - describe the output, Workflows, instances, etc.
341-
342-
343353
## 6. Run and observe your Workflow
344354

345355
With your Workflow deployed, you can now run it.
@@ -458,8 +468,6 @@ curl -s https://workflows-starter.YOUR_WORKERS_SUBDOMAIN.workers.dev/
458468

459469
## 7. (Optional) Clean up
460470

461-
TODO - delete the Workflow.
462-
463471
You can optionally delete the Workflow, which will prevent the creation of any (all) instances by using `wrangler`:
464472

465473
```sh

0 commit comments

Comments
 (0)