Skip to content

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

Closed
johnlindquist wants to merge 4 commits intomainfrom
docs/recipes
Closed

docs: add Recipes section with 5 real-world workflow guides#1116
johnlindquist wants to merge 4 commits intomainfrom
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

Recipe Usage Signal
Data Synchronization — polling, batch sync, webhook-driven sync, reconciliation, idempotent writes 100 teams, 369K runs, zero existing docs
Webhook Integrations — Slack events, GitHub webhooks, forwarding, cron processing 40 teams, 516K runs, only primitives documented
Data Ingestion & File Processing — file uploads, event ingestion, email processing, resilient extraction 23 teams, 1.1M runs, minimal docs
Notifications & Email — onboarding sequences, verification flows, contact forms, fan-out 58 teams, 288K runs, zero existing docs
Error Monitoring & Alerting — error triage, alert routing, real-time dispatch, system monitoring 19 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
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 18, 2026

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 18, 2026

⚠️ 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
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 18, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 531 3 38 572
✅ 💻 Local Development 556 0 68 624
✅ 📦 Local Production 556 0 68 624
✅ 🐘 Local Postgres 556 0 68 624
✅ 🪟 Windows 49 0 3 52
❌ 🌍 Community Worlds 111 45 9 165
✅ 📋 Other 135 0 21 156
Total 2494 48 275 2817

❌ 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
App Passed Failed Skipped
❌ astro 47 1 4
✅ example 48 0 4
✅ express 48 0 4
✅ fastify 48 0 4
✅ hono 48 0 4
❌ nextjs-turbopack 50 1 1
✅ nextjs-webpack 51 0 1
❌ nitro 47 1 4
✅ nuxt 48 0 4
✅ sveltekit 48 0 4
✅ vite 48 0 4
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 45 0 7
✅ express-stable 45 0 7
✅ fastify-stable 45 0 7
✅ hono-stable 45 0 7
✅ nextjs-turbopack-canary 49 0 3
✅ nextjs-turbopack-stable 49 0 3
✅ nextjs-webpack-canary 49 0 3
✅ nextjs-webpack-stable 49 0 3
✅ nitro-stable 45 0 7
✅ nuxt-stable 45 0 7
✅ sveltekit-stable 45 0 7
✅ vite-stable 45 0 7
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 45 0 7
✅ express-stable 45 0 7
✅ fastify-stable 45 0 7
✅ hono-stable 45 0 7
✅ nextjs-turbopack-canary 49 0 3
✅ nextjs-turbopack-stable 49 0 3
✅ nextjs-webpack-canary 49 0 3
✅ nextjs-webpack-stable 49 0 3
✅ nitro-stable 45 0 7
✅ nuxt-stable 45 0 7
✅ sveltekit-stable 45 0 7
✅ vite-stable 45 0 7
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 45 0 7
✅ express-stable 45 0 7
✅ fastify-stable 45 0 7
✅ hono-stable 45 0 7
✅ nextjs-turbopack-canary 49 0 3
✅ nextjs-turbopack-stable 49 0 3
✅ nextjs-webpack-canary 49 0 3
✅ nextjs-webpack-stable 49 0 3
✅ nitro-stable 45 0 7
✅ nuxt-stable 45 0 7
✅ sveltekit-stable 45 0 7
✅ vite-stable 45 0 7
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 49 0 3
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 0
✅ mongodb 49 0 3
✅ redis-dev 3 0 0
✅ redis 49 0 3
✅ turso-dev 3 0 0
❌ turso 4 45 3
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 45 0 7
✅ e2e-local-postgres-nest-stable 45 0 7
✅ e2e-local-prod-nest-stable 45 0 7

📋 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
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 18, 2026

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.032s (-2.5%) 1.005s (~) 0.973s 10 1.00x
💻 Local Nitro 0.032s (-4.7%) 1.005s (~) 0.973s 10 1.02x
🐘 Postgres Nitro 0.106s (-77.6% 🟢) 1.009s (~) 0.903s 10 3.37x
🐘 Postgres Express 0.479s (+363.2% 🔺) 1.010s (~) 0.531s 10 15.16x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 0.589s (-14.6% 🟢) 2.129s (+2.5%) 1.540s 10 1.00x
▲ Vercel Next.js (Turbopack) 0.635s (-21.9% 🟢) 2.027s (-2.0%) 1.392s 10 1.08x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.103s (~) 2.005s (~) 0.902s 10 1.00x
💻 Local Express 1.104s (~) 2.005s (~) 0.901s 10 1.00x
🐘 Postgres Nitro 1.933s (-17.6% 🟢) 2.212s (-26.7% 🟢) 0.278s 10 1.75x
🐘 Postgres Express 2.296s (-7.3% 🟢) 2.914s (-3.3%) 0.618s 10 2.08x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.299s (+2.3%) 3.251s (+4.7%) 0.951s 10 1.00x
▲ Vercel Express 3.701s (+69.6% 🔺) 4.893s (+55.2% 🔺) 1.192s 10 1.61x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 10.815s (~) 11.022s (~) 0.207s 3 1.00x
💻 Local Express 10.825s (~) 11.021s (~) 0.196s 3 1.00x
🐘 Postgres Nitro 14.882s (-26.3% 🟢) 15.543s (-26.2% 🟢) 0.661s 2 1.38x
🐘 Postgres Express 15.219s (-25.2% 🟢) 16.044s (-23.8% 🟢) 0.826s 2 1.41x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 17.433s (-1.3%) 18.984s (+1.1%) 1.552s 2 1.00x
▲ Vercel Next.js (Turbopack) 17.826s (-10.5% 🟢) 19.523s (-6.5% 🟢) 1.697s 2 1.02x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 27.471s (~) 28.048s (~) 0.578s 3 1.00x
💻 Local Express 27.479s (~) 28.051s (~) 0.572s 3 1.00x
🐘 Postgres Nitro 36.233s (-28.2% 🟢) 37.096s (-27.5% 🟢) 0.863s 2 1.32x
🐘 Postgres Express 37.773s (-24.7% 🟢) 38.087s (-24.8% 🟢) 0.313s 2 1.38x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 44.720s (+4.2%) 46.234s (+4.9%) 1.514s 2 1.00x
▲ Vercel Next.js (Turbopack) 48.102s (+11.3% 🔺) 48.968s (+9.3% 🔺) 0.866s 2 1.08x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 57.178s (~) 58.102s (~) 0.924s 2 1.00x
💻 Local Nitro 57.258s (~) 58.098s (~) 0.841s 2 1.00x
🐘 Postgres Nitro 72.562s (-27.5% 🟢) 73.173s (-27.0% 🟢) 0.611s 2 1.27x
🐘 Postgres Express 75.153s (-25.1% 🟢) 75.662s (-25.3% 🟢) 0.509s 2 1.31x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 90.088s (+2.0%) 91.342s (+2.5%) 1.254s 1 1.00x
▲ Vercel Next.js (Turbopack) 93.322s (+5.9% 🔺) 94.605s (+5.8% 🔺) 1.283s 1 1.04x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.408s (-1.8%) 2.005s (~) 0.597s 15 1.00x
💻 Local Express 1.414s (+0.9%) 2.005s (~) 0.591s 15 1.00x
🐘 Postgres Express 1.844s (-23.4% 🟢) 2.154s (-28.5% 🟢) 0.310s 14 1.31x
🐘 Postgres Nitro 2.190s (+2.6%) 2.740s (-9.1% 🟢) 0.549s 11 1.56x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 13.444s (+293.8% 🔺) 14.894s (+245.6% 🔺) 1.450s 3 1.00x
▲ Vercel Express 18.410s (+658.4% 🔺) 19.692s (+483.7% 🔺) 1.283s 2 1.37x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 2.581s (+1.1%) 3.008s (~) 0.427s 10 1.00x
💻 Local Nitro 2.584s (-0.8%) 3.007s (~) 0.423s 10 1.00x
🐘 Postgres Nitro 10.114s (+19.2% 🔺) 10.365s (+14.6% 🔺) 0.251s 3 3.92x
🐘 Postgres Express 10.620s (+31.6% 🔺) 11.031s (+33.3% 🔺) 0.411s 3 4.11x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 12.420s (+289.5% 🔺) 13.773s (+251.8% 🔺) 1.353s 3 1.00x
▲ Vercel Express 18.796s (+504.9% 🔺) 19.999s (+372.8% 🔺) 1.203s 2 1.51x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 7.445s (+1.3%) 8.018s (~) 0.573s 4 1.00x
💻 Local Express 7.460s (+2.5%) 8.019s (~) 0.559s 4 1.00x
🐘 Postgres Express 48.794s (+17.2% 🔺) 49.157s (+16.7% 🔺) 0.363s 1 6.55x
🐘 Postgres Nitro 51.668s (+6.9% 🔺) 52.124s (+6.1% 🔺) 0.456s 1 6.94x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 24.942s (+391.1% 🔺) 26.311s (+331.3% 🔺) 1.369s 2 1.00x
▲ Vercel Express 28.201s (+507.9% 🔺) 30.049s (+434.6% 🔺) 1.848s 1 1.13x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 1.431s (+0.8%) 2.005s (~) 0.574s 15 1.00x
💻 Local Nitro 1.437s (+0.5%) 2.005s (~) 0.568s 15 1.00x
🐘 Postgres Nitro 1.946s (-14.3% 🟢) 2.513s (-6.4% 🟢) 0.567s 12 1.36x
🐘 Postgres Express 2.219s (+13.0% 🔺) 2.921s (+16.2% 🔺) 0.703s 11 1.55x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 15.719s (+599.0% 🔺) 17.064s (+430.6% 🔺) 1.345s 2 1.00x
▲ Vercel Express 24.020s (+986.3% 🔺) 25.084s (+666.6% 🔺) 1.063s 2 1.53x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 2.673s (~) 3.007s (~) 0.334s 10 1.00x
💻 Local Express 2.705s (+0.8%) 3.008s (~) 0.303s 10 1.01x
🐘 Postgres Nitro 10.674s (-19.9% 🟢) 11.364s (-17.1% 🟢) 0.690s 3 3.99x
🐘 Postgres Express 10.736s (-6.3% 🟢) 11.032s (-8.3% 🟢) 0.296s 3 4.02x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 4.853s (+93.5% 🔺) 6.186s (+79.8% 🔺) 1.333s 5 1.00x
▲ Vercel Express 7.043s (+166.2% 🔺) 8.185s (+130.1% 🔺) 1.142s 4 1.45x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Express

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 7.849s (-2.8%) 8.018s (-3.0%) 0.168s 4 1.00x
💻 Local Nitro 8.017s (+1.9%) 8.518s (+3.0%) 0.501s 4 1.02x
🐘 Postgres Express 51.610s (~) 52.108s (~) 0.498s 1 6.57x
🐘 Postgres Nitro 53.153s (+2.3%) 54.110s (+3.8%) 0.957s 1 6.77x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 4.903s (+27.1% 🔺) 6.376s (+37.1% 🔺) 1.473s 5 1.00x
▲ Vercel Next.js (Turbopack) 10.880s (+182.0% 🔺) 12.026s (+139.0% 🔺) 1.147s 3 2.22x
▲ Vercel Nitro ⚠️ missing - - - -

🔍 Observability: Express | Next.js (Turbopack)

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 0.172s (-1.9%) 1.002s (~) 0.012s (+5.4% 🔺) 1.017s (~) 0.845s 10 1.00x
💻 Local Express 0.175s (+3.8%) 1.003s (~) 0.011s (-8.7% 🟢) 1.016s (~) 0.841s 10 1.02x
🐘 Postgres Nitro 0.791s (-64.5% 🟢) 1.008s (-64.2% 🟢) 0.001s (-29.4% 🟢) 1.211s (-59.8% 🟢) 0.420s 10 4.61x
🐘 Postgres Express 1.260s (-48.7% 🟢) 1.780s (-31.1% 🟢) 0.001s (+7.7% 🔺) 2.013s (-33.2% 🟢) 0.753s 10 7.34x
💻 Local Next.js (Turbopack) ⚠️ missing - - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.941s (+18.2% 🔺) 3.045s (-0.7%) 0.082s (-64.7% 🟢) 4.249s (+10.2% 🔺) 1.308s 10 1.00x
▲ Vercel Express 3.025s (+53.8% 🔺) 3.570s (+35.5% 🔺) 0.547s (-9.9% 🟢) 4.815s (+26.8% 🔺) 1.790s 10 1.03x
▲ Vercel Nitro ⚠️ missing - - - - -

🔍 Observability: Next.js (Turbopack) | Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Nitro 7/12
🐘 Postgres Nitro 9/12
▲ Vercel Next.js (Turbopack) 7/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 💻 Local 11/12
Next.js (Turbopack) ▲ Vercel 12/12
Nitro 💻 Local 12/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.
Copy link
Copy Markdown
Collaborator

@pranaygp pranaygp left a comment

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
Collaborator

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
Collaborator

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
Collaborator

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
Collaborator

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
Collaborator

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
Collaborator

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
Collaborator

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
Collaborator

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
Collaborator

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
Contributor Author

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 free to 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