Skip to content

Conversation

@pranaygp
Copy link
Collaborator

@pranaygp pranaygp commented Feb 11, 2026

Human (hey it's me Pranay)

In addition to retrying 5xx errors, I added an e2e test here for steps. For AI and human reviewers: pleae pay careful attention to the e2e test to validate that it actually works and tests the right thing and isn't a possible false positive.

This PR also wraps queue operations with retrying (similar to 5xx errors from workflow-server, if queue experiences transient network errors, we should have some retrying). It may be better for this to live inside @vercel/queue client natively but I added it here anyway

read on:

AI

Summary

Step handler 5xx retry (@workflow/core)

  • Add withServerErrorRetry helper that retries on 5xx WorkflowAPIError with exponential backoff (500ms, 1s, 2s — 3.5s total)
  • Wrap all world.events.create calls in the step handler (step_started, step_completed, step_failed, step_retrying) with the retry helper
  • Add 5xx detection in the step execution catch block — persistent 5xx errors throw to the queue instead of going through step_retrying, so no step attempt is consumed

Queue operation retry (@workflow/core + @workflow/world-vercel)

  • Wrap VQS error types (InternalServerError, ConsumerDiscoveryError, ConsumerRegistryNotConfiguredError) as WorkflowAPIError with status 500/502/503 at the world-vercel boundary — matches how utils.ts:makeRequest() already normalizes HTTP errors for events
  • Wrap world.queue() in queueMessage() with withServerErrorRetry, giving all call sites (step skip, max retries re-queue, step completion continuation, error handler continuation) automatic retry protection for transient queue failures

Tests

  • Unit tests (helpers.test.ts): 16 tests covering withServerErrorRetry (7 tests) and withThrottleRetry (9 tests)
  • Unit tests (queue.test.ts): 3 tests verifying VQS errors are wrapped as WorkflowAPIError with correct status codes
  • E2E test (e2e.test.ts): serverError5xxRetryWorkflow uses run-scoped fault injection to make step_completed calls throw 500 errors, then verifies the workflow completes correctly, retries actually fired, and no step attempt was consumed

Test plan

  • pnpm build passes
  • pnpm test in packages/core passes
  • pnpm test in packages/world-vercel passes (27 tests including 3 new VQS error wrapping tests)
  • Unit tests: pnpm vitest run packages/core/src/runtime/helpers.test.ts — 16 tests pass
  • E2E test: serverError5xxRetryWorkflow passes locally against nextjs-turbopack dev server
  • CI e2e tests pass

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 11, 2026 23:53
@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest commit: 4dd3ee5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@workflow/core Patch
@workflow/world-vercel Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/web-shared Patch
workflow Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/world-testing Patch
@workflow/nuxt Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 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 🥇 Nitro 0.026s (~) 1.004s (~) 0.978s 10 1.00x
💻 Local Express 0.032s (+9.5% 🔺) 1.006s (~) 0.973s 10 1.22x
💻 Local Next.js (Turbopack) 0.034s 1.004s 0.971s 10 1.27x
🌐 Redis Next.js (Turbopack) 0.046s 1.005s 0.959s 10 1.73x
🌐 MongoDB Next.js (Turbopack) 0.097s 1.008s 0.911s 10 3.67x
🐘 Postgres Express 0.107s (-6.6% 🟢) 1.010s (~) 0.903s 10 4.05x
🐘 Postgres Nitro 0.464s (+365.3% 🔺) 1.016s (+0.6%) 0.552s 10 17.57x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 0.726s (-25.1% 🟢) 1.972s (-27.9% 🟢) 1.246s 10 1.00x
▲ Vercel Express 0.811s (-4.0%) 2.270s (+10.0% 🔺) 1.459s 10 1.12x
▲ Vercel Nitro 0.920s (+25.0% 🔺) 2.406s (+26.4% 🔺) 1.486s 10 1.27x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.074s (~) 2.005s (~) 0.931s 10 1.00x
💻 Local Next.js (Turbopack) 1.080s 2.005s 0.925s 10 1.01x
🌐 Redis Next.js (Turbopack) 1.104s 2.006s 0.902s 10 1.03x
💻 Local Express 1.105s (+1.6%) 2.005s (~) 0.900s 10 1.03x
🌐 MongoDB Next.js (Turbopack) 1.299s 2.008s 0.709s 10 1.21x
🐘 Postgres Nitro 2.378s (+11.0% 🔺) 3.014s (+15.4% 🔺) 0.636s 10 2.21x
🐘 Postgres Express 2.485s (~) 3.014s (~) 0.529s 10 2.31x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.782s (-1.6%) 3.728s (-4.0%) 0.947s 10 1.00x
▲ Vercel Express 2.958s (+8.3% 🔺) 4.153s (+6.7% 🔺) 1.194s 10 1.06x
▲ Vercel Next.js (Turbopack) 3.352s (+14.9% 🔺) 4.712s (+6.8% 🔺) 1.359s 10 1.21x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 10.552s (~) 11.022s (~) 0.470s 3 1.00x
💻 Local Next.js (Turbopack) 10.588s 11.023s 0.435s 3 1.00x
🌐 Redis Next.js (Turbopack) 10.692s 11.023s 0.331s 3 1.01x
💻 Local Express 10.832s (+2.7%) 11.024s (~) 0.192s 3 1.03x
🌐 MongoDB Next.js (Turbopack) 12.209s 13.015s 0.805s 3 1.16x
🐘 Postgres Nitro 20.230s (+31.5% 🔺) 21.060s (+31.2% 🔺) 0.830s 2 1.92x
🐘 Postgres Express 20.340s (~) 21.059s (~) 0.720s 2 1.93x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 20.430s (-2.8%) 21.532s (-1.5%) 1.102s 2 1.00x
▲ Vercel Express 21.273s (-0.5%) 23.399s (+3.2%) 2.125s 2 1.04x
▲ Vercel Next.js (Turbopack) 21.548s (-1.7%) 22.232s (-5.8% 🟢) 0.684s 2 1.05x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 26.770s (~) 27.053s (~) 0.283s 3 1.00x
🌐 Redis Next.js (Turbopack) 26.831s 27.049s 0.219s 3 1.00x
💻 Local Next.js (Turbopack) 26.863s 27.050s 0.187s 3 1.00x
💻 Local Express 27.510s (+2.8%) 28.052s (+3.7%) 0.542s 3 1.03x
🌐 MongoDB Next.js (Turbopack) 30.385s 31.038s 0.653s 2 1.14x
🐘 Postgres Express 50.334s (~) 51.128s (~) 0.795s 2 1.88x
🐘 Postgres Nitro 50.505s (+35.9% 🔺) 51.133s (+36.0% 🔺) 0.628s 2 1.89x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 53.822s (-2.5%) 55.029s (-2.1%) 1.207s 2 1.00x
▲ Vercel Next.js (Turbopack) 54.532s (+2.1%) 55.968s (+2.4%) 1.436s 2 1.01x
▲ Vercel Express 56.236s (+3.0%) 57.404s (+3.4%) 1.167s 2 1.04x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 54.374s 55.097s 0.723s 2 1.00x
💻 Local Nitro 55.645s (~) 56.102s (~) 0.457s 2 1.02x
💻 Local Next.js (Turbopack) 55.794s 56.099s 0.305s 2 1.03x
💻 Local Express 57.453s (+3.4%) 58.106s (+3.6%) 0.653s 2 1.06x
🌐 MongoDB Next.js (Turbopack) 61.065s 61.575s 0.510s 2 1.12x
🐘 Postgres Nitro 100.122s (+49.2% 🔺) 100.240s (+48.1% 🔺) 0.118s 1 1.84x
🐘 Postgres Express 100.207s (~) 100.232s (-1.0%) 0.025s 1 1.84x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 109.404s (-4.2%) 110.174s (-4.2%) 0.770s 1 1.00x
▲ Vercel Nitro 110.830s (-0.5%) 113.196s (+0.8%) 2.366s 1 1.01x
▲ Vercel Next.js (Turbopack) 114.099s (~) 115.409s (~) 1.310s 1 1.04x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.252s 2.006s 0.754s 15 1.00x
💻 Local Next.js (Turbopack) 1.378s 2.006s 0.628s 15 1.10x
💻 Local Nitro 1.387s (~) 2.005s (~) 0.618s 15 1.11x
💻 Local Express 1.423s (+5.1% 🔺) 2.006s (~) 0.582s 15 1.14x
🌐 MongoDB Next.js (Turbopack) 2.177s 3.009s 0.832s 10 1.74x
🐘 Postgres Express 2.215s (-9.4% 🟢) 3.014s (~) 0.799s 10 1.77x
🐘 Postgres Nitro 2.283s (+3.2%) 3.015s (+12.5% 🔺) 0.732s 10 1.82x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.033s (+7.0% 🔺) 4.016s (+11.3% 🔺) 0.983s 8 1.00x
▲ Vercel Next.js (Turbopack) 3.081s (+2.4%) 4.289s (+1.9%) 1.209s 7 1.02x
▲ Vercel Nitro 3.303s (+8.4% 🔺) 4.894s (+16.7% 🔺) 1.591s 7 1.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 2.278s 3.007s 0.729s 10 1.00x
💻 Local Nitro 2.306s (+1.6%) 3.007s (~) 0.701s 10 1.01x
🌐 Redis Next.js (Turbopack) 2.503s 3.008s 0.505s 10 1.10x
💻 Local Express 2.697s (+19.8% 🔺) 3.007s (~) 0.310s 10 1.18x
🌐 MongoDB Next.js (Turbopack) 4.786s 5.178s 0.392s 6 2.10x
🐘 Postgres Nitro 8.543s (-32.5% 🟢) 9.287s (-28.8% 🟢) 0.744s 4 3.75x
🐘 Postgres Express 8.690s (+0.5%) 9.040s (~) 0.350s 4 3.81x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 3.250s (-26.2% 🟢) 4.723s (-18.3% 🟢) 1.473s 7 1.00x
▲ Vercel Nitro 3.371s (+10.8% 🔺) 5.006s (+22.1% 🔺) 1.635s 7 1.04x
▲ Vercel Express 3.643s (-8.4% 🟢) 5.174s (+2.4%) 1.530s 6 1.12x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 4.040s 4.582s 0.543s 7 1.00x
💻 Local Nitro 6.313s (+3.4%) 7.013s (+2.9%) 0.700s 5 1.56x
💻 Local Next.js (Turbopack) 6.642s 7.214s 0.571s 5 1.64x
💻 Local Express 7.949s (+35.3% 🔺) 8.520s (+28.8% 🔺) 0.572s 4 1.97x
🌐 MongoDB Next.js (Turbopack) 9.898s 10.353s 0.454s 3 2.45x
🐘 Postgres Nitro 41.695s (-24.5% 🟢) 42.117s (-25.0% 🟢) 0.422s 1 10.32x
🐘 Postgres Express 42.509s (-11.3% 🟢) 43.131s (-10.4% 🟢) 0.622s 1 10.52x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 5.995s (+39.3% 🔺) 8.127s (+46.1% 🔺) 2.132s 4 1.00x
▲ Vercel Nitro 6.510s (+44.6% 🔺) 7.664s (+40.2% 🔺) 1.154s 6 1.09x
▲ Vercel Express 8.230s (+90.8% 🔺) 9.850s (+78.7% 🔺) 1.620s 4 1.37x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.240s 2.006s 0.766s 15 1.00x
💻 Local Nitro 1.349s (-1.4%) 2.005s (~) 0.656s 15 1.09x
💻 Local Next.js (Turbopack) 1.398s 2.005s 0.607s 15 1.13x
💻 Local Express 1.418s (+4.7%) 2.005s (~) 0.587s 15 1.14x
🐘 Postgres Nitro 1.851s (-18.1% 🟢) 2.080s (-24.1% 🟢) 0.229s 15 1.49x
🌐 MongoDB Next.js (Turbopack) 2.150s 3.007s 0.857s 10 1.73x
🐘 Postgres Express 2.159s (+0.7%) 2.598s (-5.3% 🟢) 0.439s 12 1.74x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.929s (+33.7% 🔺) 5.039s (+26.5% 🔺) 1.109s 6 1.00x
▲ Vercel Express 4.383s (+50.1% 🔺) 5.608s (+32.6% 🔺) 1.224s 6 1.12x
▲ Vercel Next.js (Turbopack) 5.019s (+70.0% 🔺) 6.352s (+58.7% 🔺) 1.333s 5 1.28x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 2.468s (+4.3%) 3.010s (~) 0.542s 10 1.00x
💻 Local Next.js (Turbopack) 2.478s 3.007s 0.529s 10 1.00x
🌐 Redis Next.js (Turbopack) 2.510s 3.007s 0.497s 10 1.02x
💻 Local Express 2.737s (+16.8% 🔺) 3.008s (~) 0.271s 10 1.11x
🌐 MongoDB Next.js (Turbopack) 4.649s 5.175s 0.526s 6 1.88x
🐘 Postgres Express 10.051s (-12.5% 🟢) 10.696s (-11.1% 🟢) 0.646s 3 4.07x
🐘 Postgres Nitro 10.959s (-19.2% 🟢) 11.704s (-16.6% 🟢) 0.745s 3 4.44x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.149s (-23.4% 🟢) 4.560s (-12.5% 🟢) 1.411s 7 1.00x
▲ Vercel Next.js (Turbopack) 4.172s (+25.6% 🔺) 5.653s (+15.4% 🔺) 1.481s 6 1.32x
▲ Vercel Nitro 5.883s (+114.8% 🔺) 7.669s (+91.0% 🔺) 1.786s 4 1.87x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 4.099s 4.581s 0.482s 7 1.00x
💻 Local Nitro 6.923s (+2.4%) 7.415s (+5.7% 🔺) 0.492s 5 1.69x
💻 Local Next.js (Turbopack) 6.962s 7.516s 0.554s 4 1.70x
💻 Local Express 8.142s (+21.9% 🔺) 8.775s (+25.1% 🔺) 0.633s 4 1.99x
🌐 MongoDB Next.js (Turbopack) 9.780s 10.349s 0.569s 3 2.39x
🐘 Postgres Nitro 47.668s (-12.6% 🟢) 48.123s (-12.7% 🟢) 0.455s 1 11.63x
🐘 Postgres Express 49.092s (-1.3%) 49.122s (-2.0%) 0.030s 1 11.98x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.492s (~) 4.956s (+7.3% 🔺) 1.464s 7 1.00x
▲ Vercel Next.js (Turbopack) 4.414s (-23.8% 🟢) 5.505s (-23.8% 🟢) 1.090s 6 1.26x
▲ Vercel Express 5.229s (-19.8% 🟢) 6.677s (-13.8% 🟢) 1.448s 5 1.50x

🔍 Observability: Nitro | Next.js (Turbopack) | Express

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.112s (-1.8%) 1.002s (~) 0.009s (-2.1%) 1.014s (~) 0.902s 10 1.00x
💻 Local Next.js (Turbopack) 0.113s 1.001s 0.010s 1.015s 0.903s 10 1.00x
🌐 Redis Next.js (Turbopack) 0.145s 1.000s 0.001s 1.007s 0.862s 10 1.29x
💻 Local Express 0.173s (+58.4% 🔺) 1.002s (~) 0.011s (+20.4% 🔺) 1.017s (~) 0.844s 10 1.54x
🌐 MongoDB Next.js (Turbopack) 0.505s 0.943s 0.001s 1.008s 0.504s 10 4.50x
🐘 Postgres Nitro 2.213s (+285.1% 🔺) 2.830s (+197.7% 🔺) 0.002s (+25.0% 🔺) 3.016s (+198.6% 🔺) 0.803s 10 19.71x
🐘 Postgres Express 2.315s (-6.7% 🟢) 2.726s (+6.5% 🔺) 0.001s (+7.7% 🔺) 3.015s (~) 0.700s 10 20.62x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.730s (+1.4%) 3.214s (+3.2%) 0.558s (+218.4% 🔺) 4.525s (+16.4% 🔺) 1.795s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.837s (-0.9%) 3.181s (-3.8%) 0.243s (+137.3% 🔺) 4.077s (-2.3%) 1.240s 10 1.04x
▲ Vercel Nitro 2.874s (~) 3.512s (-1.5%) 0.185s (-25.8% 🟢) 4.388s (-1.8%) 1.514s 10 1.05x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Nitro 10/12
🐘 Postgres Nitro 8/12
▲ Vercel Nitro 5/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 💻 Local 11/12
Next.js (Turbopack) 💻 Local 6/12
Nitro 💻 Local 11/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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 501 0 38 539
✅ 💻 Local Development 428 0 62 490
✅ 📦 Local Production 428 0 62 490
✅ 🐘 Local Postgres 428 0 62 490
✅ 🪟 Windows 46 0 3 49
❌ 🌍 Community Worlds 105 42 9 156
✅ 📋 Other 126 0 21 147
Total 2062 42 257 2361

❌ Failed Tests

🌍 Community Worlds (42 failed)

turso (42 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • 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
  • 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 45 0 4
✅ example 45 0 4
✅ express 45 0 4
✅ fastify 45 0 4
✅ hono 45 0 4
✅ nextjs-turbopack 48 0 1
✅ nextjs-webpack 48 0 1
✅ nitro 45 0 4
✅ nuxt 45 0 4
✅ sveltekit 45 0 4
✅ vite 45 0 4
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 42 0 7
✅ express-stable 42 0 7
✅ fastify-stable 42 0 7
✅ hono-stable 42 0 7
✅ nextjs-turbopack-stable 46 0 3
✅ nextjs-webpack-stable 46 0 3
✅ nitro-stable 42 0 7
✅ nuxt-stable 42 0 7
✅ sveltekit-stable 42 0 7
✅ vite-stable 42 0 7
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 42 0 7
✅ express-stable 42 0 7
✅ fastify-stable 42 0 7
✅ hono-stable 42 0 7
✅ nextjs-turbopack-stable 46 0 3
✅ nextjs-webpack-stable 46 0 3
✅ nitro-stable 42 0 7
✅ nuxt-stable 42 0 7
✅ sveltekit-stable 42 0 7
✅ vite-stable 42 0 7
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 42 0 7
✅ express-stable 42 0 7
✅ fastify-stable 42 0 7
✅ hono-stable 42 0 7
✅ nextjs-turbopack-stable 46 0 3
✅ nextjs-webpack-stable 46 0 3
✅ nitro-stable 42 0 7
✅ nuxt-stable 42 0 7
✅ sveltekit-stable 42 0 7
✅ vite-stable 42 0 7
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 46 0 3
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 0
✅ mongodb 46 0 3
✅ redis-dev 3 0 0
✅ redis 46 0 3
✅ turso-dev 3 0 0
❌ turso 4 42 3
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 42 0 7
✅ e2e-local-postgres-nest-stable 42 0 7
✅ e2e-local-prod-nest-stable 42 0 7

📋 View full workflow run

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends workflow-server transient error handling into the step handler by introducing a 5xx retry helper and applying it to step lifecycle event writes, aiming to avoid consuming step attempts on transient infrastructure failures.

Changes:

  • Add withServerErrorRetry helper to retry workflow-server 5xx errors with exponential backoff.
  • Wrap step handler world.events.create calls for step_started, step_completed, step_failed, and step_retrying with the retry helper.
  • Add a 5xx “bubble to queue retry” path in the step execution error handling block.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/core/src/runtime/step-handler.ts Wrap step lifecycle event creation with 5xx retry; add logic to rethrow persistent 5xx to defer to queue retry.
packages/core/src/runtime/helpers.ts Introduce withServerErrorRetry with 3 retries and exponential backoff for 5xx WorkflowAPIErrors.
.changeset/retry-5xx-step-handler.md Patch changeset describing the new retry behavior in the step handler.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +120 to +126
const startResult = await withServerErrorRetry(() =>
world.events.create(workflowRunId, {
eventType: 'step_started',
specVersion: SPEC_VERSION_CURRENT,
correlationId: stepId,
})
);
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

This adds new retry behavior that changes how the step handler reacts to workflow-server 5xx responses, but there are no unit tests covering the new helper’s retry/backoff semantics or the step-handler’s 5xx fast-path (throwing to queue vs. emitting step_retrying). Adding vitest coverage (similar to runtime/start.test.ts) would help prevent regressions in retry counts/delays and in when attempts are consumed.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added unit tests in helpers.test.ts covering: success passthrough, retry on 5xx with recovery, exponential backoff across 3 retries, retry exhaustion, and non-retryable error passthrough (non-5xx, non-WorkflowAPIError, 429).

@pranaygp pranaygp marked this pull request as draft February 12, 2026 01:12
pranaygp and others added 2 commits February 11, 2026 17:15
Add `withServerErrorRetry` helper that retries world calls on 5xx errors
with exponential backoff (500ms, 1s, 2s ≈ 3.5s total). Applied to all
`world.events.create` calls in the step handler so transient
workflow-server errors don't consume step attempts.

If retries are exhausted, the error is thrown to the queue for
higher-level retry without burning a step attempt.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Fix misleading `maxAttempts` log field to `maxRetries` in withServerErrorRetry
- Update step-handler comment to accurately note that queue retries may
  still consume step attempts since step_started has already incremented
- Add unit tests for withServerErrorRetry (7 tests covering success,
  retry/backoff, exhaustion, and non-5xx passthrough)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@vercel
Copy link
Contributor

vercel bot commented Feb 12, 2026

Unit tests for withThrottleRetry and withServerErrorRetry helpers, plus
an e2e test that exercises the 5xx retry codepath during step execution
via run-scoped fault injection.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy link
Member

@VaguelySerious VaguelySerious left a comment

Choose a reason for hiding this comment

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

LGTM with some concerns about what "transient" means for 500s and forever-retrying workflows

export async function withServerErrorRetry<T>(
fn: () => Promise<T>
): Promise<T> {
const delays = [500, 1000, 2000];
Copy link
Member

Choose a reason for hiding this comment

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

I'd like more backoff here. 500s might be transient, but in our history, most 500s were fixed after 5-60 minutes, not a few seconds. The only transient 500s I remember is dynamodb throttling, which we should be returning 429s for, but I guess this is safe since we're only doing three re-tries.

// subsequent queue retry may increment attempts again depending on
// storage semantics, so these retries are not guaranteed to be
// "free" with respect to step attempts.
if (err.status !== undefined && err.status >= 500) {
Copy link
Member

Choose a reason for hiding this comment

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

If this doesn't consume a re-try, we will forever-retry specific endpoints that throw consistent 500s 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

HH: not forever. only 64 times I think (the max queue deliveries). Maybe @ctgowrie has thoughts?

};
}
// Wrap VQS server errors as WorkflowAPIError so withServerErrorRetry can catch them
if (error instanceof InternalServerError) {

Choose a reason for hiding this comment

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

Would prefer we let queue client handle so we can control with server

@pranaygp
Copy link
Collaborator Author

moving to draft till I remove the queue retrying and rebase this on main for merge conflicts

@pranaygp pranaygp marked this pull request as draft February 12, 2026 21:58
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.

3 participants