Skip to content

Commit 478f9e0

Browse files
committed
Workflow example review
1 parent 30e3718 commit 478f9e0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/docs/workflows/examples/backup-d1.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ description: Send invoice when shopping cart is checked out and paid for
1717

1818
import { TabItem, Tabs } from "~/components"
1919

20-
In this example, we implement a Workflow periodically triggered by a [Cron Trigger](/workers/configuration/cron-triggers) to start a backup for a D1 database using the REST API and finally store the SQL dump in an [R2](/r2) bucket.
20+
In this example, we implement a Workflow periodically triggered by a [Cron Trigger](/workers/configuration/cron-triggers). That Workflow initiates a backup for a D1 database using the REST API, and then stores the SQL dump in an [R2](/r2) bucket.
2121

22-
Once a Workflow instance is triggered, fetches the REST API to start an export job for a specific database. Then, it fetches the same endpoint to check if the backup job is ready and the SQL dump is available to download.
22+
When the Workflow is triggered, it fetches the REST API to initiate an export job for a specific database. Then it fetches the same endpoint to check if the backup job is ready and the SQL dump is available to download.
2323

24-
As you can see, Workflows handles the responses and failures. It will retry the API calls until we get a successful response, retry fetching the backup from the URL provided, and retry saving the file to [R2](/r2). The developer doesn't have to care about any of that logic. The workflow can run until the backup file is ready, handling all the possible conditions until it is completed.
24+
As shown in this example, Workflows handles both the responses and failures, so the developer does not have to. Workflows retries the API calls until it gets a successful response, retries fetching the backup from the URL provided, and then retries saving the file to [R2](/r2). The workflow can run until the backup file is ready, handling all of the possible conditions until it is completed.
2525

26-
This is a simplified example of backing up a [D1](/d1) database. For every step, we use the [default](/workflows/build/sleeping-and-retrying) sleeping and retrying configuration. In a real-life scenario, we would assume more steps and additional logic, but this example gives you a good idea of what you can do with Workflows.
26+
This example provides simplified steps for backing up a [D1](/d1) database to help you understand the possibilities of Workflows. In every step, it uses the [default](/workflows/build/sleeping-and-retrying) sleeping and retrying configuration. In a real-world scenario, more steps and additional logic would likely be needed.
2727

2828
```ts
2929
import {
@@ -103,7 +103,7 @@ export default {
103103
};
104104
```
105105

106-
Here's a minimal package.json:
106+
Here is a minimal package.json:
107107

108108
```json
109109
{
@@ -114,7 +114,7 @@ Here's a minimal package.json:
114114
}
115115
```
116116

117-
And finally wrangler.toml:
117+
Here is a wrangler.toml:
118118

119119
import { WranglerConfig } from "~/components";
120120

0 commit comments

Comments
 (0)