Skip to content

Commit 75aa789

Browse files
[Workflows] Updating Workflows overview (#24341)
* Updating Workflows overview * Update src/content/docs/workflows/index.mdx Co-authored-by: Kate Tungusova <[email protected]> --------- Co-authored-by: Kate Tungusova <[email protected]>
1 parent 51b1436 commit 75aa789

File tree

1 file changed

+52
-4
lines changed

1 file changed

+52
-4
lines changed

src/content/docs/workflows/index.mdx

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ head:
1010
content: Overview
1111
---
1212

13-
import { CardGrid, Description, Feature, LinkTitleCard, Plan, RelatedProduct } from "~/components"
13+
import { CardGrid, Description, Feature, LinkTitleCard, Plan, RelatedProduct, Tabs, TabItem, LinkButton } from "~/components"
1414

1515
<Description>
1616

@@ -20,9 +20,57 @@ Build durable multi-step applications on Cloudflare Workers with Workflows.
2020

2121
<Plan type="workers-all" />
2222

23-
Workflows is a durable execution engine built on Cloudflare Workers. Workflows allow you to build multi-step applications that can automatically retry, persist state and run for minutes, hours, days, or weeks. Workflows introduces a programming model that makes it easier to build reliable, long-running tasks, observe as they progress, and programatically trigger instances based on events across your services.
24-
25-
Refer to the [get started guide](/workflows/get-started/guide/) to start building with Workflows.
23+
With Workflows, you can build applications that chain together multiple steps, automatically retry failed tasks,
24+
and persist state for minutes, hours, or even weeks - with no infrastructure to manage.
25+
26+
Workflows give you:
27+
28+
- Reliable multi-step operations without worrying about timeouts
29+
- Automatic retries and error handling
30+
- Built-in observability for long running operations
31+
- Simple and expressive code for complex processes
32+
33+
<Tabs>
34+
<TabItem label="Workflow Code">
35+
```ts
36+
export class CheckoutWorkflow extends WorkflowEntrypoint {
37+
async run (event, step) {
38+
const processorResponse = await step.do( 'submit payment', async () => {
39+
let resp = await submitToPaymentProcessor(event.params.payment) ;
40+
return await resp.json<any>();
41+
}) ;
42+
43+
const textResponse = await step.do( 'send confirmation text', sendConfirmation);
44+
await step.sleep('wait for feedback', '2 days');
45+
await step.do('send feedback email', sendFeedbackEmail);
46+
await step.sleep('delay before marketing', '30 days');
47+
await step.do( 'send marketing follow up', sendFollowUp);
48+
}
49+
}
50+
```
51+
</TabItem>
52+
<TabItem label="Workflow Config">
53+
54+
```json
55+
{
56+
"name": "my-worker-with-workflow",
57+
"main": "src/index.js",
58+
"compatibility_date": "2025-02-27",
59+
"workflows": [
60+
{
61+
"name": "checkout-workflow",
62+
"binding": "CHECKOUT",
63+
"class_name": "CheckoutWorkflow"
64+
}
65+
]
66+
}
67+
```
68+
</TabItem>
69+
</Tabs>
70+
71+
<LinkButton href="/workflows/get-started/guide/">
72+
Start building with Workflows
73+
</LinkButton>
2674

2775
***
2876

0 commit comments

Comments
 (0)