docs: add Recipes section with 5 real-world workflow guides - #1116

Closed
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes
Closed

docs: add Recipes section with 5 real-world workflow guides#1116
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes

Conversation

@johnlindquist

Copy link
Copy Markdown
Contributor

Summary

Adds a new Recipes documentation section with production-ready patterns for common workflow use cases. Each recipe was motivated by usage data analysis across 10 workflow categories.

New docs

RecipeUsage Signal
Data Synchronization — polling, batch sync, webhook-driven sync, reconciliation, idempotent writes100 teams, 369K runs, zero existing docs
Webhook Integrations — Slack events, GitHub webhooks, forwarding, cron processing40 teams, 516K runs, only primitives documented
Data Ingestion & File Processing — file uploads, event ingestion, email processing, resilient extraction23 teams, 1.1M runs, minimal docs
Notifications & Email — onboarding sequences, verification flows, contact forms, fan-out58 teams, 288K runs, zero existing docs
Error Monitoring & Alerting — error triage, alert routing, real-time dispatch, system monitoring19 teams, 4.7M runs (39% of all runs), zero docs

Structure

  • docs/content/docs/recipes/index.mdx — section overview with Cards
  • docs/content/docs/recipes/meta.json — navigation config
  • 5 recipe MDX files with full code examples
  • Updated top-level meta.json to include Recipes after AI Agents

Test plan

  • Verify all MDX files render correctly
  • Verify code examples are syntactically valid TypeScript
  • Verify navigation works (Recipes appears in sidebar)
  • Verify internal doc links resolve

Adds a new Recipes documentation section with production-ready patterns
for common workflow use cases, driven by usage data analysis:
- Data Synchronization (100 teams, 369K runs)
- Webhook Integrations (40 teams, 516K runs)
- Data Ingestion & File Processing (23 teams, 1.1M runs)
- Notifications & Email (58 teams, 288K runs)
- Error Monitoring & Alerting (19 teams, 4.7M runs)
@vercel

vercelBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bccdfa3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production531338572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds111459165
✅ 📋 Other135021156
Total2494482752817

❌ Failed Tests

▲ Vercel Production (3 failed)

astro (1 failed):

  • health check (queue-based) - workflow and step endpoints respond to health check messages

nextjs-turbopack (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed

nitro (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed
🌍 Community Worlds (45 failed)

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro4714
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
❌ nextjs-turbopack5011
✅ nextjs-webpack5101
❌ nitro4714
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
✅ mongodb4903
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.032s (-2.5%)1.005s (~)0.973s101.00x
💻 LocalNitro0.032s (-4.7%)1.005s (~)0.973s101.02x
🐘 PostgresNitro0.106s (-77.6% 🟢)1.009s (~)0.903s103.37x
🐘 PostgresExpress0.479s (+363.2% 🔺)1.010s (~)0.531s1015.16x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.589s (-14.6% 🟢)2.129s (+2.5%)1.540s101.00x
▲ VercelNext.js (Turbopack)0.635s (-21.9% 🟢)2.027s (-2.0%)1.392s101.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.103s (~)2.005s (~)0.902s101.00x
💻 LocalExpress1.104s (~)2.005s (~)0.901s101.00x
🐘 PostgresNitro1.933s (-17.6% 🟢)2.212s (-26.7% 🟢)0.278s101.75x
🐘 PostgresExpress2.296s (-7.3% 🟢)2.914s (-3.3%)0.618s102.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.299s (+2.3%)3.251s (+4.7%)0.951s101.00x
▲ VercelExpress3.701s (+69.6% 🔺)4.893s (+55.2% 🔺)1.192s101.61x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.815s (~)11.022s (~)0.207s31.00x
💻 LocalExpress10.825s (~)11.021s (~)0.196s31.00x
🐘 PostgresNitro14.882s (-26.3% 🟢)15.543s (-26.2% 🟢)0.661s21.38x
🐘 PostgresExpress15.219s (-25.2% 🟢)16.044s (-23.8% 🟢)0.826s21.41x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.433s (-1.3%)18.984s (+1.1%)1.552s21.00x
▲ VercelNext.js (Turbopack)17.826s (-10.5% 🟢)19.523s (-6.5% 🟢)1.697s21.02x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro27.471s (~)28.048s (~)0.578s31.00x
💻 LocalExpress27.479s (~)28.051s (~)0.572s31.00x
🐘 PostgresNitro36.233s (-28.2% 🟢)37.096s (-27.5% 🟢)0.863s21.32x
🐘 PostgresExpress37.773s (-24.7% 🟢)38.087s (-24.8% 🟢)0.313s21.38x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express44.720s (+4.2%)46.234s (+4.9%)1.514s21.00x
▲ VercelNext.js (Turbopack)48.102s (+11.3% 🔺)48.968s (+9.3% 🔺)0.866s21.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express57.178s (~)58.102s (~)0.924s21.00x
💻 LocalNitro57.258s (~)58.098s (~)0.841s21.00x
🐘 PostgresNitro72.562s (-27.5% 🟢)73.173s (-27.0% 🟢)0.611s21.27x
🐘 PostgresExpress75.153s (-25.1% 🟢)75.662s (-25.3% 🟢)0.509s21.31x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express90.088s (+2.0%)91.342s (+2.5%)1.254s11.00x
▲ VercelNext.js (Turbopack)93.322s (+5.9% 🔺)94.605s (+5.8% 🔺)1.283s11.04x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.408s (-1.8%)2.005s (~)0.597s151.00x
💻 LocalExpress1.414s (+0.9%)2.005s (~)0.591s151.00x
🐘 PostgresExpress1.844s (-23.4% 🟢)2.154s (-28.5% 🟢)0.310s141.31x
🐘 PostgresNitro2.190s (+2.6%)2.740s (-9.1% 🟢)0.549s111.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)13.444s (+293.8% 🔺)14.894s (+245.6% 🔺)1.450s31.00x
▲ VercelExpress18.410s (+658.4% 🔺)19.692s (+483.7% 🔺)1.283s21.37x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.581s (+1.1%)3.008s (~)0.427s101.00x
💻 LocalNitro2.584s (-0.8%)3.007s (~)0.423s101.00x
🐘 PostgresNitro10.114s (+19.2% 🔺)10.365s (+14.6% 🔺)0.251s33.92x
🐘 PostgresExpress10.620s (+31.6% 🔺)11.031s (+33.3% 🔺)0.411s34.11x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)12.420s (+289.5% 🔺)13.773s (+251.8% 🔺)1.353s31.00x
▲ VercelExpress18.796s (+504.9% 🔺)19.999s (+372.8% 🔺)1.203s21.51x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro7.445s (+1.3%)8.018s (~)0.573s41.00x
💻 LocalExpress7.460s (+2.5%)8.019s (~)0.559s41.00x
🐘 PostgresExpress48.794s (+17.2% 🔺)49.157s (+16.7% 🔺)0.363s16.55x
🐘 PostgresNitro51.668s (+6.9% 🔺)52.124s (+6.1% 🔺)0.456s16.94x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)24.942s (+391.1% 🔺)26.311s (+331.3% 🔺)1.369s21.00x
▲ VercelExpress28.201s (+507.9% 🔺)30.049s (+434.6% 🔺)1.848s11.13x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.431s (+0.8%)2.005s (~)0.574s151.00x
💻 LocalNitro1.437s (+0.5%)2.005s (~)0.568s151.00x
🐘 PostgresNitro1.946s (-14.3% 🟢)2.513s (-6.4% 🟢)0.567s121.36x
🐘 PostgresExpress2.219s (+13.0% 🔺)2.921s (+16.2% 🔺)0.703s111.55x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.719s (+599.0% 🔺)17.064s (+430.6% 🔺)1.345s21.00x
▲ VercelExpress24.020s (+986.3% 🔺)25.084s (+666.6% 🔺)1.063s21.53x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.673s (~)3.007s (~)0.334s101.00x
💻 LocalExpress2.705s (+0.8%)3.008s (~)0.303s101.01x
🐘 PostgresNitro10.674s (-19.9% 🟢)11.364s (-17.1% 🟢)0.690s33.99x
🐘 PostgresExpress10.736s (-6.3% 🟢)11.032s (-8.3% 🟢)0.296s34.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.853s (+93.5% 🔺)6.186s (+79.8% 🔺)1.333s51.00x
▲ VercelExpress7.043s (+166.2% 🔺)8.185s (+130.1% 🔺)1.142s41.45x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.849s (-2.8%)8.018s (-3.0%)0.168s41.00x
💻 LocalNitro8.017s (+1.9%)8.518s (+3.0%)0.501s41.02x
🐘 PostgresExpress51.610s (~)52.108s (~)0.498s16.57x
🐘 PostgresNitro53.153s (+2.3%)54.110s (+3.8%)0.957s16.77x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.903s (+27.1% 🔺)6.376s (+37.1% 🔺)1.473s51.00x
▲ VercelNext.js (Turbopack)10.880s (+182.0% 🔺)12.026s (+139.0% 🔺)1.147s32.22x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.172s (-1.9%)1.002s (~)0.012s (+5.4% 🔺)1.017s (~)0.845s101.00x
💻 LocalExpress0.175s (+3.8%)1.003s (~)0.011s (-8.7% 🟢)1.016s (~)0.841s101.02x
🐘 PostgresNitro0.791s (-64.5% 🟢)1.008s (-64.2% 🟢)0.001s (-29.4% 🟢)1.211s (-59.8% 🟢)0.420s104.61x
🐘 PostgresExpress1.260s (-48.7% 🟢)1.780s (-31.1% 🟢)0.001s (+7.7% 🔺)2.013s (-33.2% 🟢)0.753s107.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.941s (+18.2% 🔺)3.045s (-0.7%)0.082s (-64.7% 🟢)4.249s (+10.2% 🔺)1.308s101.00x
▲ VercelExpress3.025s (+53.8% 🔺)3.570s (+35.5% 🔺)0.547s (-9.9% 🟢)4.815s (+26.8% 🔺)1.790s101.03x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro7/12
🐘 PostgresNitro9/12
▲ VercelNext.js (Turbopack)7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)▲ Vercel12/12
Nitro💻 Local12/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Replace verbose polling/scheduling examples in error-monitoring and
webhook-integrations recipes with shorter inline snippets that link
to the canonical Scheduling & Cron foundations guide for depth.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thorough review of the recipes docs. Overall this is a solid addition — well-structured, consistent patterns, good use of idempotency keys and error handling throughout. A few issues below, most notably the broken links that the bot also flagged.

}
```

`sleep()` is durable — if the workflow restarts during a sleep, it resumes when the original duration expires. For comprehensive scheduling patterns including cron-like dispatching, health checks, and graceful shutdown, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: /docs/foundations/scheduling does not exist. The foundations section has no scheduling.mdx. Either link to an existing page (e.g., the sleep() API reference or common-patterns) or remove this sentence.

The vercel bot also flagged this.

}
```

This uses the durable polling pattern — `sleep()` consumes no compute while waiting, and the workflow resumes at the correct time even after restarts. For more advanced scheduling patterns including consecutive failure tracking, graceful shutdown, and cron-like dispatching, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: Same issue — /docs/foundations/scheduling doesn't exist. This is referenced in both this file and webhook-integrations.mdx.

if (response.status === 429) {
// Rate limited - back off exponentially // [!code highlight]
throw new RetryableError("Rate limited", { // [!code highlight]
retryAfter: metadata.attempt ** 2 * 1000, // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect retryAfter value type: metadata.attempt ** 2 * 1000 passes a raw number (milliseconds). Per RetryableErrorOptions, a bare number is interpreted as milliseconds, so 1000 = 1s, 4000 = 4s, 9000 = 9s. That's likely fine, but the inline comment says "back off exponentially" which might mislead readers into thinking it's seconds. Consider either:

  • Using a duration string for clarity: retryAfter: \${metadata.attempt ** 2}s``
  • Or adding a comment clarifying the unit is milliseconds

The workflow sleeps for real calendar time between sends. If the process restarts during a sleep, the workflow resumes at the correct point. Use [`FatalError`](/docs/api-reference/workflow/fatal-error) to skip retries for permanent failures like a missing email address.

<Callout type="info">
Email sends are side effects. Use [`getStepMetadata()`](/docs/api-reference/workflow/get-step-metadata) to pass a stable `stepId` as an idempotency key to your email provider, as shown in `sendConfirmationEmail` above. This prevents duplicate emails on retry. See [Idempotency](/docs/foundations/idempotency) for more details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale reference: The callout says "as shown in sendConfirmationEmail above", but sendConfirmationEmail is in the Contact Form Processing section further down the page, not above this callout. This callout is in the Email Onboarding Sequence section where none of the step functions use getStepMetadata() or stepId.

Either:

  1. Add an idempotency key to one of the onboarding step functions above to match the callout, or
  2. Rephrase to something like: "Use getStepMetadata() to pass a stable stepId as an idempotency key to your email provider to prevent duplicate emails on retry. See the Contact Form example below or the Idempotency guide."

"use workflow"; // [!code highlight]

// Replace slashes to keep tokens URL-safe
const safeRepoName = repoName.replace("/", ":"); // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: repoName.replace("/", ":") only replaces the first occurrence. For org/repo this works, but if there's ever a nested path this would be a subtle bug. Consider replaceAll or noting this only handles owner/repo format.

Minor since this is illustrative, but worth being precise in docs.

Each `fetchPrice` call is an independent step. If the API rate-limits the third symbol, the first two are already recorded and won't re-execute. The third step retries with exponential backoff until it succeeds or exhausts its retry budget.

<Callout type="info">
The default retry limit is 3. Set `fetchPrice.maxRetries = 10` after the function declaration to allow more attempts for flaky APIs. See [Errors and Retries](/docs/foundations/errors-and-retries) for the full retry API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "The default retry limit is 3" — to be precise, maxRetries = 3 means 4 total attempts (1 initial + 3 retries), per the existing errors-and-retries docs. Might be worth saying "The default is 3 retries (4 total attempts)" for consistency with the foundations page.


if (contacts.length > 0) {
await upsertContacts(contacts);
cursor = new Date();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: cursor is updated to new Date() after upserting, but this captures the time after the upsert completes, not the time of the last fetched record. If there's clock drift or the upsert takes time, you could miss records updated during that window. In a real implementation you'd use the updatedAt from the last returned contact.

Since this is a recipe/illustration it's probably fine, but a brief comment noting this simplification might help readers avoid this pitfall in production.


// The hook may not be registered yet — retry until it is
let delivered = false;
for (let i = 0; i < 5 && !delivered; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This retry loop for resumeHook is a practical pattern but a bit ugly for docs. The comment on line 164 explains the race well, and the callout below suggests createWebhook() as an alternative. Just flagging that this pattern could confuse readers — they might copy it verbatim. Consider adding a note that this is a simplification and production code should handle the !delivered case (e.g., return an error response).

.map((b) => b.toString(16).padStart(2, "0"))
.join("");

if (signature !== expected) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HMAC signature comparison uses string equality (signature !== expected) which is potentially vulnerable to timing attacks. For a security-sensitive operation like webhook signature verification, this should use crypto.timingSafeEqual (or crypto.subtle.timingSafeEqual where available). Since this is docs that people will copy, it's worth getting right.

Suggested change
if (signature !== expected) {
if (!crypto.subtle.timingSafeEqual) {
// Node.js < 22 fallback
const {timingSafeEqual} = await import("node:crypto");
if (!timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
await request.respondWith(new Response("Unauthorized", {status: 401}));
throw new FatalError("Invalid GitHub webhook signature");
}
} else if (signature !== expected) {

Or more simply, just use crypto.timingSafeEqual from node:crypto since steps have full Node.js access:

import{timingSafeEqual}from"node:crypto";// ...if(!timingSafeEqual(Buffer.from(signature),Buffer.from(expected))){

@johnlindquist

Copy link
Copy Markdown
ContributorAuthor

Closing — superseded by the cookbook work in #1564.

The 5 recipes here (data-sync, webhook-integrations, data-ingestion, email-notifications, error-monitoring) are covered by the restructured cookbook's 4-category system (common patterns, agent patterns, integrations, advanced). The "Recipes" section name was retired in favor of "Cookbook" per team decision on March 31.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@johnlindquist@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

docs: add Recipes section with 5 real-world workflow guides - #1116

Closed
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes
Closed

docs: add Recipes section with 5 real-world workflow guides#1116
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes

Conversation

@johnlindquist

Copy link
Copy Markdown
Contributor

Summary

Adds a new Recipes documentation section with production-ready patterns for common workflow use cases. Each recipe was motivated by usage data analysis across 10 workflow categories.

New docs

RecipeUsage Signal
Data Synchronization — polling, batch sync, webhook-driven sync, reconciliation, idempotent writes100 teams, 369K runs, zero existing docs
Webhook Integrations — Slack events, GitHub webhooks, forwarding, cron processing40 teams, 516K runs, only primitives documented
Data Ingestion & File Processing — file uploads, event ingestion, email processing, resilient extraction23 teams, 1.1M runs, minimal docs
Notifications & Email — onboarding sequences, verification flows, contact forms, fan-out58 teams, 288K runs, zero existing docs
Error Monitoring & Alerting — error triage, alert routing, real-time dispatch, system monitoring19 teams, 4.7M runs (39% of all runs), zero docs

Structure

  • docs/content/docs/recipes/index.mdx — section overview with Cards
  • docs/content/docs/recipes/meta.json — navigation config
  • 5 recipe MDX files with full code examples
  • Updated top-level meta.json to include Recipes after AI Agents

Test plan

  • Verify all MDX files render correctly
  • Verify code examples are syntactically valid TypeScript
  • Verify navigation works (Recipes appears in sidebar)
  • Verify internal doc links resolve

Adds a new Recipes documentation section with production-ready patterns
for common workflow use cases, driven by usage data analysis:
- Data Synchronization (100 teams, 369K runs)
- Webhook Integrations (40 teams, 516K runs)
- Data Ingestion & File Processing (23 teams, 1.1M runs)
- Notifications & Email (58 teams, 288K runs)
- Error Monitoring & Alerting (19 teams, 4.7M runs)
@vercel

vercelBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bccdfa3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production531338572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds111459165
✅ 📋 Other135021156
Total2494482752817

❌ Failed Tests

▲ Vercel Production (3 failed)

astro (1 failed):

  • health check (queue-based) - workflow and step endpoints respond to health check messages

nextjs-turbopack (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed

nitro (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed
🌍 Community Worlds (45 failed)

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro4714
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
❌ nextjs-turbopack5011
✅ nextjs-webpack5101
❌ nitro4714
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
✅ mongodb4903
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.032s (-2.5%)1.005s (~)0.973s101.00x
💻 LocalNitro0.032s (-4.7%)1.005s (~)0.973s101.02x
🐘 PostgresNitro0.106s (-77.6% 🟢)1.009s (~)0.903s103.37x
🐘 PostgresExpress0.479s (+363.2% 🔺)1.010s (~)0.531s1015.16x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.589s (-14.6% 🟢)2.129s (+2.5%)1.540s101.00x
▲ VercelNext.js (Turbopack)0.635s (-21.9% 🟢)2.027s (-2.0%)1.392s101.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.103s (~)2.005s (~)0.902s101.00x
💻 LocalExpress1.104s (~)2.005s (~)0.901s101.00x
🐘 PostgresNitro1.933s (-17.6% 🟢)2.212s (-26.7% 🟢)0.278s101.75x
🐘 PostgresExpress2.296s (-7.3% 🟢)2.914s (-3.3%)0.618s102.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.299s (+2.3%)3.251s (+4.7%)0.951s101.00x
▲ VercelExpress3.701s (+69.6% 🔺)4.893s (+55.2% 🔺)1.192s101.61x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.815s (~)11.022s (~)0.207s31.00x
💻 LocalExpress10.825s (~)11.021s (~)0.196s31.00x
🐘 PostgresNitro14.882s (-26.3% 🟢)15.543s (-26.2% 🟢)0.661s21.38x
🐘 PostgresExpress15.219s (-25.2% 🟢)16.044s (-23.8% 🟢)0.826s21.41x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.433s (-1.3%)18.984s (+1.1%)1.552s21.00x
▲ VercelNext.js (Turbopack)17.826s (-10.5% 🟢)19.523s (-6.5% 🟢)1.697s21.02x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro27.471s (~)28.048s (~)0.578s31.00x
💻 LocalExpress27.479s (~)28.051s (~)0.572s31.00x
🐘 PostgresNitro36.233s (-28.2% 🟢)37.096s (-27.5% 🟢)0.863s21.32x
🐘 PostgresExpress37.773s (-24.7% 🟢)38.087s (-24.8% 🟢)0.313s21.38x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express44.720s (+4.2%)46.234s (+4.9%)1.514s21.00x
▲ VercelNext.js (Turbopack)48.102s (+11.3% 🔺)48.968s (+9.3% 🔺)0.866s21.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express57.178s (~)58.102s (~)0.924s21.00x
💻 LocalNitro57.258s (~)58.098s (~)0.841s21.00x
🐘 PostgresNitro72.562s (-27.5% 🟢)73.173s (-27.0% 🟢)0.611s21.27x
🐘 PostgresExpress75.153s (-25.1% 🟢)75.662s (-25.3% 🟢)0.509s21.31x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express90.088s (+2.0%)91.342s (+2.5%)1.254s11.00x
▲ VercelNext.js (Turbopack)93.322s (+5.9% 🔺)94.605s (+5.8% 🔺)1.283s11.04x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.408s (-1.8%)2.005s (~)0.597s151.00x
💻 LocalExpress1.414s (+0.9%)2.005s (~)0.591s151.00x
🐘 PostgresExpress1.844s (-23.4% 🟢)2.154s (-28.5% 🟢)0.310s141.31x
🐘 PostgresNitro2.190s (+2.6%)2.740s (-9.1% 🟢)0.549s111.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)13.444s (+293.8% 🔺)14.894s (+245.6% 🔺)1.450s31.00x
▲ VercelExpress18.410s (+658.4% 🔺)19.692s (+483.7% 🔺)1.283s21.37x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.581s (+1.1%)3.008s (~)0.427s101.00x
💻 LocalNitro2.584s (-0.8%)3.007s (~)0.423s101.00x
🐘 PostgresNitro10.114s (+19.2% 🔺)10.365s (+14.6% 🔺)0.251s33.92x
🐘 PostgresExpress10.620s (+31.6% 🔺)11.031s (+33.3% 🔺)0.411s34.11x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)12.420s (+289.5% 🔺)13.773s (+251.8% 🔺)1.353s31.00x
▲ VercelExpress18.796s (+504.9% 🔺)19.999s (+372.8% 🔺)1.203s21.51x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro7.445s (+1.3%)8.018s (~)0.573s41.00x
💻 LocalExpress7.460s (+2.5%)8.019s (~)0.559s41.00x
🐘 PostgresExpress48.794s (+17.2% 🔺)49.157s (+16.7% 🔺)0.363s16.55x
🐘 PostgresNitro51.668s (+6.9% 🔺)52.124s (+6.1% 🔺)0.456s16.94x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)24.942s (+391.1% 🔺)26.311s (+331.3% 🔺)1.369s21.00x
▲ VercelExpress28.201s (+507.9% 🔺)30.049s (+434.6% 🔺)1.848s11.13x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.431s (+0.8%)2.005s (~)0.574s151.00x
💻 LocalNitro1.437s (+0.5%)2.005s (~)0.568s151.00x
🐘 PostgresNitro1.946s (-14.3% 🟢)2.513s (-6.4% 🟢)0.567s121.36x
🐘 PostgresExpress2.219s (+13.0% 🔺)2.921s (+16.2% 🔺)0.703s111.55x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.719s (+599.0% 🔺)17.064s (+430.6% 🔺)1.345s21.00x
▲ VercelExpress24.020s (+986.3% 🔺)25.084s (+666.6% 🔺)1.063s21.53x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.673s (~)3.007s (~)0.334s101.00x
💻 LocalExpress2.705s (+0.8%)3.008s (~)0.303s101.01x
🐘 PostgresNitro10.674s (-19.9% 🟢)11.364s (-17.1% 🟢)0.690s33.99x
🐘 PostgresExpress10.736s (-6.3% 🟢)11.032s (-8.3% 🟢)0.296s34.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.853s (+93.5% 🔺)6.186s (+79.8% 🔺)1.333s51.00x
▲ VercelExpress7.043s (+166.2% 🔺)8.185s (+130.1% 🔺)1.142s41.45x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.849s (-2.8%)8.018s (-3.0%)0.168s41.00x
💻 LocalNitro8.017s (+1.9%)8.518s (+3.0%)0.501s41.02x
🐘 PostgresExpress51.610s (~)52.108s (~)0.498s16.57x
🐘 PostgresNitro53.153s (+2.3%)54.110s (+3.8%)0.957s16.77x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.903s (+27.1% 🔺)6.376s (+37.1% 🔺)1.473s51.00x
▲ VercelNext.js (Turbopack)10.880s (+182.0% 🔺)12.026s (+139.0% 🔺)1.147s32.22x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.172s (-1.9%)1.002s (~)0.012s (+5.4% 🔺)1.017s (~)0.845s101.00x
💻 LocalExpress0.175s (+3.8%)1.003s (~)0.011s (-8.7% 🟢)1.016s (~)0.841s101.02x
🐘 PostgresNitro0.791s (-64.5% 🟢)1.008s (-64.2% 🟢)0.001s (-29.4% 🟢)1.211s (-59.8% 🟢)0.420s104.61x
🐘 PostgresExpress1.260s (-48.7% 🟢)1.780s (-31.1% 🟢)0.001s (+7.7% 🔺)2.013s (-33.2% 🟢)0.753s107.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.941s (+18.2% 🔺)3.045s (-0.7%)0.082s (-64.7% 🟢)4.249s (+10.2% 🔺)1.308s101.00x
▲ VercelExpress3.025s (+53.8% 🔺)3.570s (+35.5% 🔺)0.547s (-9.9% 🟢)4.815s (+26.8% 🔺)1.790s101.03x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro7/12
🐘 PostgresNitro9/12
▲ VercelNext.js (Turbopack)7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)▲ Vercel12/12
Nitro💻 Local12/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Replace verbose polling/scheduling examples in error-monitoring and
webhook-integrations recipes with shorter inline snippets that link
to the canonical Scheduling & Cron foundations guide for depth.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thorough review of the recipes docs. Overall this is a solid addition — well-structured, consistent patterns, good use of idempotency keys and error handling throughout. A few issues below, most notably the broken links that the bot also flagged.

}
```

`sleep()` is durable — if the workflow restarts during a sleep, it resumes when the original duration expires. For comprehensive scheduling patterns including cron-like dispatching, health checks, and graceful shutdown, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: /docs/foundations/scheduling does not exist. The foundations section has no scheduling.mdx. Either link to an existing page (e.g., the sleep() API reference or common-patterns) or remove this sentence.

The vercel bot also flagged this.

}
```

This uses the durable polling pattern — `sleep()` consumes no compute while waiting, and the workflow resumes at the correct time even after restarts. For more advanced scheduling patterns including consecutive failure tracking, graceful shutdown, and cron-like dispatching, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: Same issue — /docs/foundations/scheduling doesn't exist. This is referenced in both this file and webhook-integrations.mdx.

if (response.status === 429) {
// Rate limited - back off exponentially // [!code highlight]
throw new RetryableError("Rate limited", { // [!code highlight]
retryAfter: metadata.attempt ** 2 * 1000, // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect retryAfter value type: metadata.attempt ** 2 * 1000 passes a raw number (milliseconds). Per RetryableErrorOptions, a bare number is interpreted as milliseconds, so 1000 = 1s, 4000 = 4s, 9000 = 9s. That's likely fine, but the inline comment says "back off exponentially" which might mislead readers into thinking it's seconds. Consider either:

  • Using a duration string for clarity: retryAfter: \${metadata.attempt ** 2}s``
  • Or adding a comment clarifying the unit is milliseconds

The workflow sleeps for real calendar time between sends. If the process restarts during a sleep, the workflow resumes at the correct point. Use [`FatalError`](/docs/api-reference/workflow/fatal-error) to skip retries for permanent failures like a missing email address.

<Callout type="info">
Email sends are side effects. Use [`getStepMetadata()`](/docs/api-reference/workflow/get-step-metadata) to pass a stable `stepId` as an idempotency key to your email provider, as shown in `sendConfirmationEmail` above. This prevents duplicate emails on retry. See [Idempotency](/docs/foundations/idempotency) for more details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale reference: The callout says "as shown in sendConfirmationEmail above", but sendConfirmationEmail is in the Contact Form Processing section further down the page, not above this callout. This callout is in the Email Onboarding Sequence section where none of the step functions use getStepMetadata() or stepId.

Either:

  1. Add an idempotency key to one of the onboarding step functions above to match the callout, or
  2. Rephrase to something like: "Use getStepMetadata() to pass a stable stepId as an idempotency key to your email provider to prevent duplicate emails on retry. See the Contact Form example below or the Idempotency guide."

"use workflow"; // [!code highlight]

// Replace slashes to keep tokens URL-safe
const safeRepoName = repoName.replace("/", ":"); // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: repoName.replace("/", ":") only replaces the first occurrence. For org/repo this works, but if there's ever a nested path this would be a subtle bug. Consider replaceAll or noting this only handles owner/repo format.

Minor since this is illustrative, but worth being precise in docs.

Each `fetchPrice` call is an independent step. If the API rate-limits the third symbol, the first two are already recorded and won't re-execute. The third step retries with exponential backoff until it succeeds or exhausts its retry budget.

<Callout type="info">
The default retry limit is 3. Set `fetchPrice.maxRetries = 10` after the function declaration to allow more attempts for flaky APIs. See [Errors and Retries](/docs/foundations/errors-and-retries) for the full retry API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "The default retry limit is 3" — to be precise, maxRetries = 3 means 4 total attempts (1 initial + 3 retries), per the existing errors-and-retries docs. Might be worth saying "The default is 3 retries (4 total attempts)" for consistency with the foundations page.


if (contacts.length > 0) {
await upsertContacts(contacts);
cursor = new Date();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: cursor is updated to new Date() after upserting, but this captures the time after the upsert completes, not the time of the last fetched record. If there's clock drift or the upsert takes time, you could miss records updated during that window. In a real implementation you'd use the updatedAt from the last returned contact.

Since this is a recipe/illustration it's probably fine, but a brief comment noting this simplification might help readers avoid this pitfall in production.


// The hook may not be registered yet — retry until it is
let delivered = false;
for (let i = 0; i < 5 && !delivered; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This retry loop for resumeHook is a practical pattern but a bit ugly for docs. The comment on line 164 explains the race well, and the callout below suggests createWebhook() as an alternative. Just flagging that this pattern could confuse readers — they might copy it verbatim. Consider adding a note that this is a simplification and production code should handle the !delivered case (e.g., return an error response).

.map((b) => b.toString(16).padStart(2, "0"))
.join("");

if (signature !== expected) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HMAC signature comparison uses string equality (signature !== expected) which is potentially vulnerable to timing attacks. For a security-sensitive operation like webhook signature verification, this should use crypto.timingSafeEqual (or crypto.subtle.timingSafeEqual where available). Since this is docs that people will copy, it's worth getting right.

Suggested change
if (signature !== expected) {
if (!crypto.subtle.timingSafeEqual) {
// Node.js < 22 fallback
const {timingSafeEqual} = await import("node:crypto");
if (!timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
await request.respondWith(new Response("Unauthorized", {status: 401}));
throw new FatalError("Invalid GitHub webhook signature");
}
} else if (signature !== expected) {

Or more simply, just use crypto.timingSafeEqual from node:crypto since steps have full Node.js access:

import{timingSafeEqual}from"node:crypto";// ...if(!timingSafeEqual(Buffer.from(signature),Buffer.from(expected))){

@johnlindquist

Copy link
Copy Markdown
ContributorAuthor

Closing — superseded by the cookbook work in #1564.

The 5 recipes here (data-sync, webhook-integrations, data-ingestion, email-notifications, error-monitoring) are covered by the restructured cookbook's 4-category system (common patterns, agent patterns, integrations, advanced). The "Recipes" section name was retired in favor of "Cookbook" per team decision on March 31.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@johnlindquist@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: add Recipes section with 5 real-world workflow guides - #1116

Closed
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes
Closed

docs: add Recipes section with 5 real-world workflow guides#1116
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes

Conversation

@johnlindquist

Copy link
Copy Markdown
Contributor

Summary

Adds a new Recipes documentation section with production-ready patterns for common workflow use cases. Each recipe was motivated by usage data analysis across 10 workflow categories.

New docs

RecipeUsage Signal
Data Synchronization — polling, batch sync, webhook-driven sync, reconciliation, idempotent writes100 teams, 369K runs, zero existing docs
Webhook Integrations — Slack events, GitHub webhooks, forwarding, cron processing40 teams, 516K runs, only primitives documented
Data Ingestion & File Processing — file uploads, event ingestion, email processing, resilient extraction23 teams, 1.1M runs, minimal docs
Notifications & Email — onboarding sequences, verification flows, contact forms, fan-out58 teams, 288K runs, zero existing docs
Error Monitoring & Alerting — error triage, alert routing, real-time dispatch, system monitoring19 teams, 4.7M runs (39% of all runs), zero docs

Structure

  • docs/content/docs/recipes/index.mdx — section overview with Cards
  • docs/content/docs/recipes/meta.json — navigation config
  • 5 recipe MDX files with full code examples
  • Updated top-level meta.json to include Recipes after AI Agents

Test plan

  • Verify all MDX files render correctly
  • Verify code examples are syntactically valid TypeScript
  • Verify navigation works (Recipes appears in sidebar)
  • Verify internal doc links resolve

Adds a new Recipes documentation section with production-ready patterns
for common workflow use cases, driven by usage data analysis:
- Data Synchronization (100 teams, 369K runs)
- Webhook Integrations (40 teams, 516K runs)
- Data Ingestion & File Processing (23 teams, 1.1M runs)
- Notifications & Email (58 teams, 288K runs)
- Error Monitoring & Alerting (19 teams, 4.7M runs)
@vercel

vercelBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bccdfa3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production531338572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds111459165
✅ 📋 Other135021156
Total2494482752817

❌ Failed Tests

▲ Vercel Production (3 failed)

astro (1 failed):

  • health check (queue-based) - workflow and step endpoints respond to health check messages

nextjs-turbopack (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed

nitro (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed
🌍 Community Worlds (45 failed)

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro4714
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
❌ nextjs-turbopack5011
✅ nextjs-webpack5101
❌ nitro4714
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
✅ mongodb4903
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.032s (-2.5%)1.005s (~)0.973s101.00x
💻 LocalNitro0.032s (-4.7%)1.005s (~)0.973s101.02x
🐘 PostgresNitro0.106s (-77.6% 🟢)1.009s (~)0.903s103.37x
🐘 PostgresExpress0.479s (+363.2% 🔺)1.010s (~)0.531s1015.16x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.589s (-14.6% 🟢)2.129s (+2.5%)1.540s101.00x
▲ VercelNext.js (Turbopack)0.635s (-21.9% 🟢)2.027s (-2.0%)1.392s101.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.103s (~)2.005s (~)0.902s101.00x
💻 LocalExpress1.104s (~)2.005s (~)0.901s101.00x
🐘 PostgresNitro1.933s (-17.6% 🟢)2.212s (-26.7% 🟢)0.278s101.75x
🐘 PostgresExpress2.296s (-7.3% 🟢)2.914s (-3.3%)0.618s102.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.299s (+2.3%)3.251s (+4.7%)0.951s101.00x
▲ VercelExpress3.701s (+69.6% 🔺)4.893s (+55.2% 🔺)1.192s101.61x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.815s (~)11.022s (~)0.207s31.00x
💻 LocalExpress10.825s (~)11.021s (~)0.196s31.00x
🐘 PostgresNitro14.882s (-26.3% 🟢)15.543s (-26.2% 🟢)0.661s21.38x
🐘 PostgresExpress15.219s (-25.2% 🟢)16.044s (-23.8% 🟢)0.826s21.41x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.433s (-1.3%)18.984s (+1.1%)1.552s21.00x
▲ VercelNext.js (Turbopack)17.826s (-10.5% 🟢)19.523s (-6.5% 🟢)1.697s21.02x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro27.471s (~)28.048s (~)0.578s31.00x
💻 LocalExpress27.479s (~)28.051s (~)0.572s31.00x
🐘 PostgresNitro36.233s (-28.2% 🟢)37.096s (-27.5% 🟢)0.863s21.32x
🐘 PostgresExpress37.773s (-24.7% 🟢)38.087s (-24.8% 🟢)0.313s21.38x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express44.720s (+4.2%)46.234s (+4.9%)1.514s21.00x
▲ VercelNext.js (Turbopack)48.102s (+11.3% 🔺)48.968s (+9.3% 🔺)0.866s21.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express57.178s (~)58.102s (~)0.924s21.00x
💻 LocalNitro57.258s (~)58.098s (~)0.841s21.00x
🐘 PostgresNitro72.562s (-27.5% 🟢)73.173s (-27.0% 🟢)0.611s21.27x
🐘 PostgresExpress75.153s (-25.1% 🟢)75.662s (-25.3% 🟢)0.509s21.31x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express90.088s (+2.0%)91.342s (+2.5%)1.254s11.00x
▲ VercelNext.js (Turbopack)93.322s (+5.9% 🔺)94.605s (+5.8% 🔺)1.283s11.04x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.408s (-1.8%)2.005s (~)0.597s151.00x
💻 LocalExpress1.414s (+0.9%)2.005s (~)0.591s151.00x
🐘 PostgresExpress1.844s (-23.4% 🟢)2.154s (-28.5% 🟢)0.310s141.31x
🐘 PostgresNitro2.190s (+2.6%)2.740s (-9.1% 🟢)0.549s111.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)13.444s (+293.8% 🔺)14.894s (+245.6% 🔺)1.450s31.00x
▲ VercelExpress18.410s (+658.4% 🔺)19.692s (+483.7% 🔺)1.283s21.37x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.581s (+1.1%)3.008s (~)0.427s101.00x
💻 LocalNitro2.584s (-0.8%)3.007s (~)0.423s101.00x
🐘 PostgresNitro10.114s (+19.2% 🔺)10.365s (+14.6% 🔺)0.251s33.92x
🐘 PostgresExpress10.620s (+31.6% 🔺)11.031s (+33.3% 🔺)0.411s34.11x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)12.420s (+289.5% 🔺)13.773s (+251.8% 🔺)1.353s31.00x
▲ VercelExpress18.796s (+504.9% 🔺)19.999s (+372.8% 🔺)1.203s21.51x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro7.445s (+1.3%)8.018s (~)0.573s41.00x
💻 LocalExpress7.460s (+2.5%)8.019s (~)0.559s41.00x
🐘 PostgresExpress48.794s (+17.2% 🔺)49.157s (+16.7% 🔺)0.363s16.55x
🐘 PostgresNitro51.668s (+6.9% 🔺)52.124s (+6.1% 🔺)0.456s16.94x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)24.942s (+391.1% 🔺)26.311s (+331.3% 🔺)1.369s21.00x
▲ VercelExpress28.201s (+507.9% 🔺)30.049s (+434.6% 🔺)1.848s11.13x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.431s (+0.8%)2.005s (~)0.574s151.00x
💻 LocalNitro1.437s (+0.5%)2.005s (~)0.568s151.00x
🐘 PostgresNitro1.946s (-14.3% 🟢)2.513s (-6.4% 🟢)0.567s121.36x
🐘 PostgresExpress2.219s (+13.0% 🔺)2.921s (+16.2% 🔺)0.703s111.55x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.719s (+599.0% 🔺)17.064s (+430.6% 🔺)1.345s21.00x
▲ VercelExpress24.020s (+986.3% 🔺)25.084s (+666.6% 🔺)1.063s21.53x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.673s (~)3.007s (~)0.334s101.00x
💻 LocalExpress2.705s (+0.8%)3.008s (~)0.303s101.01x
🐘 PostgresNitro10.674s (-19.9% 🟢)11.364s (-17.1% 🟢)0.690s33.99x
🐘 PostgresExpress10.736s (-6.3% 🟢)11.032s (-8.3% 🟢)0.296s34.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.853s (+93.5% 🔺)6.186s (+79.8% 🔺)1.333s51.00x
▲ VercelExpress7.043s (+166.2% 🔺)8.185s (+130.1% 🔺)1.142s41.45x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.849s (-2.8%)8.018s (-3.0%)0.168s41.00x
💻 LocalNitro8.017s (+1.9%)8.518s (+3.0%)0.501s41.02x
🐘 PostgresExpress51.610s (~)52.108s (~)0.498s16.57x
🐘 PostgresNitro53.153s (+2.3%)54.110s (+3.8%)0.957s16.77x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.903s (+27.1% 🔺)6.376s (+37.1% 🔺)1.473s51.00x
▲ VercelNext.js (Turbopack)10.880s (+182.0% 🔺)12.026s (+139.0% 🔺)1.147s32.22x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.172s (-1.9%)1.002s (~)0.012s (+5.4% 🔺)1.017s (~)0.845s101.00x
💻 LocalExpress0.175s (+3.8%)1.003s (~)0.011s (-8.7% 🟢)1.016s (~)0.841s101.02x
🐘 PostgresNitro0.791s (-64.5% 🟢)1.008s (-64.2% 🟢)0.001s (-29.4% 🟢)1.211s (-59.8% 🟢)0.420s104.61x
🐘 PostgresExpress1.260s (-48.7% 🟢)1.780s (-31.1% 🟢)0.001s (+7.7% 🔺)2.013s (-33.2% 🟢)0.753s107.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.941s (+18.2% 🔺)3.045s (-0.7%)0.082s (-64.7% 🟢)4.249s (+10.2% 🔺)1.308s101.00x
▲ VercelExpress3.025s (+53.8% 🔺)3.570s (+35.5% 🔺)0.547s (-9.9% 🟢)4.815s (+26.8% 🔺)1.790s101.03x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro7/12
🐘 PostgresNitro9/12
▲ VercelNext.js (Turbopack)7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)▲ Vercel12/12
Nitro💻 Local12/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Replace verbose polling/scheduling examples in error-monitoring and
webhook-integrations recipes with shorter inline snippets that link
to the canonical Scheduling & Cron foundations guide for depth.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thorough review of the recipes docs. Overall this is a solid addition — well-structured, consistent patterns, good use of idempotency keys and error handling throughout. A few issues below, most notably the broken links that the bot also flagged.

}
```

`sleep()` is durable — if the workflow restarts during a sleep, it resumes when the original duration expires. For comprehensive scheduling patterns including cron-like dispatching, health checks, and graceful shutdown, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: /docs/foundations/scheduling does not exist. The foundations section has no scheduling.mdx. Either link to an existing page (e.g., the sleep() API reference or common-patterns) or remove this sentence.

The vercel bot also flagged this.

}
```

This uses the durable polling pattern — `sleep()` consumes no compute while waiting, and the workflow resumes at the correct time even after restarts. For more advanced scheduling patterns including consecutive failure tracking, graceful shutdown, and cron-like dispatching, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: Same issue — /docs/foundations/scheduling doesn't exist. This is referenced in both this file and webhook-integrations.mdx.

if (response.status === 429) {
// Rate limited - back off exponentially // [!code highlight]
throw new RetryableError("Rate limited", { // [!code highlight]
retryAfter: metadata.attempt ** 2 * 1000, // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect retryAfter value type: metadata.attempt ** 2 * 1000 passes a raw number (milliseconds). Per RetryableErrorOptions, a bare number is interpreted as milliseconds, so 1000 = 1s, 4000 = 4s, 9000 = 9s. That's likely fine, but the inline comment says "back off exponentially" which might mislead readers into thinking it's seconds. Consider either:

  • Using a duration string for clarity: retryAfter: \${metadata.attempt ** 2}s``
  • Or adding a comment clarifying the unit is milliseconds

The workflow sleeps for real calendar time between sends. If the process restarts during a sleep, the workflow resumes at the correct point. Use [`FatalError`](/docs/api-reference/workflow/fatal-error) to skip retries for permanent failures like a missing email address.

<Callout type="info">
Email sends are side effects. Use [`getStepMetadata()`](/docs/api-reference/workflow/get-step-metadata) to pass a stable `stepId` as an idempotency key to your email provider, as shown in `sendConfirmationEmail` above. This prevents duplicate emails on retry. See [Idempotency](/docs/foundations/idempotency) for more details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale reference: The callout says "as shown in sendConfirmationEmail above", but sendConfirmationEmail is in the Contact Form Processing section further down the page, not above this callout. This callout is in the Email Onboarding Sequence section where none of the step functions use getStepMetadata() or stepId.

Either:

  1. Add an idempotency key to one of the onboarding step functions above to match the callout, or
  2. Rephrase to something like: "Use getStepMetadata() to pass a stable stepId as an idempotency key to your email provider to prevent duplicate emails on retry. See the Contact Form example below or the Idempotency guide."

"use workflow"; // [!code highlight]

// Replace slashes to keep tokens URL-safe
const safeRepoName = repoName.replace("/", ":"); // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: repoName.replace("/", ":") only replaces the first occurrence. For org/repo this works, but if there's ever a nested path this would be a subtle bug. Consider replaceAll or noting this only handles owner/repo format.

Minor since this is illustrative, but worth being precise in docs.

Each `fetchPrice` call is an independent step. If the API rate-limits the third symbol, the first two are already recorded and won't re-execute. The third step retries with exponential backoff until it succeeds or exhausts its retry budget.

<Callout type="info">
The default retry limit is 3. Set `fetchPrice.maxRetries = 10` after the function declaration to allow more attempts for flaky APIs. See [Errors and Retries](/docs/foundations/errors-and-retries) for the full retry API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "The default retry limit is 3" — to be precise, maxRetries = 3 means 4 total attempts (1 initial + 3 retries), per the existing errors-and-retries docs. Might be worth saying "The default is 3 retries (4 total attempts)" for consistency with the foundations page.


if (contacts.length > 0) {
await upsertContacts(contacts);
cursor = new Date();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: cursor is updated to new Date() after upserting, but this captures the time after the upsert completes, not the time of the last fetched record. If there's clock drift or the upsert takes time, you could miss records updated during that window. In a real implementation you'd use the updatedAt from the last returned contact.

Since this is a recipe/illustration it's probably fine, but a brief comment noting this simplification might help readers avoid this pitfall in production.


// The hook may not be registered yet — retry until it is
let delivered = false;
for (let i = 0; i < 5 && !delivered; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This retry loop for resumeHook is a practical pattern but a bit ugly for docs. The comment on line 164 explains the race well, and the callout below suggests createWebhook() as an alternative. Just flagging that this pattern could confuse readers — they might copy it verbatim. Consider adding a note that this is a simplification and production code should handle the !delivered case (e.g., return an error response).

.map((b) => b.toString(16).padStart(2, "0"))
.join("");

if (signature !== expected) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HMAC signature comparison uses string equality (signature !== expected) which is potentially vulnerable to timing attacks. For a security-sensitive operation like webhook signature verification, this should use crypto.timingSafeEqual (or crypto.subtle.timingSafeEqual where available). Since this is docs that people will copy, it's worth getting right.

Suggested change
if (signature !== expected) {
if (!crypto.subtle.timingSafeEqual) {
// Node.js < 22 fallback
const {timingSafeEqual} = await import("node:crypto");
if (!timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
await request.respondWith(new Response("Unauthorized", {status: 401}));
throw new FatalError("Invalid GitHub webhook signature");
}
} else if (signature !== expected) {

Or more simply, just use crypto.timingSafeEqual from node:crypto since steps have full Node.js access:

import{timingSafeEqual}from"node:crypto";// ...if(!timingSafeEqual(Buffer.from(signature),Buffer.from(expected))){

@johnlindquist

Copy link
Copy Markdown
ContributorAuthor

Closing — superseded by the cookbook work in #1564.

The 5 recipes here (data-sync, webhook-integrations, data-ingestion, email-notifications, error-monitoring) are covered by the restructured cookbook's 4-category system (common patterns, agent patterns, integrations, advanced). The "Recipes" section name was retired in favor of "Cookbook" per team decision on March 31.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@johnlindquist@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: add Recipes section with 5 real-world workflow guides - #1116

Closed
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes
Closed

docs: add Recipes section with 5 real-world workflow guides#1116
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes

Conversation

@johnlindquist

Copy link
Copy Markdown
Contributor

Summary

Adds a new Recipes documentation section with production-ready patterns for common workflow use cases. Each recipe was motivated by usage data analysis across 10 workflow categories.

New docs

RecipeUsage Signal
Data Synchronization — polling, batch sync, webhook-driven sync, reconciliation, idempotent writes100 teams, 369K runs, zero existing docs
Webhook Integrations — Slack events, GitHub webhooks, forwarding, cron processing40 teams, 516K runs, only primitives documented
Data Ingestion & File Processing — file uploads, event ingestion, email processing, resilient extraction23 teams, 1.1M runs, minimal docs
Notifications & Email — onboarding sequences, verification flows, contact forms, fan-out58 teams, 288K runs, zero existing docs
Error Monitoring & Alerting — error triage, alert routing, real-time dispatch, system monitoring19 teams, 4.7M runs (39% of all runs), zero docs

Structure

  • docs/content/docs/recipes/index.mdx — section overview with Cards
  • docs/content/docs/recipes/meta.json — navigation config
  • 5 recipe MDX files with full code examples
  • Updated top-level meta.json to include Recipes after AI Agents

Test plan

  • Verify all MDX files render correctly
  • Verify code examples are syntactically valid TypeScript
  • Verify navigation works (Recipes appears in sidebar)
  • Verify internal doc links resolve

Adds a new Recipes documentation section with production-ready patterns
for common workflow use cases, driven by usage data analysis:
- Data Synchronization (100 teams, 369K runs)
- Webhook Integrations (40 teams, 516K runs)
- Data Ingestion & File Processing (23 teams, 1.1M runs)
- Notifications & Email (58 teams, 288K runs)
- Error Monitoring & Alerting (19 teams, 4.7M runs)
@vercel

vercelBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bccdfa3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production531338572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds111459165
✅ 📋 Other135021156
Total2494482752817

❌ Failed Tests

▲ Vercel Production (3 failed)

astro (1 failed):

  • health check (queue-based) - workflow and step endpoints respond to health check messages

nextjs-turbopack (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed

nitro (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed
🌍 Community Worlds (45 failed)

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro4714
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
❌ nextjs-turbopack5011
✅ nextjs-webpack5101
❌ nitro4714
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
✅ mongodb4903
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.032s (-2.5%)1.005s (~)0.973s101.00x
💻 LocalNitro0.032s (-4.7%)1.005s (~)0.973s101.02x
🐘 PostgresNitro0.106s (-77.6% 🟢)1.009s (~)0.903s103.37x
🐘 PostgresExpress0.479s (+363.2% 🔺)1.010s (~)0.531s1015.16x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.589s (-14.6% 🟢)2.129s (+2.5%)1.540s101.00x
▲ VercelNext.js (Turbopack)0.635s (-21.9% 🟢)2.027s (-2.0%)1.392s101.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.103s (~)2.005s (~)0.902s101.00x
💻 LocalExpress1.104s (~)2.005s (~)0.901s101.00x
🐘 PostgresNitro1.933s (-17.6% 🟢)2.212s (-26.7% 🟢)0.278s101.75x
🐘 PostgresExpress2.296s (-7.3% 🟢)2.914s (-3.3%)0.618s102.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.299s (+2.3%)3.251s (+4.7%)0.951s101.00x
▲ VercelExpress3.701s (+69.6% 🔺)4.893s (+55.2% 🔺)1.192s101.61x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.815s (~)11.022s (~)0.207s31.00x
💻 LocalExpress10.825s (~)11.021s (~)0.196s31.00x
🐘 PostgresNitro14.882s (-26.3% 🟢)15.543s (-26.2% 🟢)0.661s21.38x
🐘 PostgresExpress15.219s (-25.2% 🟢)16.044s (-23.8% 🟢)0.826s21.41x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.433s (-1.3%)18.984s (+1.1%)1.552s21.00x
▲ VercelNext.js (Turbopack)17.826s (-10.5% 🟢)19.523s (-6.5% 🟢)1.697s21.02x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro27.471s (~)28.048s (~)0.578s31.00x
💻 LocalExpress27.479s (~)28.051s (~)0.572s31.00x
🐘 PostgresNitro36.233s (-28.2% 🟢)37.096s (-27.5% 🟢)0.863s21.32x
🐘 PostgresExpress37.773s (-24.7% 🟢)38.087s (-24.8% 🟢)0.313s21.38x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express44.720s (+4.2%)46.234s (+4.9%)1.514s21.00x
▲ VercelNext.js (Turbopack)48.102s (+11.3% 🔺)48.968s (+9.3% 🔺)0.866s21.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express57.178s (~)58.102s (~)0.924s21.00x
💻 LocalNitro57.258s (~)58.098s (~)0.841s21.00x
🐘 PostgresNitro72.562s (-27.5% 🟢)73.173s (-27.0% 🟢)0.611s21.27x
🐘 PostgresExpress75.153s (-25.1% 🟢)75.662s (-25.3% 🟢)0.509s21.31x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express90.088s (+2.0%)91.342s (+2.5%)1.254s11.00x
▲ VercelNext.js (Turbopack)93.322s (+5.9% 🔺)94.605s (+5.8% 🔺)1.283s11.04x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.408s (-1.8%)2.005s (~)0.597s151.00x
💻 LocalExpress1.414s (+0.9%)2.005s (~)0.591s151.00x
🐘 PostgresExpress1.844s (-23.4% 🟢)2.154s (-28.5% 🟢)0.310s141.31x
🐘 PostgresNitro2.190s (+2.6%)2.740s (-9.1% 🟢)0.549s111.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)13.444s (+293.8% 🔺)14.894s (+245.6% 🔺)1.450s31.00x
▲ VercelExpress18.410s (+658.4% 🔺)19.692s (+483.7% 🔺)1.283s21.37x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.581s (+1.1%)3.008s (~)0.427s101.00x
💻 LocalNitro2.584s (-0.8%)3.007s (~)0.423s101.00x
🐘 PostgresNitro10.114s (+19.2% 🔺)10.365s (+14.6% 🔺)0.251s33.92x
🐘 PostgresExpress10.620s (+31.6% 🔺)11.031s (+33.3% 🔺)0.411s34.11x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)12.420s (+289.5% 🔺)13.773s (+251.8% 🔺)1.353s31.00x
▲ VercelExpress18.796s (+504.9% 🔺)19.999s (+372.8% 🔺)1.203s21.51x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro7.445s (+1.3%)8.018s (~)0.573s41.00x
💻 LocalExpress7.460s (+2.5%)8.019s (~)0.559s41.00x
🐘 PostgresExpress48.794s (+17.2% 🔺)49.157s (+16.7% 🔺)0.363s16.55x
🐘 PostgresNitro51.668s (+6.9% 🔺)52.124s (+6.1% 🔺)0.456s16.94x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)24.942s (+391.1% 🔺)26.311s (+331.3% 🔺)1.369s21.00x
▲ VercelExpress28.201s (+507.9% 🔺)30.049s (+434.6% 🔺)1.848s11.13x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.431s (+0.8%)2.005s (~)0.574s151.00x
💻 LocalNitro1.437s (+0.5%)2.005s (~)0.568s151.00x
🐘 PostgresNitro1.946s (-14.3% 🟢)2.513s (-6.4% 🟢)0.567s121.36x
🐘 PostgresExpress2.219s (+13.0% 🔺)2.921s (+16.2% 🔺)0.703s111.55x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.719s (+599.0% 🔺)17.064s (+430.6% 🔺)1.345s21.00x
▲ VercelExpress24.020s (+986.3% 🔺)25.084s (+666.6% 🔺)1.063s21.53x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.673s (~)3.007s (~)0.334s101.00x
💻 LocalExpress2.705s (+0.8%)3.008s (~)0.303s101.01x
🐘 PostgresNitro10.674s (-19.9% 🟢)11.364s (-17.1% 🟢)0.690s33.99x
🐘 PostgresExpress10.736s (-6.3% 🟢)11.032s (-8.3% 🟢)0.296s34.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.853s (+93.5% 🔺)6.186s (+79.8% 🔺)1.333s51.00x
▲ VercelExpress7.043s (+166.2% 🔺)8.185s (+130.1% 🔺)1.142s41.45x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.849s (-2.8%)8.018s (-3.0%)0.168s41.00x
💻 LocalNitro8.017s (+1.9%)8.518s (+3.0%)0.501s41.02x
🐘 PostgresExpress51.610s (~)52.108s (~)0.498s16.57x
🐘 PostgresNitro53.153s (+2.3%)54.110s (+3.8%)0.957s16.77x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.903s (+27.1% 🔺)6.376s (+37.1% 🔺)1.473s51.00x
▲ VercelNext.js (Turbopack)10.880s (+182.0% 🔺)12.026s (+139.0% 🔺)1.147s32.22x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.172s (-1.9%)1.002s (~)0.012s (+5.4% 🔺)1.017s (~)0.845s101.00x
💻 LocalExpress0.175s (+3.8%)1.003s (~)0.011s (-8.7% 🟢)1.016s (~)0.841s101.02x
🐘 PostgresNitro0.791s (-64.5% 🟢)1.008s (-64.2% 🟢)0.001s (-29.4% 🟢)1.211s (-59.8% 🟢)0.420s104.61x
🐘 PostgresExpress1.260s (-48.7% 🟢)1.780s (-31.1% 🟢)0.001s (+7.7% 🔺)2.013s (-33.2% 🟢)0.753s107.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.941s (+18.2% 🔺)3.045s (-0.7%)0.082s (-64.7% 🟢)4.249s (+10.2% 🔺)1.308s101.00x
▲ VercelExpress3.025s (+53.8% 🔺)3.570s (+35.5% 🔺)0.547s (-9.9% 🟢)4.815s (+26.8% 🔺)1.790s101.03x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro7/12
🐘 PostgresNitro9/12
▲ VercelNext.js (Turbopack)7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)▲ Vercel12/12
Nitro💻 Local12/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Replace verbose polling/scheduling examples in error-monitoring and
webhook-integrations recipes with shorter inline snippets that link
to the canonical Scheduling & Cron foundations guide for depth.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thorough review of the recipes docs. Overall this is a solid addition — well-structured, consistent patterns, good use of idempotency keys and error handling throughout. A few issues below, most notably the broken links that the bot also flagged.

}
```

`sleep()` is durable — if the workflow restarts during a sleep, it resumes when the original duration expires. For comprehensive scheduling patterns including cron-like dispatching, health checks, and graceful shutdown, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: /docs/foundations/scheduling does not exist. The foundations section has no scheduling.mdx. Either link to an existing page (e.g., the sleep() API reference or common-patterns) or remove this sentence.

The vercel bot also flagged this.

}
```

This uses the durable polling pattern — `sleep()` consumes no compute while waiting, and the workflow resumes at the correct time even after restarts. For more advanced scheduling patterns including consecutive failure tracking, graceful shutdown, and cron-like dispatching, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: Same issue — /docs/foundations/scheduling doesn't exist. This is referenced in both this file and webhook-integrations.mdx.

if (response.status === 429) {
// Rate limited - back off exponentially // [!code highlight]
throw new RetryableError("Rate limited", { // [!code highlight]
retryAfter: metadata.attempt ** 2 * 1000, // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect retryAfter value type: metadata.attempt ** 2 * 1000 passes a raw number (milliseconds). Per RetryableErrorOptions, a bare number is interpreted as milliseconds, so 1000 = 1s, 4000 = 4s, 9000 = 9s. That's likely fine, but the inline comment says "back off exponentially" which might mislead readers into thinking it's seconds. Consider either:

  • Using a duration string for clarity: retryAfter: \${metadata.attempt ** 2}s``
  • Or adding a comment clarifying the unit is milliseconds

The workflow sleeps for real calendar time between sends. If the process restarts during a sleep, the workflow resumes at the correct point. Use [`FatalError`](/docs/api-reference/workflow/fatal-error) to skip retries for permanent failures like a missing email address.

<Callout type="info">
Email sends are side effects. Use [`getStepMetadata()`](/docs/api-reference/workflow/get-step-metadata) to pass a stable `stepId` as an idempotency key to your email provider, as shown in `sendConfirmationEmail` above. This prevents duplicate emails on retry. See [Idempotency](/docs/foundations/idempotency) for more details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale reference: The callout says "as shown in sendConfirmationEmail above", but sendConfirmationEmail is in the Contact Form Processing section further down the page, not above this callout. This callout is in the Email Onboarding Sequence section where none of the step functions use getStepMetadata() or stepId.

Either:

  1. Add an idempotency key to one of the onboarding step functions above to match the callout, or
  2. Rephrase to something like: "Use getStepMetadata() to pass a stable stepId as an idempotency key to your email provider to prevent duplicate emails on retry. See the Contact Form example below or the Idempotency guide."

"use workflow"; // [!code highlight]

// Replace slashes to keep tokens URL-safe
const safeRepoName = repoName.replace("/", ":"); // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: repoName.replace("/", ":") only replaces the first occurrence. For org/repo this works, but if there's ever a nested path this would be a subtle bug. Consider replaceAll or noting this only handles owner/repo format.

Minor since this is illustrative, but worth being precise in docs.

Each `fetchPrice` call is an independent step. If the API rate-limits the third symbol, the first two are already recorded and won't re-execute. The third step retries with exponential backoff until it succeeds or exhausts its retry budget.

<Callout type="info">
The default retry limit is 3. Set `fetchPrice.maxRetries = 10` after the function declaration to allow more attempts for flaky APIs. See [Errors and Retries](/docs/foundations/errors-and-retries) for the full retry API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "The default retry limit is 3" — to be precise, maxRetries = 3 means 4 total attempts (1 initial + 3 retries), per the existing errors-and-retries docs. Might be worth saying "The default is 3 retries (4 total attempts)" for consistency with the foundations page.


if (contacts.length > 0) {
await upsertContacts(contacts);
cursor = new Date();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: cursor is updated to new Date() after upserting, but this captures the time after the upsert completes, not the time of the last fetched record. If there's clock drift or the upsert takes time, you could miss records updated during that window. In a real implementation you'd use the updatedAt from the last returned contact.

Since this is a recipe/illustration it's probably fine, but a brief comment noting this simplification might help readers avoid this pitfall in production.


// The hook may not be registered yet — retry until it is
let delivered = false;
for (let i = 0; i < 5 && !delivered; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This retry loop for resumeHook is a practical pattern but a bit ugly for docs. The comment on line 164 explains the race well, and the callout below suggests createWebhook() as an alternative. Just flagging that this pattern could confuse readers — they might copy it verbatim. Consider adding a note that this is a simplification and production code should handle the !delivered case (e.g., return an error response).

.map((b) => b.toString(16).padStart(2, "0"))
.join("");

if (signature !== expected) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HMAC signature comparison uses string equality (signature !== expected) which is potentially vulnerable to timing attacks. For a security-sensitive operation like webhook signature verification, this should use crypto.timingSafeEqual (or crypto.subtle.timingSafeEqual where available). Since this is docs that people will copy, it's worth getting right.

Suggested change
if (signature !== expected) {
if (!crypto.subtle.timingSafeEqual) {
// Node.js < 22 fallback
const {timingSafeEqual} = await import("node:crypto");
if (!timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
await request.respondWith(new Response("Unauthorized", {status: 401}));
throw new FatalError("Invalid GitHub webhook signature");
}
} else if (signature !== expected) {

Or more simply, just use crypto.timingSafeEqual from node:crypto since steps have full Node.js access:

import{timingSafeEqual}from"node:crypto";// ...if(!timingSafeEqual(Buffer.from(signature),Buffer.from(expected))){

@johnlindquist

Copy link
Copy Markdown
ContributorAuthor

Closing — superseded by the cookbook work in #1564.

The 5 recipes here (data-sync, webhook-integrations, data-ingestion, email-notifications, error-monitoring) are covered by the restructured cookbook's 4-category system (common patterns, agent patterns, integrations, advanced). The "Recipes" section name was retired in favor of "Cookbook" per team decision on March 31.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@johnlindquist@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

docs: add Recipes section with 5 real-world workflow guides - #1116

Closed
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes
Closed

docs: add Recipes section with 5 real-world workflow guides#1116
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes

Conversation

@johnlindquist

Copy link
Copy Markdown
Contributor

Summary

Adds a new Recipes documentation section with production-ready patterns for common workflow use cases. Each recipe was motivated by usage data analysis across 10 workflow categories.

New docs

RecipeUsage Signal
Data Synchronization — polling, batch sync, webhook-driven sync, reconciliation, idempotent writes100 teams, 369K runs, zero existing docs
Webhook Integrations — Slack events, GitHub webhooks, forwarding, cron processing40 teams, 516K runs, only primitives documented
Data Ingestion & File Processing — file uploads, event ingestion, email processing, resilient extraction23 teams, 1.1M runs, minimal docs
Notifications & Email — onboarding sequences, verification flows, contact forms, fan-out58 teams, 288K runs, zero existing docs
Error Monitoring & Alerting — error triage, alert routing, real-time dispatch, system monitoring19 teams, 4.7M runs (39% of all runs), zero docs

Structure

  • docs/content/docs/recipes/index.mdx — section overview with Cards
  • docs/content/docs/recipes/meta.json — navigation config
  • 5 recipe MDX files with full code examples
  • Updated top-level meta.json to include Recipes after AI Agents

Test plan

  • Verify all MDX files render correctly
  • Verify code examples are syntactically valid TypeScript
  • Verify navigation works (Recipes appears in sidebar)
  • Verify internal doc links resolve

Adds a new Recipes documentation section with production-ready patterns
for common workflow use cases, driven by usage data analysis:
- Data Synchronization (100 teams, 369K runs)
- Webhook Integrations (40 teams, 516K runs)
- Data Ingestion & File Processing (23 teams, 1.1M runs)
- Notifications & Email (58 teams, 288K runs)
- Error Monitoring & Alerting (19 teams, 4.7M runs)
@vercel

vercelBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bccdfa3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production531338572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds111459165
✅ 📋 Other135021156
Total2494482752817

❌ Failed Tests

▲ Vercel Production (3 failed)

astro (1 failed):

  • health check (queue-based) - workflow and step endpoints respond to health check messages

nextjs-turbopack (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed

nitro (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed
🌍 Community Worlds (45 failed)

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro4714
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
❌ nextjs-turbopack5011
✅ nextjs-webpack5101
❌ nitro4714
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
✅ mongodb4903
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.032s (-2.5%)1.005s (~)0.973s101.00x
💻 LocalNitro0.032s (-4.7%)1.005s (~)0.973s101.02x
🐘 PostgresNitro0.106s (-77.6% 🟢)1.009s (~)0.903s103.37x
🐘 PostgresExpress0.479s (+363.2% 🔺)1.010s (~)0.531s1015.16x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.589s (-14.6% 🟢)2.129s (+2.5%)1.540s101.00x
▲ VercelNext.js (Turbopack)0.635s (-21.9% 🟢)2.027s (-2.0%)1.392s101.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.103s (~)2.005s (~)0.902s101.00x
💻 LocalExpress1.104s (~)2.005s (~)0.901s101.00x
🐘 PostgresNitro1.933s (-17.6% 🟢)2.212s (-26.7% 🟢)0.278s101.75x
🐘 PostgresExpress2.296s (-7.3% 🟢)2.914s (-3.3%)0.618s102.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.299s (+2.3%)3.251s (+4.7%)0.951s101.00x
▲ VercelExpress3.701s (+69.6% 🔺)4.893s (+55.2% 🔺)1.192s101.61x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.815s (~)11.022s (~)0.207s31.00x
💻 LocalExpress10.825s (~)11.021s (~)0.196s31.00x
🐘 PostgresNitro14.882s (-26.3% 🟢)15.543s (-26.2% 🟢)0.661s21.38x
🐘 PostgresExpress15.219s (-25.2% 🟢)16.044s (-23.8% 🟢)0.826s21.41x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.433s (-1.3%)18.984s (+1.1%)1.552s21.00x
▲ VercelNext.js (Turbopack)17.826s (-10.5% 🟢)19.523s (-6.5% 🟢)1.697s21.02x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro27.471s (~)28.048s (~)0.578s31.00x
💻 LocalExpress27.479s (~)28.051s (~)0.572s31.00x
🐘 PostgresNitro36.233s (-28.2% 🟢)37.096s (-27.5% 🟢)0.863s21.32x
🐘 PostgresExpress37.773s (-24.7% 🟢)38.087s (-24.8% 🟢)0.313s21.38x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express44.720s (+4.2%)46.234s (+4.9%)1.514s21.00x
▲ VercelNext.js (Turbopack)48.102s (+11.3% 🔺)48.968s (+9.3% 🔺)0.866s21.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express57.178s (~)58.102s (~)0.924s21.00x
💻 LocalNitro57.258s (~)58.098s (~)0.841s21.00x
🐘 PostgresNitro72.562s (-27.5% 🟢)73.173s (-27.0% 🟢)0.611s21.27x
🐘 PostgresExpress75.153s (-25.1% 🟢)75.662s (-25.3% 🟢)0.509s21.31x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express90.088s (+2.0%)91.342s (+2.5%)1.254s11.00x
▲ VercelNext.js (Turbopack)93.322s (+5.9% 🔺)94.605s (+5.8% 🔺)1.283s11.04x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.408s (-1.8%)2.005s (~)0.597s151.00x
💻 LocalExpress1.414s (+0.9%)2.005s (~)0.591s151.00x
🐘 PostgresExpress1.844s (-23.4% 🟢)2.154s (-28.5% 🟢)0.310s141.31x
🐘 PostgresNitro2.190s (+2.6%)2.740s (-9.1% 🟢)0.549s111.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)13.444s (+293.8% 🔺)14.894s (+245.6% 🔺)1.450s31.00x
▲ VercelExpress18.410s (+658.4% 🔺)19.692s (+483.7% 🔺)1.283s21.37x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.581s (+1.1%)3.008s (~)0.427s101.00x
💻 LocalNitro2.584s (-0.8%)3.007s (~)0.423s101.00x
🐘 PostgresNitro10.114s (+19.2% 🔺)10.365s (+14.6% 🔺)0.251s33.92x
🐘 PostgresExpress10.620s (+31.6% 🔺)11.031s (+33.3% 🔺)0.411s34.11x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)12.420s (+289.5% 🔺)13.773s (+251.8% 🔺)1.353s31.00x
▲ VercelExpress18.796s (+504.9% 🔺)19.999s (+372.8% 🔺)1.203s21.51x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro7.445s (+1.3%)8.018s (~)0.573s41.00x
💻 LocalExpress7.460s (+2.5%)8.019s (~)0.559s41.00x
🐘 PostgresExpress48.794s (+17.2% 🔺)49.157s (+16.7% 🔺)0.363s16.55x
🐘 PostgresNitro51.668s (+6.9% 🔺)52.124s (+6.1% 🔺)0.456s16.94x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)24.942s (+391.1% 🔺)26.311s (+331.3% 🔺)1.369s21.00x
▲ VercelExpress28.201s (+507.9% 🔺)30.049s (+434.6% 🔺)1.848s11.13x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.431s (+0.8%)2.005s (~)0.574s151.00x
💻 LocalNitro1.437s (+0.5%)2.005s (~)0.568s151.00x
🐘 PostgresNitro1.946s (-14.3% 🟢)2.513s (-6.4% 🟢)0.567s121.36x
🐘 PostgresExpress2.219s (+13.0% 🔺)2.921s (+16.2% 🔺)0.703s111.55x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.719s (+599.0% 🔺)17.064s (+430.6% 🔺)1.345s21.00x
▲ VercelExpress24.020s (+986.3% 🔺)25.084s (+666.6% 🔺)1.063s21.53x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.673s (~)3.007s (~)0.334s101.00x
💻 LocalExpress2.705s (+0.8%)3.008s (~)0.303s101.01x
🐘 PostgresNitro10.674s (-19.9% 🟢)11.364s (-17.1% 🟢)0.690s33.99x
🐘 PostgresExpress10.736s (-6.3% 🟢)11.032s (-8.3% 🟢)0.296s34.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.853s (+93.5% 🔺)6.186s (+79.8% 🔺)1.333s51.00x
▲ VercelExpress7.043s (+166.2% 🔺)8.185s (+130.1% 🔺)1.142s41.45x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.849s (-2.8%)8.018s (-3.0%)0.168s41.00x
💻 LocalNitro8.017s (+1.9%)8.518s (+3.0%)0.501s41.02x
🐘 PostgresExpress51.610s (~)52.108s (~)0.498s16.57x
🐘 PostgresNitro53.153s (+2.3%)54.110s (+3.8%)0.957s16.77x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.903s (+27.1% 🔺)6.376s (+37.1% 🔺)1.473s51.00x
▲ VercelNext.js (Turbopack)10.880s (+182.0% 🔺)12.026s (+139.0% 🔺)1.147s32.22x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.172s (-1.9%)1.002s (~)0.012s (+5.4% 🔺)1.017s (~)0.845s101.00x
💻 LocalExpress0.175s (+3.8%)1.003s (~)0.011s (-8.7% 🟢)1.016s (~)0.841s101.02x
🐘 PostgresNitro0.791s (-64.5% 🟢)1.008s (-64.2% 🟢)0.001s (-29.4% 🟢)1.211s (-59.8% 🟢)0.420s104.61x
🐘 PostgresExpress1.260s (-48.7% 🟢)1.780s (-31.1% 🟢)0.001s (+7.7% 🔺)2.013s (-33.2% 🟢)0.753s107.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.941s (+18.2% 🔺)3.045s (-0.7%)0.082s (-64.7% 🟢)4.249s (+10.2% 🔺)1.308s101.00x
▲ VercelExpress3.025s (+53.8% 🔺)3.570s (+35.5% 🔺)0.547s (-9.9% 🟢)4.815s (+26.8% 🔺)1.790s101.03x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro7/12
🐘 PostgresNitro9/12
▲ VercelNext.js (Turbopack)7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)▲ Vercel12/12
Nitro💻 Local12/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Replace verbose polling/scheduling examples in error-monitoring and
webhook-integrations recipes with shorter inline snippets that link
to the canonical Scheduling & Cron foundations guide for depth.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thorough review of the recipes docs. Overall this is a solid addition — well-structured, consistent patterns, good use of idempotency keys and error handling throughout. A few issues below, most notably the broken links that the bot also flagged.

}
```

`sleep()` is durable — if the workflow restarts during a sleep, it resumes when the original duration expires. For comprehensive scheduling patterns including cron-like dispatching, health checks, and graceful shutdown, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: /docs/foundations/scheduling does not exist. The foundations section has no scheduling.mdx. Either link to an existing page (e.g., the sleep() API reference or common-patterns) or remove this sentence.

The vercel bot also flagged this.

}
```

This uses the durable polling pattern — `sleep()` consumes no compute while waiting, and the workflow resumes at the correct time even after restarts. For more advanced scheduling patterns including consecutive failure tracking, graceful shutdown, and cron-like dispatching, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: Same issue — /docs/foundations/scheduling doesn't exist. This is referenced in both this file and webhook-integrations.mdx.

if (response.status === 429) {
// Rate limited - back off exponentially // [!code highlight]
throw new RetryableError("Rate limited", { // [!code highlight]
retryAfter: metadata.attempt ** 2 * 1000, // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect retryAfter value type: metadata.attempt ** 2 * 1000 passes a raw number (milliseconds). Per RetryableErrorOptions, a bare number is interpreted as milliseconds, so 1000 = 1s, 4000 = 4s, 9000 = 9s. That's likely fine, but the inline comment says "back off exponentially" which might mislead readers into thinking it's seconds. Consider either:

  • Using a duration string for clarity: retryAfter: \${metadata.attempt ** 2}s``
  • Or adding a comment clarifying the unit is milliseconds

The workflow sleeps for real calendar time between sends. If the process restarts during a sleep, the workflow resumes at the correct point. Use [`FatalError`](/docs/api-reference/workflow/fatal-error) to skip retries for permanent failures like a missing email address.

<Callout type="info">
Email sends are side effects. Use [`getStepMetadata()`](/docs/api-reference/workflow/get-step-metadata) to pass a stable `stepId` as an idempotency key to your email provider, as shown in `sendConfirmationEmail` above. This prevents duplicate emails on retry. See [Idempotency](/docs/foundations/idempotency) for more details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale reference: The callout says "as shown in sendConfirmationEmail above", but sendConfirmationEmail is in the Contact Form Processing section further down the page, not above this callout. This callout is in the Email Onboarding Sequence section where none of the step functions use getStepMetadata() or stepId.

Either:

  1. Add an idempotency key to one of the onboarding step functions above to match the callout, or
  2. Rephrase to something like: "Use getStepMetadata() to pass a stable stepId as an idempotency key to your email provider to prevent duplicate emails on retry. See the Contact Form example below or the Idempotency guide."

"use workflow"; // [!code highlight]

// Replace slashes to keep tokens URL-safe
const safeRepoName = repoName.replace("/", ":"); // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: repoName.replace("/", ":") only replaces the first occurrence. For org/repo this works, but if there's ever a nested path this would be a subtle bug. Consider replaceAll or noting this only handles owner/repo format.

Minor since this is illustrative, but worth being precise in docs.

Each `fetchPrice` call is an independent step. If the API rate-limits the third symbol, the first two are already recorded and won't re-execute. The third step retries with exponential backoff until it succeeds or exhausts its retry budget.

<Callout type="info">
The default retry limit is 3. Set `fetchPrice.maxRetries = 10` after the function declaration to allow more attempts for flaky APIs. See [Errors and Retries](/docs/foundations/errors-and-retries) for the full retry API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "The default retry limit is 3" — to be precise, maxRetries = 3 means 4 total attempts (1 initial + 3 retries), per the existing errors-and-retries docs. Might be worth saying "The default is 3 retries (4 total attempts)" for consistency with the foundations page.


if (contacts.length > 0) {
await upsertContacts(contacts);
cursor = new Date();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: cursor is updated to new Date() after upserting, but this captures the time after the upsert completes, not the time of the last fetched record. If there's clock drift or the upsert takes time, you could miss records updated during that window. In a real implementation you'd use the updatedAt from the last returned contact.

Since this is a recipe/illustration it's probably fine, but a brief comment noting this simplification might help readers avoid this pitfall in production.


// The hook may not be registered yet — retry until it is
let delivered = false;
for (let i = 0; i < 5 && !delivered; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This retry loop for resumeHook is a practical pattern but a bit ugly for docs. The comment on line 164 explains the race well, and the callout below suggests createWebhook() as an alternative. Just flagging that this pattern could confuse readers — they might copy it verbatim. Consider adding a note that this is a simplification and production code should handle the !delivered case (e.g., return an error response).

.map((b) => b.toString(16).padStart(2, "0"))
.join("");

if (signature !== expected) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HMAC signature comparison uses string equality (signature !== expected) which is potentially vulnerable to timing attacks. For a security-sensitive operation like webhook signature verification, this should use crypto.timingSafeEqual (or crypto.subtle.timingSafeEqual where available). Since this is docs that people will copy, it's worth getting right.

Suggested change
if (signature !== expected) {
if (!crypto.subtle.timingSafeEqual) {
// Node.js < 22 fallback
const {timingSafeEqual} = await import("node:crypto");
if (!timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
await request.respondWith(new Response("Unauthorized", {status: 401}));
throw new FatalError("Invalid GitHub webhook signature");
}
} else if (signature !== expected) {

Or more simply, just use crypto.timingSafeEqual from node:crypto since steps have full Node.js access:

import{timingSafeEqual}from"node:crypto";// ...if(!timingSafeEqual(Buffer.from(signature),Buffer.from(expected))){

@johnlindquist

Copy link
Copy Markdown
ContributorAuthor

Closing — superseded by the cookbook work in #1564.

The 5 recipes here (data-sync, webhook-integrations, data-ingestion, email-notifications, error-monitoring) are covered by the restructured cookbook's 4-category system (common patterns, agent patterns, integrations, advanced). The "Recipes" section name was retired in favor of "Cookbook" per team decision on March 31.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@johnlindquist@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: add Recipes section with 5 real-world workflow guides - #1116

Closed
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes
Closed

docs: add Recipes section with 5 real-world workflow guides#1116
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes

Conversation

@johnlindquist

Copy link
Copy Markdown
Contributor

Summary

Adds a new Recipes documentation section with production-ready patterns for common workflow use cases. Each recipe was motivated by usage data analysis across 10 workflow categories.

New docs

RecipeUsage Signal
Data Synchronization — polling, batch sync, webhook-driven sync, reconciliation, idempotent writes100 teams, 369K runs, zero existing docs
Webhook Integrations — Slack events, GitHub webhooks, forwarding, cron processing40 teams, 516K runs, only primitives documented
Data Ingestion & File Processing — file uploads, event ingestion, email processing, resilient extraction23 teams, 1.1M runs, minimal docs
Notifications & Email — onboarding sequences, verification flows, contact forms, fan-out58 teams, 288K runs, zero existing docs
Error Monitoring & Alerting — error triage, alert routing, real-time dispatch, system monitoring19 teams, 4.7M runs (39% of all runs), zero docs

Structure

  • docs/content/docs/recipes/index.mdx — section overview with Cards
  • docs/content/docs/recipes/meta.json — navigation config
  • 5 recipe MDX files with full code examples
  • Updated top-level meta.json to include Recipes after AI Agents

Test plan

  • Verify all MDX files render correctly
  • Verify code examples are syntactically valid TypeScript
  • Verify navigation works (Recipes appears in sidebar)
  • Verify internal doc links resolve

Adds a new Recipes documentation section with production-ready patterns
for common workflow use cases, driven by usage data analysis:
- Data Synchronization (100 teams, 369K runs)
- Webhook Integrations (40 teams, 516K runs)
- Data Ingestion & File Processing (23 teams, 1.1M runs)
- Notifications & Email (58 teams, 288K runs)
- Error Monitoring & Alerting (19 teams, 4.7M runs)
@vercel

vercelBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bccdfa3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production531338572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds111459165
✅ 📋 Other135021156
Total2494482752817

❌ Failed Tests

▲ Vercel Production (3 failed)

astro (1 failed):

  • health check (queue-based) - workflow and step endpoints respond to health check messages

nextjs-turbopack (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed

nitro (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed
🌍 Community Worlds (45 failed)

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro4714
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
❌ nextjs-turbopack5011
✅ nextjs-webpack5101
❌ nitro4714
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
✅ mongodb4903
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.032s (-2.5%)1.005s (~)0.973s101.00x
💻 LocalNitro0.032s (-4.7%)1.005s (~)0.973s101.02x
🐘 PostgresNitro0.106s (-77.6% 🟢)1.009s (~)0.903s103.37x
🐘 PostgresExpress0.479s (+363.2% 🔺)1.010s (~)0.531s1015.16x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.589s (-14.6% 🟢)2.129s (+2.5%)1.540s101.00x
▲ VercelNext.js (Turbopack)0.635s (-21.9% 🟢)2.027s (-2.0%)1.392s101.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.103s (~)2.005s (~)0.902s101.00x
💻 LocalExpress1.104s (~)2.005s (~)0.901s101.00x
🐘 PostgresNitro1.933s (-17.6% 🟢)2.212s (-26.7% 🟢)0.278s101.75x
🐘 PostgresExpress2.296s (-7.3% 🟢)2.914s (-3.3%)0.618s102.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.299s (+2.3%)3.251s (+4.7%)0.951s101.00x
▲ VercelExpress3.701s (+69.6% 🔺)4.893s (+55.2% 🔺)1.192s101.61x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.815s (~)11.022s (~)0.207s31.00x
💻 LocalExpress10.825s (~)11.021s (~)0.196s31.00x
🐘 PostgresNitro14.882s (-26.3% 🟢)15.543s (-26.2% 🟢)0.661s21.38x
🐘 PostgresExpress15.219s (-25.2% 🟢)16.044s (-23.8% 🟢)0.826s21.41x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.433s (-1.3%)18.984s (+1.1%)1.552s21.00x
▲ VercelNext.js (Turbopack)17.826s (-10.5% 🟢)19.523s (-6.5% 🟢)1.697s21.02x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro27.471s (~)28.048s (~)0.578s31.00x
💻 LocalExpress27.479s (~)28.051s (~)0.572s31.00x
🐘 PostgresNitro36.233s (-28.2% 🟢)37.096s (-27.5% 🟢)0.863s21.32x
🐘 PostgresExpress37.773s (-24.7% 🟢)38.087s (-24.8% 🟢)0.313s21.38x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express44.720s (+4.2%)46.234s (+4.9%)1.514s21.00x
▲ VercelNext.js (Turbopack)48.102s (+11.3% 🔺)48.968s (+9.3% 🔺)0.866s21.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express57.178s (~)58.102s (~)0.924s21.00x
💻 LocalNitro57.258s (~)58.098s (~)0.841s21.00x
🐘 PostgresNitro72.562s (-27.5% 🟢)73.173s (-27.0% 🟢)0.611s21.27x
🐘 PostgresExpress75.153s (-25.1% 🟢)75.662s (-25.3% 🟢)0.509s21.31x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express90.088s (+2.0%)91.342s (+2.5%)1.254s11.00x
▲ VercelNext.js (Turbopack)93.322s (+5.9% 🔺)94.605s (+5.8% 🔺)1.283s11.04x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.408s (-1.8%)2.005s (~)0.597s151.00x
💻 LocalExpress1.414s (+0.9%)2.005s (~)0.591s151.00x
🐘 PostgresExpress1.844s (-23.4% 🟢)2.154s (-28.5% 🟢)0.310s141.31x
🐘 PostgresNitro2.190s (+2.6%)2.740s (-9.1% 🟢)0.549s111.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)13.444s (+293.8% 🔺)14.894s (+245.6% 🔺)1.450s31.00x
▲ VercelExpress18.410s (+658.4% 🔺)19.692s (+483.7% 🔺)1.283s21.37x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.581s (+1.1%)3.008s (~)0.427s101.00x
💻 LocalNitro2.584s (-0.8%)3.007s (~)0.423s101.00x
🐘 PostgresNitro10.114s (+19.2% 🔺)10.365s (+14.6% 🔺)0.251s33.92x
🐘 PostgresExpress10.620s (+31.6% 🔺)11.031s (+33.3% 🔺)0.411s34.11x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)12.420s (+289.5% 🔺)13.773s (+251.8% 🔺)1.353s31.00x
▲ VercelExpress18.796s (+504.9% 🔺)19.999s (+372.8% 🔺)1.203s21.51x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro7.445s (+1.3%)8.018s (~)0.573s41.00x
💻 LocalExpress7.460s (+2.5%)8.019s (~)0.559s41.00x
🐘 PostgresExpress48.794s (+17.2% 🔺)49.157s (+16.7% 🔺)0.363s16.55x
🐘 PostgresNitro51.668s (+6.9% 🔺)52.124s (+6.1% 🔺)0.456s16.94x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)24.942s (+391.1% 🔺)26.311s (+331.3% 🔺)1.369s21.00x
▲ VercelExpress28.201s (+507.9% 🔺)30.049s (+434.6% 🔺)1.848s11.13x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.431s (+0.8%)2.005s (~)0.574s151.00x
💻 LocalNitro1.437s (+0.5%)2.005s (~)0.568s151.00x
🐘 PostgresNitro1.946s (-14.3% 🟢)2.513s (-6.4% 🟢)0.567s121.36x
🐘 PostgresExpress2.219s (+13.0% 🔺)2.921s (+16.2% 🔺)0.703s111.55x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.719s (+599.0% 🔺)17.064s (+430.6% 🔺)1.345s21.00x
▲ VercelExpress24.020s (+986.3% 🔺)25.084s (+666.6% 🔺)1.063s21.53x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.673s (~)3.007s (~)0.334s101.00x
💻 LocalExpress2.705s (+0.8%)3.008s (~)0.303s101.01x
🐘 PostgresNitro10.674s (-19.9% 🟢)11.364s (-17.1% 🟢)0.690s33.99x
🐘 PostgresExpress10.736s (-6.3% 🟢)11.032s (-8.3% 🟢)0.296s34.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.853s (+93.5% 🔺)6.186s (+79.8% 🔺)1.333s51.00x
▲ VercelExpress7.043s (+166.2% 🔺)8.185s (+130.1% 🔺)1.142s41.45x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.849s (-2.8%)8.018s (-3.0%)0.168s41.00x
💻 LocalNitro8.017s (+1.9%)8.518s (+3.0%)0.501s41.02x
🐘 PostgresExpress51.610s (~)52.108s (~)0.498s16.57x
🐘 PostgresNitro53.153s (+2.3%)54.110s (+3.8%)0.957s16.77x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.903s (+27.1% 🔺)6.376s (+37.1% 🔺)1.473s51.00x
▲ VercelNext.js (Turbopack)10.880s (+182.0% 🔺)12.026s (+139.0% 🔺)1.147s32.22x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.172s (-1.9%)1.002s (~)0.012s (+5.4% 🔺)1.017s (~)0.845s101.00x
💻 LocalExpress0.175s (+3.8%)1.003s (~)0.011s (-8.7% 🟢)1.016s (~)0.841s101.02x
🐘 PostgresNitro0.791s (-64.5% 🟢)1.008s (-64.2% 🟢)0.001s (-29.4% 🟢)1.211s (-59.8% 🟢)0.420s104.61x
🐘 PostgresExpress1.260s (-48.7% 🟢)1.780s (-31.1% 🟢)0.001s (+7.7% 🔺)2.013s (-33.2% 🟢)0.753s107.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.941s (+18.2% 🔺)3.045s (-0.7%)0.082s (-64.7% 🟢)4.249s (+10.2% 🔺)1.308s101.00x
▲ VercelExpress3.025s (+53.8% 🔺)3.570s (+35.5% 🔺)0.547s (-9.9% 🟢)4.815s (+26.8% 🔺)1.790s101.03x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro7/12
🐘 PostgresNitro9/12
▲ VercelNext.js (Turbopack)7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)▲ Vercel12/12
Nitro💻 Local12/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Replace verbose polling/scheduling examples in error-monitoring and
webhook-integrations recipes with shorter inline snippets that link
to the canonical Scheduling & Cron foundations guide for depth.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thorough review of the recipes docs. Overall this is a solid addition — well-structured, consistent patterns, good use of idempotency keys and error handling throughout. A few issues below, most notably the broken links that the bot also flagged.

}
```

`sleep()` is durable — if the workflow restarts during a sleep, it resumes when the original duration expires. For comprehensive scheduling patterns including cron-like dispatching, health checks, and graceful shutdown, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: /docs/foundations/scheduling does not exist. The foundations section has no scheduling.mdx. Either link to an existing page (e.g., the sleep() API reference or common-patterns) or remove this sentence.

The vercel bot also flagged this.

}
```

This uses the durable polling pattern — `sleep()` consumes no compute while waiting, and the workflow resumes at the correct time even after restarts. For more advanced scheduling patterns including consecutive failure tracking, graceful shutdown, and cron-like dispatching, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: Same issue — /docs/foundations/scheduling doesn't exist. This is referenced in both this file and webhook-integrations.mdx.

if (response.status === 429) {
// Rate limited - back off exponentially // [!code highlight]
throw new RetryableError("Rate limited", { // [!code highlight]
retryAfter: metadata.attempt ** 2 * 1000, // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect retryAfter value type: metadata.attempt ** 2 * 1000 passes a raw number (milliseconds). Per RetryableErrorOptions, a bare number is interpreted as milliseconds, so 1000 = 1s, 4000 = 4s, 9000 = 9s. That's likely fine, but the inline comment says "back off exponentially" which might mislead readers into thinking it's seconds. Consider either:

  • Using a duration string for clarity: retryAfter: \${metadata.attempt ** 2}s``
  • Or adding a comment clarifying the unit is milliseconds

The workflow sleeps for real calendar time between sends. If the process restarts during a sleep, the workflow resumes at the correct point. Use [`FatalError`](/docs/api-reference/workflow/fatal-error) to skip retries for permanent failures like a missing email address.

<Callout type="info">
Email sends are side effects. Use [`getStepMetadata()`](/docs/api-reference/workflow/get-step-metadata) to pass a stable `stepId` as an idempotency key to your email provider, as shown in `sendConfirmationEmail` above. This prevents duplicate emails on retry. See [Idempotency](/docs/foundations/idempotency) for more details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale reference: The callout says "as shown in sendConfirmationEmail above", but sendConfirmationEmail is in the Contact Form Processing section further down the page, not above this callout. This callout is in the Email Onboarding Sequence section where none of the step functions use getStepMetadata() or stepId.

Either:

  1. Add an idempotency key to one of the onboarding step functions above to match the callout, or
  2. Rephrase to something like: "Use getStepMetadata() to pass a stable stepId as an idempotency key to your email provider to prevent duplicate emails on retry. See the Contact Form example below or the Idempotency guide."

"use workflow"; // [!code highlight]

// Replace slashes to keep tokens URL-safe
const safeRepoName = repoName.replace("/", ":"); // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: repoName.replace("/", ":") only replaces the first occurrence. For org/repo this works, but if there's ever a nested path this would be a subtle bug. Consider replaceAll or noting this only handles owner/repo format.

Minor since this is illustrative, but worth being precise in docs.

Each `fetchPrice` call is an independent step. If the API rate-limits the third symbol, the first two are already recorded and won't re-execute. The third step retries with exponential backoff until it succeeds or exhausts its retry budget.

<Callout type="info">
The default retry limit is 3. Set `fetchPrice.maxRetries = 10` after the function declaration to allow more attempts for flaky APIs. See [Errors and Retries](/docs/foundations/errors-and-retries) for the full retry API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "The default retry limit is 3" — to be precise, maxRetries = 3 means 4 total attempts (1 initial + 3 retries), per the existing errors-and-retries docs. Might be worth saying "The default is 3 retries (4 total attempts)" for consistency with the foundations page.


if (contacts.length > 0) {
await upsertContacts(contacts);
cursor = new Date();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: cursor is updated to new Date() after upserting, but this captures the time after the upsert completes, not the time of the last fetched record. If there's clock drift or the upsert takes time, you could miss records updated during that window. In a real implementation you'd use the updatedAt from the last returned contact.

Since this is a recipe/illustration it's probably fine, but a brief comment noting this simplification might help readers avoid this pitfall in production.


// The hook may not be registered yet — retry until it is
let delivered = false;
for (let i = 0; i < 5 && !delivered; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This retry loop for resumeHook is a practical pattern but a bit ugly for docs. The comment on line 164 explains the race well, and the callout below suggests createWebhook() as an alternative. Just flagging that this pattern could confuse readers — they might copy it verbatim. Consider adding a note that this is a simplification and production code should handle the !delivered case (e.g., return an error response).

.map((b) => b.toString(16).padStart(2, "0"))
.join("");

if (signature !== expected) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HMAC signature comparison uses string equality (signature !== expected) which is potentially vulnerable to timing attacks. For a security-sensitive operation like webhook signature verification, this should use crypto.timingSafeEqual (or crypto.subtle.timingSafeEqual where available). Since this is docs that people will copy, it's worth getting right.

Suggested change
if (signature !== expected) {
if (!crypto.subtle.timingSafeEqual) {
// Node.js < 22 fallback
const {timingSafeEqual} = await import("node:crypto");
if (!timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
await request.respondWith(new Response("Unauthorized", {status: 401}));
throw new FatalError("Invalid GitHub webhook signature");
}
} else if (signature !== expected) {

Or more simply, just use crypto.timingSafeEqual from node:crypto since steps have full Node.js access:

import{timingSafeEqual}from"node:crypto";// ...if(!timingSafeEqual(Buffer.from(signature),Buffer.from(expected))){

@johnlindquist

Copy link
Copy Markdown
ContributorAuthor

Closing — superseded by the cookbook work in #1564.

The 5 recipes here (data-sync, webhook-integrations, data-ingestion, email-notifications, error-monitoring) are covered by the restructured cookbook's 4-category system (common patterns, agent patterns, integrations, advanced). The "Recipes" section name was retired in favor of "Cookbook" per team decision on March 31.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@johnlindquist@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: add Recipes section with 5 real-world workflow guides - #1116

Closed
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes
Closed

docs: add Recipes section with 5 real-world workflow guides#1116
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes

Conversation

@johnlindquist

Copy link
Copy Markdown
Contributor

Summary

Adds a new Recipes documentation section with production-ready patterns for common workflow use cases. Each recipe was motivated by usage data analysis across 10 workflow categories.

New docs

RecipeUsage Signal
Data Synchronization — polling, batch sync, webhook-driven sync, reconciliation, idempotent writes100 teams, 369K runs, zero existing docs
Webhook Integrations — Slack events, GitHub webhooks, forwarding, cron processing40 teams, 516K runs, only primitives documented
Data Ingestion & File Processing — file uploads, event ingestion, email processing, resilient extraction23 teams, 1.1M runs, minimal docs
Notifications & Email — onboarding sequences, verification flows, contact forms, fan-out58 teams, 288K runs, zero existing docs
Error Monitoring & Alerting — error triage, alert routing, real-time dispatch, system monitoring19 teams, 4.7M runs (39% of all runs), zero docs

Structure

  • docs/content/docs/recipes/index.mdx — section overview with Cards
  • docs/content/docs/recipes/meta.json — navigation config
  • 5 recipe MDX files with full code examples
  • Updated top-level meta.json to include Recipes after AI Agents

Test plan

  • Verify all MDX files render correctly
  • Verify code examples are syntactically valid TypeScript
  • Verify navigation works (Recipes appears in sidebar)
  • Verify internal doc links resolve

Adds a new Recipes documentation section with production-ready patterns
for common workflow use cases, driven by usage data analysis:
- Data Synchronization (100 teams, 369K runs)
- Webhook Integrations (40 teams, 516K runs)
- Data Ingestion & File Processing (23 teams, 1.1M runs)
- Notifications & Email (58 teams, 288K runs)
- Error Monitoring & Alerting (19 teams, 4.7M runs)
@vercel

vercelBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bccdfa3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production531338572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds111459165
✅ 📋 Other135021156
Total2494482752817

❌ Failed Tests

▲ Vercel Production (3 failed)

astro (1 failed):

  • health check (queue-based) - workflow and step endpoints respond to health check messages

nextjs-turbopack (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed

nitro (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed
🌍 Community Worlds (45 failed)

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro4714
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
❌ nextjs-turbopack5011
✅ nextjs-webpack5101
❌ nitro4714
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
✅ mongodb4903
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.032s (-2.5%)1.005s (~)0.973s101.00x
💻 LocalNitro0.032s (-4.7%)1.005s (~)0.973s101.02x
🐘 PostgresNitro0.106s (-77.6% 🟢)1.009s (~)0.903s103.37x
🐘 PostgresExpress0.479s (+363.2% 🔺)1.010s (~)0.531s1015.16x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.589s (-14.6% 🟢)2.129s (+2.5%)1.540s101.00x
▲ VercelNext.js (Turbopack)0.635s (-21.9% 🟢)2.027s (-2.0%)1.392s101.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.103s (~)2.005s (~)0.902s101.00x
💻 LocalExpress1.104s (~)2.005s (~)0.901s101.00x
🐘 PostgresNitro1.933s (-17.6% 🟢)2.212s (-26.7% 🟢)0.278s101.75x
🐘 PostgresExpress2.296s (-7.3% 🟢)2.914s (-3.3%)0.618s102.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.299s (+2.3%)3.251s (+4.7%)0.951s101.00x
▲ VercelExpress3.701s (+69.6% 🔺)4.893s (+55.2% 🔺)1.192s101.61x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.815s (~)11.022s (~)0.207s31.00x
💻 LocalExpress10.825s (~)11.021s (~)0.196s31.00x
🐘 PostgresNitro14.882s (-26.3% 🟢)15.543s (-26.2% 🟢)0.661s21.38x
🐘 PostgresExpress15.219s (-25.2% 🟢)16.044s (-23.8% 🟢)0.826s21.41x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.433s (-1.3%)18.984s (+1.1%)1.552s21.00x
▲ VercelNext.js (Turbopack)17.826s (-10.5% 🟢)19.523s (-6.5% 🟢)1.697s21.02x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro27.471s (~)28.048s (~)0.578s31.00x
💻 LocalExpress27.479s (~)28.051s (~)0.572s31.00x
🐘 PostgresNitro36.233s (-28.2% 🟢)37.096s (-27.5% 🟢)0.863s21.32x
🐘 PostgresExpress37.773s (-24.7% 🟢)38.087s (-24.8% 🟢)0.313s21.38x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express44.720s (+4.2%)46.234s (+4.9%)1.514s21.00x
▲ VercelNext.js (Turbopack)48.102s (+11.3% 🔺)48.968s (+9.3% 🔺)0.866s21.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express57.178s (~)58.102s (~)0.924s21.00x
💻 LocalNitro57.258s (~)58.098s (~)0.841s21.00x
🐘 PostgresNitro72.562s (-27.5% 🟢)73.173s (-27.0% 🟢)0.611s21.27x
🐘 PostgresExpress75.153s (-25.1% 🟢)75.662s (-25.3% 🟢)0.509s21.31x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express90.088s (+2.0%)91.342s (+2.5%)1.254s11.00x
▲ VercelNext.js (Turbopack)93.322s (+5.9% 🔺)94.605s (+5.8% 🔺)1.283s11.04x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.408s (-1.8%)2.005s (~)0.597s151.00x
💻 LocalExpress1.414s (+0.9%)2.005s (~)0.591s151.00x
🐘 PostgresExpress1.844s (-23.4% 🟢)2.154s (-28.5% 🟢)0.310s141.31x
🐘 PostgresNitro2.190s (+2.6%)2.740s (-9.1% 🟢)0.549s111.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)13.444s (+293.8% 🔺)14.894s (+245.6% 🔺)1.450s31.00x
▲ VercelExpress18.410s (+658.4% 🔺)19.692s (+483.7% 🔺)1.283s21.37x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.581s (+1.1%)3.008s (~)0.427s101.00x
💻 LocalNitro2.584s (-0.8%)3.007s (~)0.423s101.00x
🐘 PostgresNitro10.114s (+19.2% 🔺)10.365s (+14.6% 🔺)0.251s33.92x
🐘 PostgresExpress10.620s (+31.6% 🔺)11.031s (+33.3% 🔺)0.411s34.11x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)12.420s (+289.5% 🔺)13.773s (+251.8% 🔺)1.353s31.00x
▲ VercelExpress18.796s (+504.9% 🔺)19.999s (+372.8% 🔺)1.203s21.51x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro7.445s (+1.3%)8.018s (~)0.573s41.00x
💻 LocalExpress7.460s (+2.5%)8.019s (~)0.559s41.00x
🐘 PostgresExpress48.794s (+17.2% 🔺)49.157s (+16.7% 🔺)0.363s16.55x
🐘 PostgresNitro51.668s (+6.9% 🔺)52.124s (+6.1% 🔺)0.456s16.94x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)24.942s (+391.1% 🔺)26.311s (+331.3% 🔺)1.369s21.00x
▲ VercelExpress28.201s (+507.9% 🔺)30.049s (+434.6% 🔺)1.848s11.13x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.431s (+0.8%)2.005s (~)0.574s151.00x
💻 LocalNitro1.437s (+0.5%)2.005s (~)0.568s151.00x
🐘 PostgresNitro1.946s (-14.3% 🟢)2.513s (-6.4% 🟢)0.567s121.36x
🐘 PostgresExpress2.219s (+13.0% 🔺)2.921s (+16.2% 🔺)0.703s111.55x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.719s (+599.0% 🔺)17.064s (+430.6% 🔺)1.345s21.00x
▲ VercelExpress24.020s (+986.3% 🔺)25.084s (+666.6% 🔺)1.063s21.53x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.673s (~)3.007s (~)0.334s101.00x
💻 LocalExpress2.705s (+0.8%)3.008s (~)0.303s101.01x
🐘 PostgresNitro10.674s (-19.9% 🟢)11.364s (-17.1% 🟢)0.690s33.99x
🐘 PostgresExpress10.736s (-6.3% 🟢)11.032s (-8.3% 🟢)0.296s34.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.853s (+93.5% 🔺)6.186s (+79.8% 🔺)1.333s51.00x
▲ VercelExpress7.043s (+166.2% 🔺)8.185s (+130.1% 🔺)1.142s41.45x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.849s (-2.8%)8.018s (-3.0%)0.168s41.00x
💻 LocalNitro8.017s (+1.9%)8.518s (+3.0%)0.501s41.02x
🐘 PostgresExpress51.610s (~)52.108s (~)0.498s16.57x
🐘 PostgresNitro53.153s (+2.3%)54.110s (+3.8%)0.957s16.77x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.903s (+27.1% 🔺)6.376s (+37.1% 🔺)1.473s51.00x
▲ VercelNext.js (Turbopack)10.880s (+182.0% 🔺)12.026s (+139.0% 🔺)1.147s32.22x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.172s (-1.9%)1.002s (~)0.012s (+5.4% 🔺)1.017s (~)0.845s101.00x
💻 LocalExpress0.175s (+3.8%)1.003s (~)0.011s (-8.7% 🟢)1.016s (~)0.841s101.02x
🐘 PostgresNitro0.791s (-64.5% 🟢)1.008s (-64.2% 🟢)0.001s (-29.4% 🟢)1.211s (-59.8% 🟢)0.420s104.61x
🐘 PostgresExpress1.260s (-48.7% 🟢)1.780s (-31.1% 🟢)0.001s (+7.7% 🔺)2.013s (-33.2% 🟢)0.753s107.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.941s (+18.2% 🔺)3.045s (-0.7%)0.082s (-64.7% 🟢)4.249s (+10.2% 🔺)1.308s101.00x
▲ VercelExpress3.025s (+53.8% 🔺)3.570s (+35.5% 🔺)0.547s (-9.9% 🟢)4.815s (+26.8% 🔺)1.790s101.03x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro7/12
🐘 PostgresNitro9/12
▲ VercelNext.js (Turbopack)7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)▲ Vercel12/12
Nitro💻 Local12/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Replace verbose polling/scheduling examples in error-monitoring and
webhook-integrations recipes with shorter inline snippets that link
to the canonical Scheduling & Cron foundations guide for depth.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thorough review of the recipes docs. Overall this is a solid addition — well-structured, consistent patterns, good use of idempotency keys and error handling throughout. A few issues below, most notably the broken links that the bot also flagged.

}
```

`sleep()` is durable — if the workflow restarts during a sleep, it resumes when the original duration expires. For comprehensive scheduling patterns including cron-like dispatching, health checks, and graceful shutdown, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: /docs/foundations/scheduling does not exist. The foundations section has no scheduling.mdx. Either link to an existing page (e.g., the sleep() API reference or common-patterns) or remove this sentence.

The vercel bot also flagged this.

}
```

This uses the durable polling pattern — `sleep()` consumes no compute while waiting, and the workflow resumes at the correct time even after restarts. For more advanced scheduling patterns including consecutive failure tracking, graceful shutdown, and cron-like dispatching, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: Same issue — /docs/foundations/scheduling doesn't exist. This is referenced in both this file and webhook-integrations.mdx.

if (response.status === 429) {
// Rate limited - back off exponentially // [!code highlight]
throw new RetryableError("Rate limited", { // [!code highlight]
retryAfter: metadata.attempt ** 2 * 1000, // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect retryAfter value type: metadata.attempt ** 2 * 1000 passes a raw number (milliseconds). Per RetryableErrorOptions, a bare number is interpreted as milliseconds, so 1000 = 1s, 4000 = 4s, 9000 = 9s. That's likely fine, but the inline comment says "back off exponentially" which might mislead readers into thinking it's seconds. Consider either:

  • Using a duration string for clarity: retryAfter: \${metadata.attempt ** 2}s``
  • Or adding a comment clarifying the unit is milliseconds

The workflow sleeps for real calendar time between sends. If the process restarts during a sleep, the workflow resumes at the correct point. Use [`FatalError`](/docs/api-reference/workflow/fatal-error) to skip retries for permanent failures like a missing email address.

<Callout type="info">
Email sends are side effects. Use [`getStepMetadata()`](/docs/api-reference/workflow/get-step-metadata) to pass a stable `stepId` as an idempotency key to your email provider, as shown in `sendConfirmationEmail` above. This prevents duplicate emails on retry. See [Idempotency](/docs/foundations/idempotency) for more details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale reference: The callout says "as shown in sendConfirmationEmail above", but sendConfirmationEmail is in the Contact Form Processing section further down the page, not above this callout. This callout is in the Email Onboarding Sequence section where none of the step functions use getStepMetadata() or stepId.

Either:

  1. Add an idempotency key to one of the onboarding step functions above to match the callout, or
  2. Rephrase to something like: "Use getStepMetadata() to pass a stable stepId as an idempotency key to your email provider to prevent duplicate emails on retry. See the Contact Form example below or the Idempotency guide."

"use workflow"; // [!code highlight]

// Replace slashes to keep tokens URL-safe
const safeRepoName = repoName.replace("/", ":"); // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: repoName.replace("/", ":") only replaces the first occurrence. For org/repo this works, but if there's ever a nested path this would be a subtle bug. Consider replaceAll or noting this only handles owner/repo format.

Minor since this is illustrative, but worth being precise in docs.

Each `fetchPrice` call is an independent step. If the API rate-limits the third symbol, the first two are already recorded and won't re-execute. The third step retries with exponential backoff until it succeeds or exhausts its retry budget.

<Callout type="info">
The default retry limit is 3. Set `fetchPrice.maxRetries = 10` after the function declaration to allow more attempts for flaky APIs. See [Errors and Retries](/docs/foundations/errors-and-retries) for the full retry API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "The default retry limit is 3" — to be precise, maxRetries = 3 means 4 total attempts (1 initial + 3 retries), per the existing errors-and-retries docs. Might be worth saying "The default is 3 retries (4 total attempts)" for consistency with the foundations page.


if (contacts.length > 0) {
await upsertContacts(contacts);
cursor = new Date();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: cursor is updated to new Date() after upserting, but this captures the time after the upsert completes, not the time of the last fetched record. If there's clock drift or the upsert takes time, you could miss records updated during that window. In a real implementation you'd use the updatedAt from the last returned contact.

Since this is a recipe/illustration it's probably fine, but a brief comment noting this simplification might help readers avoid this pitfall in production.


// The hook may not be registered yet — retry until it is
let delivered = false;
for (let i = 0; i < 5 && !delivered; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This retry loop for resumeHook is a practical pattern but a bit ugly for docs. The comment on line 164 explains the race well, and the callout below suggests createWebhook() as an alternative. Just flagging that this pattern could confuse readers — they might copy it verbatim. Consider adding a note that this is a simplification and production code should handle the !delivered case (e.g., return an error response).

.map((b) => b.toString(16).padStart(2, "0"))
.join("");

if (signature !== expected) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HMAC signature comparison uses string equality (signature !== expected) which is potentially vulnerable to timing attacks. For a security-sensitive operation like webhook signature verification, this should use crypto.timingSafeEqual (or crypto.subtle.timingSafeEqual where available). Since this is docs that people will copy, it's worth getting right.

Suggested change
if (signature !== expected) {
if (!crypto.subtle.timingSafeEqual) {
// Node.js < 22 fallback
const {timingSafeEqual} = await import("node:crypto");
if (!timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
await request.respondWith(new Response("Unauthorized", {status: 401}));
throw new FatalError("Invalid GitHub webhook signature");
}
} else if (signature !== expected) {

Or more simply, just use crypto.timingSafeEqual from node:crypto since steps have full Node.js access:

import{timingSafeEqual}from"node:crypto";// ...if(!timingSafeEqual(Buffer.from(signature),Buffer.from(expected))){

@johnlindquist

Copy link
Copy Markdown
ContributorAuthor

Closing — superseded by the cookbook work in #1564.

The 5 recipes here (data-sync, webhook-integrations, data-ingestion, email-notifications, error-monitoring) are covered by the restructured cookbook's 4-category system (common patterns, agent patterns, integrations, advanced). The "Recipes" section name was retired in favor of "Cookbook" per team decision on March 31.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@johnlindquist@pranaygp
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

docs: add Recipes section with 5 real-world workflow guides - #1116

Closed
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes
Closed

docs: add Recipes section with 5 real-world workflow guides#1116
johnlindquist wants to merge 4 commits into
mainfrom
docs/recipes

Conversation

@johnlindquist

Copy link
Copy Markdown
Contributor

Summary

Adds a new Recipes documentation section with production-ready patterns for common workflow use cases. Each recipe was motivated by usage data analysis across 10 workflow categories.

New docs

RecipeUsage Signal
Data Synchronization — polling, batch sync, webhook-driven sync, reconciliation, idempotent writes100 teams, 369K runs, zero existing docs
Webhook Integrations — Slack events, GitHub webhooks, forwarding, cron processing40 teams, 516K runs, only primitives documented
Data Ingestion & File Processing — file uploads, event ingestion, email processing, resilient extraction23 teams, 1.1M runs, minimal docs
Notifications & Email — onboarding sequences, verification flows, contact forms, fan-out58 teams, 288K runs, zero existing docs
Error Monitoring & Alerting — error triage, alert routing, real-time dispatch, system monitoring19 teams, 4.7M runs (39% of all runs), zero docs

Structure

  • docs/content/docs/recipes/index.mdx — section overview with Cards
  • docs/content/docs/recipes/meta.json — navigation config
  • 5 recipe MDX files with full code examples
  • Updated top-level meta.json to include Recipes after AI Agents

Test plan

  • Verify all MDX files render correctly
  • Verify code examples are syntactically valid TypeScript
  • Verify navigation works (Recipes appears in sidebar)
  • Verify internal doc links resolve

Adds a new Recipes documentation section with production-ready patterns
for common workflow use cases, driven by usage data analysis:
- Data Synchronization (100 teams, 369K runs)
- Webhook Integrations (40 teams, 516K runs)
- Data Ingestion & File Processing (23 teams, 1.1M runs)
- Notifications & Email (58 teams, 288K runs)
- Error Monitoring & Alerting (19 teams, 4.7M runs)
@vercel

vercelBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Feb 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bccdfa3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production531338572
✅ 💻 Local Development556068624
✅ 📦 Local Production556068624
✅ 🐘 Local Postgres556068624
✅ 🪟 Windows490352
❌ 🌍 Community Worlds111459165
✅ 📋 Other135021156
Total2494482752817

❌ Failed Tests

▲ Vercel Production (3 failed)

astro (1 failed):

  • health check (queue-based) - workflow and step endpoints respond to health check messages

nextjs-turbopack (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed

nitro (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed
🌍 Community Worlds (45 failed)

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro4714
✅ example4804
✅ express4804
✅ fastify4804
✅ hono4804
❌ nextjs-turbopack5011
✅ nextjs-webpack5101
❌ nitro4714
✅ nuxt4804
✅ sveltekit4804
✅ vite4804
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4507
✅ express-stable4507
✅ fastify-stable4507
✅ hono-stable4507
✅ nextjs-turbopack-canary4903
✅ nextjs-turbopack-stable4903
✅ nextjs-webpack-canary4903
✅ nextjs-webpack-stable4903
✅ nitro-stable4507
✅ nuxt-stable4507
✅ sveltekit-stable4507
✅ vite-stable4507
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4903
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
✅ mongodb4903
✅ redis-dev300
✅ redis4903
✅ turso-dev300
❌ turso4453
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4507
✅ e2e-local-postgres-nest-stable4507
✅ e2e-local-prod-nest-stable4507

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.032s (-2.5%)1.005s (~)0.973s101.00x
💻 LocalNitro0.032s (-4.7%)1.005s (~)0.973s101.02x
🐘 PostgresNitro0.106s (-77.6% 🟢)1.009s (~)0.903s103.37x
🐘 PostgresExpress0.479s (+363.2% 🔺)1.010s (~)0.531s1015.16x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.589s (-14.6% 🟢)2.129s (+2.5%)1.540s101.00x
▲ VercelNext.js (Turbopack)0.635s (-21.9% 🟢)2.027s (-2.0%)1.392s101.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.103s (~)2.005s (~)0.902s101.00x
💻 LocalExpress1.104s (~)2.005s (~)0.901s101.00x
🐘 PostgresNitro1.933s (-17.6% 🟢)2.212s (-26.7% 🟢)0.278s101.75x
🐘 PostgresExpress2.296s (-7.3% 🟢)2.914s (-3.3%)0.618s102.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.299s (+2.3%)3.251s (+4.7%)0.951s101.00x
▲ VercelExpress3.701s (+69.6% 🔺)4.893s (+55.2% 🔺)1.192s101.61x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.815s (~)11.022s (~)0.207s31.00x
💻 LocalExpress10.825s (~)11.021s (~)0.196s31.00x
🐘 PostgresNitro14.882s (-26.3% 🟢)15.543s (-26.2% 🟢)0.661s21.38x
🐘 PostgresExpress15.219s (-25.2% 🟢)16.044s (-23.8% 🟢)0.826s21.41x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express17.433s (-1.3%)18.984s (+1.1%)1.552s21.00x
▲ VercelNext.js (Turbopack)17.826s (-10.5% 🟢)19.523s (-6.5% 🟢)1.697s21.02x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro27.471s (~)28.048s (~)0.578s31.00x
💻 LocalExpress27.479s (~)28.051s (~)0.572s31.00x
🐘 PostgresNitro36.233s (-28.2% 🟢)37.096s (-27.5% 🟢)0.863s21.32x
🐘 PostgresExpress37.773s (-24.7% 🟢)38.087s (-24.8% 🟢)0.313s21.38x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express44.720s (+4.2%)46.234s (+4.9%)1.514s21.00x
▲ VercelNext.js (Turbopack)48.102s (+11.3% 🔺)48.968s (+9.3% 🔺)0.866s21.08x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express57.178s (~)58.102s (~)0.924s21.00x
💻 LocalNitro57.258s (~)58.098s (~)0.841s21.00x
🐘 PostgresNitro72.562s (-27.5% 🟢)73.173s (-27.0% 🟢)0.611s21.27x
🐘 PostgresExpress75.153s (-25.1% 🟢)75.662s (-25.3% 🟢)0.509s21.31x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express90.088s (+2.0%)91.342s (+2.5%)1.254s11.00x
▲ VercelNext.js (Turbopack)93.322s (+5.9% 🔺)94.605s (+5.8% 🔺)1.283s11.04x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.408s (-1.8%)2.005s (~)0.597s151.00x
💻 LocalExpress1.414s (+0.9%)2.005s (~)0.591s151.00x
🐘 PostgresExpress1.844s (-23.4% 🟢)2.154s (-28.5% 🟢)0.310s141.31x
🐘 PostgresNitro2.190s (+2.6%)2.740s (-9.1% 🟢)0.549s111.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)13.444s (+293.8% 🔺)14.894s (+245.6% 🔺)1.450s31.00x
▲ VercelExpress18.410s (+658.4% 🔺)19.692s (+483.7% 🔺)1.283s21.37x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express2.581s (+1.1%)3.008s (~)0.427s101.00x
💻 LocalNitro2.584s (-0.8%)3.007s (~)0.423s101.00x
🐘 PostgresNitro10.114s (+19.2% 🔺)10.365s (+14.6% 🔺)0.251s33.92x
🐘 PostgresExpress10.620s (+31.6% 🔺)11.031s (+33.3% 🔺)0.411s34.11x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)12.420s (+289.5% 🔺)13.773s (+251.8% 🔺)1.353s31.00x
▲ VercelExpress18.796s (+504.9% 🔺)19.999s (+372.8% 🔺)1.203s21.51x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro7.445s (+1.3%)8.018s (~)0.573s41.00x
💻 LocalExpress7.460s (+2.5%)8.019s (~)0.559s41.00x
🐘 PostgresExpress48.794s (+17.2% 🔺)49.157s (+16.7% 🔺)0.363s16.55x
🐘 PostgresNitro51.668s (+6.9% 🔺)52.124s (+6.1% 🔺)0.456s16.94x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)24.942s (+391.1% 🔺)26.311s (+331.3% 🔺)1.369s21.00x
▲ VercelExpress28.201s (+507.9% 🔺)30.049s (+434.6% 🔺)1.848s11.13x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.431s (+0.8%)2.005s (~)0.574s151.00x
💻 LocalNitro1.437s (+0.5%)2.005s (~)0.568s151.00x
🐘 PostgresNitro1.946s (-14.3% 🟢)2.513s (-6.4% 🟢)0.567s121.36x
🐘 PostgresExpress2.219s (+13.0% 🔺)2.921s (+16.2% 🔺)0.703s111.55x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)15.719s (+599.0% 🔺)17.064s (+430.6% 🔺)1.345s21.00x
▲ VercelExpress24.020s (+986.3% 🔺)25.084s (+666.6% 🔺)1.063s21.53x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.673s (~)3.007s (~)0.334s101.00x
💻 LocalExpress2.705s (+0.8%)3.008s (~)0.303s101.01x
🐘 PostgresNitro10.674s (-19.9% 🟢)11.364s (-17.1% 🟢)0.690s33.99x
🐘 PostgresExpress10.736s (-6.3% 🟢)11.032s (-8.3% 🟢)0.296s34.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.853s (+93.5% 🔺)6.186s (+79.8% 🔺)1.333s51.00x
▲ VercelExpress7.043s (+166.2% 🔺)8.185s (+130.1% 🔺)1.142s41.45x
▲ VercelNitro⚠️missing----

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express7.849s (-2.8%)8.018s (-3.0%)0.168s41.00x
💻 LocalNitro8.017s (+1.9%)8.518s (+3.0%)0.501s41.02x
🐘 PostgresExpress51.610s (~)52.108s (~)0.498s16.57x
🐘 PostgresNitro53.153s (+2.3%)54.110s (+3.8%)0.957s16.77x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.903s (+27.1% 🔺)6.376s (+37.1% 🔺)1.473s51.00x
▲ VercelNext.js (Turbopack)10.880s (+182.0% 🔺)12.026s (+139.0% 🔺)1.147s32.22x
▲ VercelNitro⚠️missing----

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.172s (-1.9%)1.002s (~)0.012s (+5.4% 🔺)1.017s (~)0.845s101.00x
💻 LocalExpress0.175s (+3.8%)1.003s (~)0.011s (-8.7% 🟢)1.016s (~)0.841s101.02x
🐘 PostgresNitro0.791s (-64.5% 🟢)1.008s (-64.2% 🟢)0.001s (-29.4% 🟢)1.211s (-59.8% 🟢)0.420s104.61x
🐘 PostgresExpress1.260s (-48.7% 🟢)1.780s (-31.1% 🟢)0.001s (+7.7% 🔺)2.013s (-33.2% 🟢)0.753s107.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.941s (+18.2% 🔺)3.045s (-0.7%)0.082s (-64.7% 🟢)4.249s (+10.2% 🔺)1.308s101.00x
▲ VercelExpress3.025s (+53.8% 🔺)3.570s (+35.5% 🔺)0.547s (-9.9% 🟢)4.815s (+26.8% 🔺)1.790s101.03x
▲ VercelNitro⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro7/12
🐘 PostgresNitro9/12
▲ VercelNext.js (Turbopack)7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local11/12
Next.js (Turbopack)▲ Vercel12/12
Nitro💻 Local12/12
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

Replace verbose polling/scheduling examples in error-monitoring and
webhook-integrations recipes with shorter inline snippets that link
to the canonical Scheduling & Cron foundations guide for depth.

@pranaygppranaygp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thorough review of the recipes docs. Overall this is a solid addition — well-structured, consistent patterns, good use of idempotency keys and error handling throughout. A few issues below, most notably the broken links that the bot also flagged.

}
```

`sleep()` is durable — if the workflow restarts during a sleep, it resumes when the original duration expires. For comprehensive scheduling patterns including cron-like dispatching, health checks, and graceful shutdown, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: /docs/foundations/scheduling does not exist. The foundations section has no scheduling.mdx. Either link to an existing page (e.g., the sleep() API reference or common-patterns) or remove this sentence.

The vercel bot also flagged this.

}
```

This uses the durable polling pattern — `sleep()` consumes no compute while waiting, and the workflow resumes at the correct time even after restarts. For more advanced scheduling patterns including consecutive failure tracking, graceful shutdown, and cron-like dispatching, see [Scheduling & Cron](/docs/foundations/scheduling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken link: Same issue — /docs/foundations/scheduling doesn't exist. This is referenced in both this file and webhook-integrations.mdx.

if (response.status === 429) {
// Rate limited - back off exponentially // [!code highlight]
throw new RetryableError("Rate limited", { // [!code highlight]
retryAfter: metadata.attempt ** 2 * 1000, // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect retryAfter value type: metadata.attempt ** 2 * 1000 passes a raw number (milliseconds). Per RetryableErrorOptions, a bare number is interpreted as milliseconds, so 1000 = 1s, 4000 = 4s, 9000 = 9s. That's likely fine, but the inline comment says "back off exponentially" which might mislead readers into thinking it's seconds. Consider either:

  • Using a duration string for clarity: retryAfter: \${metadata.attempt ** 2}s``
  • Or adding a comment clarifying the unit is milliseconds

The workflow sleeps for real calendar time between sends. If the process restarts during a sleep, the workflow resumes at the correct point. Use [`FatalError`](/docs/api-reference/workflow/fatal-error) to skip retries for permanent failures like a missing email address.

<Callout type="info">
Email sends are side effects. Use [`getStepMetadata()`](/docs/api-reference/workflow/get-step-metadata) to pass a stable `stepId` as an idempotency key to your email provider, as shown in `sendConfirmationEmail` above. This prevents duplicate emails on retry. See [Idempotency](/docs/foundations/idempotency) for more details.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale reference: The callout says "as shown in sendConfirmationEmail above", but sendConfirmationEmail is in the Contact Form Processing section further down the page, not above this callout. This callout is in the Email Onboarding Sequence section where none of the step functions use getStepMetadata() or stepId.

Either:

  1. Add an idempotency key to one of the onboarding step functions above to match the callout, or
  2. Rephrase to something like: "Use getStepMetadata() to pass a stable stepId as an idempotency key to your email provider to prevent duplicate emails on retry. See the Contact Form example below or the Idempotency guide."

"use workflow"; // [!code highlight]

// Replace slashes to keep tokens URL-safe
const safeRepoName = repoName.replace("/", ":"); // [!code highlight]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: repoName.replace("/", ":") only replaces the first occurrence. For org/repo this works, but if there's ever a nested path this would be a subtle bug. Consider replaceAll or noting this only handles owner/repo format.

Minor since this is illustrative, but worth being precise in docs.

Each `fetchPrice` call is an independent step. If the API rate-limits the third symbol, the first two are already recorded and won't re-execute. The third step retries with exponential backoff until it succeeds or exhausts its retry budget.

<Callout type="info">
The default retry limit is 3. Set `fetchPrice.maxRetries = 10` after the function declaration to allow more attempts for flaky APIs. See [Errors and Retries](/docs/foundations/errors-and-retries) for the full retry API.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "The default retry limit is 3" — to be precise, maxRetries = 3 means 4 total attempts (1 initial + 3 retries), per the existing errors-and-retries docs. Might be worth saying "The default is 3 retries (4 total attempts)" for consistency with the foundations page.


if (contacts.length > 0) {
await upsertContacts(contacts);
cursor = new Date();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: cursor is updated to new Date() after upserting, but this captures the time after the upsert completes, not the time of the last fetched record. If there's clock drift or the upsert takes time, you could miss records updated during that window. In a real implementation you'd use the updatedAt from the last returned contact.

Since this is a recipe/illustration it's probably fine, but a brief comment noting this simplification might help readers avoid this pitfall in production.


// The hook may not be registered yet — retry until it is
let delivered = false;
for (let i = 0; i < 5 && !delivered; i++) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This retry loop for resumeHook is a practical pattern but a bit ugly for docs. The comment on line 164 explains the race well, and the callout below suggests createWebhook() as an alternative. Just flagging that this pattern could confuse readers — they might copy it verbatim. Consider adding a note that this is a simplification and production code should handle the !delivered case (e.g., return an error response).

.map((b) => b.toString(16).padStart(2, "0"))
.join("");

if (signature !== expected) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HMAC signature comparison uses string equality (signature !== expected) which is potentially vulnerable to timing attacks. For a security-sensitive operation like webhook signature verification, this should use crypto.timingSafeEqual (or crypto.subtle.timingSafeEqual where available). Since this is docs that people will copy, it's worth getting right.

Suggested change
if (signature !== expected) {
if (!crypto.subtle.timingSafeEqual) {
// Node.js < 22 fallback
const {timingSafeEqual} = await import("node:crypto");
if (!timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
await request.respondWith(new Response("Unauthorized", {status: 401}));
throw new FatalError("Invalid GitHub webhook signature");
}
} else if (signature !== expected) {

Or more simply, just use crypto.timingSafeEqual from node:crypto since steps have full Node.js access:

import{timingSafeEqual}from"node:crypto";// ...if(!timingSafeEqual(Buffer.from(signature),Buffer.from(expected))){

@johnlindquist

Copy link
Copy Markdown
ContributorAuthor

Closing — superseded by the cookbook work in #1564.

The 5 recipes here (data-sync, webhook-integrations, data-ingestion, email-notifications, error-monitoring) are covered by the restructured cookbook's 4-category system (common patterns, agent patterns, integrations, advanced). The "Recipes" section name was retired in favor of "Cookbook" per team decision on March 31.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@johnlindquist@pranaygp