Skip to content

Commit d6ee014

Browse files
committed
docs: update tutorial steps and notes for backend setup and flow monitoring
- Changed tip to note in the backend tutorial for clarity - Updated instructions for creating and replacing the Edge Worker - Added a note emphasizing EdgeWorker's automatic handling of polling, retries, and failures - Improved instructions for updating configuration files - Enhanced flow status monitoring tips with SQL queries and links to documentation - Corrected formatting and wording for better readability and consistency
1 parent 455bdf0 commit d6ee014

File tree

1 file changed

+17
-11
lines changed
  • pkgs/website/src/content/docs/tutorials/ai-web-scraper

1 file changed

+17
-11
lines changed

pkgs/website/src/content/docs/tutorials/ai-web-scraper/backend.mdx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import JoinCommunity from '@/components/JoinCommunity.astro';
1010

1111
Let's build the backend workflow that powers your AI web scraper.
1212

13-
:::tip[New to pgflow?]
13+
:::note[New to pgflow?]
1414
If you haven't installed pgflow yet, check the [installation guide](/getting-started/install-pgflow/) first.
1515
:::
1616

@@ -275,13 +275,13 @@ Changing steps requires a new flow with unique `slug`. This is a current limitat
275275

276276
## Step 5 - Setup Edge Worker
277277

278-
Create an [Edge Worker](/edge-worker/getting-started/create-first-worker/) to run your flow:
278+
Create a worker function that will process steps from your flow:
279279

280280
```bash
281281
npx supabase functions new analyze_website_worker
282282
```
283283

284-
Replace the generated `index.ts`:
284+
Replace the generated `index.ts` with the following code:
285285

286286
```typescript title="supabase/functions/analyze_website_worker/index.ts"
287287
import { EdgeWorker } from "jsr:@pgflow/edge-worker";
@@ -290,11 +290,7 @@ import AnalyzeWebsite from '../_flows/analyze_website.ts';
290290
EdgeWorker.start(AnalyzeWebsite); // That's it! 🤯
291291
```
292292

293-
:::note[Worker magic]
294-
EdgeWorker handles polling, retries, and failures automatically. Your code just defines the flow shape!
295-
:::
296-
297-
Update `supabase/config.toml`:
293+
and update your `supabase/config.toml`:
298294

299295
```diff title="supabase/config.toml"
300296
[functions.analyze_website_worker]
@@ -307,6 +303,12 @@ Update `supabase/config.toml`:
307303
Only disable JWT for local development.
308304
:::
309305

306+
:::note[Worker magic]
307+
EdgeWorker handles polling, retries, and failures automatically. Your code just defines the flow shape!
308+
309+
See more in [Run your flow](/getting-started/run-flow/) documentation page
310+
:::
311+
310312
---
311313

312314
## Step 6 - Run & test
@@ -355,10 +357,14 @@ Check your database:
355357
select website_url, tags, summary from websites;
356358
```
357359

358-
:::tip[Debug like a pro]
359-
Check flow status anytime: `SELECT * FROM pgflow.runs WHERE flow_slug = 'analyze_website'`
360+
:::tip[Monitor with simple SQL queries]
361+
Check flow status anytime:
362+
363+
```sql
364+
SELECT * FROM pgflow.runs WHERE flow_slug = 'analyze_website'
365+
```
360366

361-
All state lives in Postgres - no external tools needed!
367+
See more in [Monitor flow execution](/how-to/monitor-flow-execution/) documentation page
362368
:::
363369

364370
---

0 commit comments

Comments
 (0)