Retry 5xx errors from workflow-server in step handler - #1011

Merged
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx
Feb 13, 2026
Merged

Retry 5xx errors from workflow-server in step handler#1011
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx

Conversation

@pranaygp

@pranaygppranaygp commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

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.

read on:

AI

Summary

  • Add withServerErrorRetry helper that retries world calls on 5xx errors 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

Extends the 5xx retry behavior from #966 to the step handler. The key insight: transient workflow-server errors should be retried silently without consuming step attempts, while persistent errors bubble to the queue for higher-level retry.

Tests added

  • Unit tests (helpers.test.ts): 26 tests covering getWorkflowQueueName (10 tests), withServerErrorRetry (7 tests) and withThrottleRetry (9 tests) — success passthrough, retry on 5xx with exponential backoff, retry exhaustion, non-retryable error passthrough, short/long retryAfter handling, double-throttle deferral, and default retryAfter behavior
  • 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
  • Unit tests: pnpm vitest run packages/core/src/runtime/helpers.test.ts — 26 tests pass
  • E2E test: serverError5xxRetryWorkflow passes locally against nextjs-turbopack dev server
  • CI e2e tests pass

🤖 Generated with Claude Code

CopilotAI review requested due to automatic review settings February 11, 2026 23:53
@changeset-bot

changeset-botBot commented Feb 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 87a0c91

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

This PR includes changesets to release 14 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 11, 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🥇 Nitro0.032s (-1.9%)1.005s (~)0.973s101.00x
💻 LocalExpress0.032s (+0.9%)1.005s (~)0.973s101.01x
💻 LocalNext.js (Turbopack)0.040s (-6.4% 🟢)1.005s (~)0.965s101.25x
🌐 RedisNext.js (Turbopack)0.050s (+9.2% 🔺)1.005s (~)0.955s101.58x
🌐 MongoDBNext.js (Turbopack)0.087s (-7.9% 🟢)1.008s (~)0.921s102.74x
🐘 PostgresExpress0.170s (-63.5% 🟢)1.009s (-1.0%)0.839s105.39x
🐘 PostgresNitro0.216s (+74.9% 🔺)1.011s (~)0.795s106.83x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.732s (+12.1% 🔺)2.012s (+4.9%)1.280s101.00x
▲ VercelNext.js (Turbopack)0.895s (+46.6% 🔺)2.300s (+24.4% 🔺)1.404s101.22x
▲ VercelNitro1.720s (+175.8% 🔺)2.964s (+46.7% 🔺)1.244s102.35x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.099s (-1.1%)2.006s (~)0.906s101.00x
💻 LocalExpress1.104s (~)2.006s (~)0.902s101.00x
💻 LocalNitro1.105s (~)2.006s (~)0.901s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🌐 MongoDBNext.js (Turbopack)1.308s (+1.0%)2.008s (~)0.700s101.19x
🐘 PostgresExpress2.205s (-7.5% 🟢)3.014s (~)0.809s102.01x
🐘 PostgresNitro2.432s (+1.0%)3.015s (~)0.582s102.21x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.506s (~)3.483s (-1.5%)0.977s101.00x
▲ VercelExpress2.621s (+2.2%)3.497s (~)0.876s101.05x
▲ VercelNitro2.988s (~)3.870s (-2.3%)0.882s101.19x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.723s (~)11.023s (~)0.301s31.00x
🌐 RedisNext.js (Turbopack)10.739s (~)11.023s (~)0.284s31.00x
💻 LocalNitro10.816s (~)11.023s (~)0.206s31.01x
💻 LocalExpress10.821s (~)11.022s (~)0.200s31.01x
🌐 MongoDBNext.js (Turbopack)12.275s (~)13.021s (~)0.746s31.14x
🐘 PostgresNitro20.298s (~)21.061s (~)0.763s21.89x
🐘 PostgresExpress20.438s (+1.0%)21.056s (~)0.619s21.91x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.453s (+2.1%)20.661s (+4.8%)1.208s21.00x
▲ VercelNext.js (Turbopack)19.520s (+1.0%)20.949s (-1.2%)1.429s21.00x
▲ VercelNitro19.598s (+4.2%)20.245s (-1.7%)0.648s21.01x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.968s (~)27.052s (~)0.084s31.00x
💻 LocalNext.js (Turbopack)27.202s (~)28.051s (~)0.849s31.01x
💻 LocalNitro27.466s (~)28.049s (~)0.583s31.02x
💻 LocalExpress27.495s (~)28.051s (~)0.556s31.02x
🌐 MongoDBNext.js (Turbopack)30.477s (+0.5%)31.038s (~)0.561s21.13x
🐘 PostgresExpress50.233s (-0.5%)51.128s (~)0.895s21.86x
🐘 PostgresNitro50.309s (~)50.626s (-1.0%)0.318s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)48.800s (+3.8%)50.099s (+4.7%)1.299s21.00x
▲ VercelNitro50.597s (+8.0% 🔺)51.906s (+7.6% 🔺)1.309s21.04x
▲ VercelExpress51.275s (+10.9% 🔺)52.177s (+11.1% 🔺)0.903s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.371s (~)55.100s (~)0.729s21.00x
💻 LocalNext.js (Turbopack)56.953s (~)57.105s (~)0.152s21.05x
💻 LocalNitro57.278s (~)58.100s (~)0.822s21.05x
💻 LocalExpress57.336s (~)58.102s (~)0.766s21.05x
🌐 MongoDBNext.js (Turbopack)61.116s (+0.7%)61.576s (+0.9%)0.460s21.12x
🐘 PostgresExpress79.580s (-20.5% 🟢)80.178s (-20.0% 🟢)0.598s21.46x
🐘 PostgresNitro100.195s (~)100.236s (-1.0%)0.041s11.84x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express97.478s (+0.8%)98.523s (+0.5%)1.045s11.00x
▲ VercelNitro98.857s (+2.0%)100.171s (+2.8%)1.314s11.01x
▲ VercelNext.js (Turbopack)104.292s (+5.7% 🔺)105.129s (+6.2% 🔺)0.837s11.07x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.241s (~)2.006s (~)0.765s151.00x
💻 LocalNitro1.406s (-0.8%)2.006s (~)0.599s151.13x
💻 LocalExpress1.410s (~)2.005s (~)0.596s151.14x
💻 LocalNext.js (Turbopack)1.419s (+1.4%)2.006s (~)0.586s151.14x
🌐 MongoDBNext.js (Turbopack)2.168s (~)3.008s (~)0.840s101.75x
🐘 PostgresNitro2.182s (-9.5% 🟢)3.014s (~)0.833s101.76x
🐘 PostgresExpress2.233s (+3.2%)2.596s (-13.9% 🟢)0.363s121.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.807s (+4.5%)3.681s (+6.5% 🔺)0.874s91.00x
▲ VercelNext.js (Turbopack)3.014s (+2.9%)4.310s (+7.5% 🔺)1.296s81.07x
▲ VercelNitro3.569s (+34.5% 🔺)4.444s (+16.9% 🔺)0.874s71.27x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.513s (~)3.008s (~)0.495s101.00x
💻 LocalNitro2.599s (-0.8%)3.007s (~)0.408s101.03x
💻 LocalExpress2.635s (+2.2%)3.007s (~)0.372s101.05x
💻 LocalNext.js (Turbopack)2.705s (+5.2% 🔺)3.007s (~)0.302s101.08x
🌐 MongoDBNext.js (Turbopack)4.734s (-0.9%)5.177s (~)0.443s61.88x
🐘 PostgresNitro8.542s (-3.7%)9.043s (-2.6%)0.501s43.40x
🐘 PostgresExpress10.213s (+20.2% 🔺)10.698s (+18.3% 🔺)0.485s34.06x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.038s (-3.4%)4.161s (-0.9%)1.124s81.00x
▲ VercelNitro3.270s (-19.7% 🟢)4.475s (-19.5% 🟢)1.205s71.08x
▲ VercelNext.js (Turbopack)3.982s (+16.6% 🔺)5.435s (+21.6% 🔺)1.452s61.31x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.116s (+1.5%)4.868s (+3.0%)0.751s71.00x
💻 LocalNext.js (Turbopack)7.175s (~)7.766s (+2.0%)0.590s41.74x
💻 LocalNitro7.456s (-2.9%)8.021s (~)0.564s41.81x
💻 LocalExpress7.622s (+2.6%)8.019s (~)0.397s41.85x
🌐 MongoDBNext.js (Turbopack)9.837s (+1.2%)10.349s (~)0.512s32.39x
🐘 PostgresNitro49.785s (+6.5% 🔺)50.124s (+6.4% 🔺)0.339s112.09x
🐘 PostgresExpress50.464s (+10.3% 🔺)51.121s (+10.9% 🔺)0.657s112.26x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.460s (-12.5% 🟢)4.682s (-8.0% 🟢)1.223s71.00x
▲ VercelExpress3.921s (+21.7% 🔺)5.187s (+6.3% 🔺)1.265s61.13x
▲ VercelNext.js (Turbopack)3.997s (+6.3% 🔺)5.343s (+4.1%)1.346s61.16x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.264s (~)2.006s (~)0.742s151.00x
💻 LocalNext.js (Turbopack)1.428s (~)2.005s (~)0.577s151.13x
💻 LocalExpress1.439s (+1.4%)2.004s (~)0.565s151.14x
💻 LocalNitro1.440s (-1.5%)2.006s (~)0.566s151.14x
🐘 PostgresNitro2.137s (-5.2% 🟢)2.513s (-14.0% 🟢)0.376s121.69x
🌐 MongoDBNext.js (Turbopack)2.155s (-1.1%)3.009s (~)0.854s101.70x
🐘 PostgresExpress2.221s (-5.3% 🟢)2.512s (-16.6% 🟢)0.291s121.76x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.510s (-4.9%)3.456s (+1.9%)0.946s91.00x
▲ VercelExpress2.720s (+11.2% 🔺)3.578s (+3.6%)0.858s91.08x
▲ VercelNitro2.792s (+14.2% 🔺)4.239s (+17.8% 🔺)1.447s81.11x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.508s (~)3.008s (~)0.500s101.00x
💻 LocalNitro2.701s (-1.7%)3.007s (~)0.306s101.08x
💻 LocalExpress2.729s (+3.1%)3.007s (~)0.278s101.09x
💻 LocalNext.js (Turbopack)2.837s (+5.8% 🔺)3.007s (~)0.171s101.13x
🌐 MongoDBNext.js (Turbopack)4.806s (~)5.177s (~)0.372s61.92x
🐘 PostgresNitro11.404s (+47.4% 🔺)11.705s (+41.4% 🔺)0.301s34.55x
🐘 PostgresExpress12.784s (+22.5% 🔺)13.032s (+18.1% 🔺)0.248s35.10x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.883s (-24.3% 🟢)4.226s (-19.5% 🟢)1.343s81.00x
▲ VercelExpress2.954s (+11.4% 🔺)3.834s (+7.2% 🔺)0.880s81.02x
▲ VercelNext.js (Turbopack)3.008s (-3.1%)4.370s (-1.0%)1.362s71.04x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.136s (~)4.868s (~)0.732s71.00x
💻 LocalNext.js (Turbopack)7.242s (-5.0%)7.766s (-8.8% 🟢)0.525s41.75x
💻 LocalNitro7.944s (-1.2%)8.269s (-5.7% 🟢)0.325s41.92x
💻 LocalExpress8.083s (+3.4%)9.023s (+12.5% 🔺)0.939s41.95x
🌐 MongoDBNext.js (Turbopack)9.944s (~)10.684s (+3.3%)0.740s32.40x
🐘 PostgresNitro52.383s (+14.5% 🔺)53.118s (+15.2% 🔺)0.735s112.66x
🐘 PostgresExpress53.132s (+1.3%)54.116s (+1.8%)0.984s112.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.058s (-25.8% 🟢)3.931s (-24.6% 🟢)0.874s81.00x
▲ VercelNext.js (Turbopack)4.041s (-2.4%)5.520s (-1.5%)1.479s61.32x
▲ VercelNitro4.841s (+55.5% 🔺)6.079s (+33.8% 🔺)1.239s61.58x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.147s (-2.1%)1.001s (~)0.011s (+12.9% 🔺)1.017s (~)0.870s101.00x
🌐 RedisNext.js (Turbopack)0.150s (-2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.02x
💻 LocalNitro0.168s (-3.7%)1.002s (~)0.011s (-1.8%)1.016s (~)0.848s101.15x
💻 LocalExpress0.175s (+3.7%)1.003s (~)0.011s (-3.4%)1.017s (~)0.841s101.19x
🌐 MongoDBNext.js (Turbopack)0.504s (+5.6% 🔺)0.943s (-2.5%)0.002s (+14.3% 🔺)1.008s (~)0.505s103.43x
🐘 PostgresExpress1.408s (-38.2% 🟢)1.626s (-41.2% 🟢)0.001s (-13.3% 🟢)2.013s (-33.3% 🟢)0.604s109.58x
🐘 PostgresNitro2.290s (-7.2% 🟢)2.754s (+6.9% 🔺)0.001s (+8.3% 🔺)3.016s (~)0.726s1015.58x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.434s (+3.3%)2.752s (-3.2%)0.238s (+27.2% 🔺)3.633s (~)1.198s101.00x
▲ VercelExpress2.444s (+5.3% 🔺)2.720s (+0.6%)0.284s (+40.6% 🔺)3.690s (+5.2% 🔺)1.246s101.00x
▲ VercelNext.js (Turbopack)2.578s (+7.5% 🔺)3.116s (+1.6%)0.178s (-35.5% 🟢)4.055s (+2.9%)1.478s101.06x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro7/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local10/12
Next.js (Turbopack)🌐 Redis6/12
Nitro💻 Local10/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

github-actionsBot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production501038539
✅ 💻 Local Development428062490
✅ 📦 Local Production428062490
✅ 🐘 Local Postgres428062490
✅ 🪟 Windows460349
❌ 🌍 Community Worlds104439156
✅ 📋 Other126021147
Total2061432572361

❌ Failed Tests

🌍 Community Worlds (43 failed)

mongodb (1 failed):

  • webhookWorkflow

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
AppPassedFailedSkipped
✅ astro4504
✅ example4504
✅ express4504
✅ fastify4504
✅ hono4504
✅ nextjs-turbopack4801
✅ nextjs-webpack4801
✅ nitro4504
✅ nuxt4504
✅ sveltekit4504
✅ vite4504
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4603
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4513
✅ redis-dev300
✅ redis4603
✅ turso-dev300
❌ turso4423
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4207
✅ e2e-local-postgres-nest-stable4207
✅ e2e-local-prod-nest-stable4207

📋 View full workflow run

CopilotAI 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.

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.

FileDescription
packages/core/src/runtime/step-handler.tsWrap step lifecycle event creation with 5xx retry; add logic to rethrow persistent 5xx to defer to queue retry.
packages/core/src/runtime/helpers.tsIntroduce withServerErrorRetry with 3 retries and exponential backoff for 5xx WorkflowAPIErrors.
.changeset/retry-5xx-step-handler.mdPatch 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 threadpackages/core/src/runtime/step-handler.ts Outdated
Comment threadpackages/core/src/runtime/helpers.ts Outdated
Comment on lines +120 to +126
const startResult = await withServerErrorRetry(() =>
world.events.create(workflowRunId, {
eventType: 'step_started',
specVersion: SPEC_VERSION_CURRENT,
correlationId: stepId,
})
);

CopilotAIFeb 11, 2026

Copy link

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
Copy Markdown
ContributorAuthor

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
@vercel

vercelBot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

@VaguelySeriousVaguelySerious left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

Comment threadpackages/core/src/runtime/step-handler.ts
Comment threadpackages/world-vercel/src/queue.ts Outdated
};
}
// Wrap VQS server errors as WorkflowAPIError so withServerErrorRetry can catch them
if (error instanceof InternalServerError) {

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.

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

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

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
pranaygpand others added 6 commits February 12, 2026 16:45
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
VQS throws its own error types (InternalServerError, ConsumerDiscoveryError,
ConsumerRegistryNotConfiguredError) that don't match WorkflowAPIError.is().
Wrapping them at the world-vercel boundary enables withServerErrorRetry in
queueMessage() to automatically retry transient queue failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Queue retrying will be handled natively by the @vercel/queue client
instead. Reverts VQS error wrapping and withServerErrorRetry in
queueMessage().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

4 participants

@pranaygp@ctgowrie@VaguelySerious
, '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

Retry 5xx errors from workflow-server in step handler - #1011

Merged
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx
Feb 13, 2026
Merged

Retry 5xx errors from workflow-server in step handler#1011
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx

Conversation

@pranaygp

@pranaygppranaygp commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

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.

read on:

AI

Summary

  • Add withServerErrorRetry helper that retries world calls on 5xx errors 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

Extends the 5xx retry behavior from #966 to the step handler. The key insight: transient workflow-server errors should be retried silently without consuming step attempts, while persistent errors bubble to the queue for higher-level retry.

Tests added

  • Unit tests (helpers.test.ts): 26 tests covering getWorkflowQueueName (10 tests), withServerErrorRetry (7 tests) and withThrottleRetry (9 tests) — success passthrough, retry on 5xx with exponential backoff, retry exhaustion, non-retryable error passthrough, short/long retryAfter handling, double-throttle deferral, and default retryAfter behavior
  • 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
  • Unit tests: pnpm vitest run packages/core/src/runtime/helpers.test.ts — 26 tests pass
  • E2E test: serverError5xxRetryWorkflow passes locally against nextjs-turbopack dev server
  • CI e2e tests pass

🤖 Generated with Claude Code

CopilotAI review requested due to automatic review settings February 11, 2026 23:53
@changeset-bot

changeset-botBot commented Feb 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 87a0c91

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

This PR includes changesets to release 14 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 11, 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🥇 Nitro0.032s (-1.9%)1.005s (~)0.973s101.00x
💻 LocalExpress0.032s (+0.9%)1.005s (~)0.973s101.01x
💻 LocalNext.js (Turbopack)0.040s (-6.4% 🟢)1.005s (~)0.965s101.25x
🌐 RedisNext.js (Turbopack)0.050s (+9.2% 🔺)1.005s (~)0.955s101.58x
🌐 MongoDBNext.js (Turbopack)0.087s (-7.9% 🟢)1.008s (~)0.921s102.74x
🐘 PostgresExpress0.170s (-63.5% 🟢)1.009s (-1.0%)0.839s105.39x
🐘 PostgresNitro0.216s (+74.9% 🔺)1.011s (~)0.795s106.83x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.732s (+12.1% 🔺)2.012s (+4.9%)1.280s101.00x
▲ VercelNext.js (Turbopack)0.895s (+46.6% 🔺)2.300s (+24.4% 🔺)1.404s101.22x
▲ VercelNitro1.720s (+175.8% 🔺)2.964s (+46.7% 🔺)1.244s102.35x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.099s (-1.1%)2.006s (~)0.906s101.00x
💻 LocalExpress1.104s (~)2.006s (~)0.902s101.00x
💻 LocalNitro1.105s (~)2.006s (~)0.901s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🌐 MongoDBNext.js (Turbopack)1.308s (+1.0%)2.008s (~)0.700s101.19x
🐘 PostgresExpress2.205s (-7.5% 🟢)3.014s (~)0.809s102.01x
🐘 PostgresNitro2.432s (+1.0%)3.015s (~)0.582s102.21x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.506s (~)3.483s (-1.5%)0.977s101.00x
▲ VercelExpress2.621s (+2.2%)3.497s (~)0.876s101.05x
▲ VercelNitro2.988s (~)3.870s (-2.3%)0.882s101.19x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.723s (~)11.023s (~)0.301s31.00x
🌐 RedisNext.js (Turbopack)10.739s (~)11.023s (~)0.284s31.00x
💻 LocalNitro10.816s (~)11.023s (~)0.206s31.01x
💻 LocalExpress10.821s (~)11.022s (~)0.200s31.01x
🌐 MongoDBNext.js (Turbopack)12.275s (~)13.021s (~)0.746s31.14x
🐘 PostgresNitro20.298s (~)21.061s (~)0.763s21.89x
🐘 PostgresExpress20.438s (+1.0%)21.056s (~)0.619s21.91x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.453s (+2.1%)20.661s (+4.8%)1.208s21.00x
▲ VercelNext.js (Turbopack)19.520s (+1.0%)20.949s (-1.2%)1.429s21.00x
▲ VercelNitro19.598s (+4.2%)20.245s (-1.7%)0.648s21.01x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.968s (~)27.052s (~)0.084s31.00x
💻 LocalNext.js (Turbopack)27.202s (~)28.051s (~)0.849s31.01x
💻 LocalNitro27.466s (~)28.049s (~)0.583s31.02x
💻 LocalExpress27.495s (~)28.051s (~)0.556s31.02x
🌐 MongoDBNext.js (Turbopack)30.477s (+0.5%)31.038s (~)0.561s21.13x
🐘 PostgresExpress50.233s (-0.5%)51.128s (~)0.895s21.86x
🐘 PostgresNitro50.309s (~)50.626s (-1.0%)0.318s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)48.800s (+3.8%)50.099s (+4.7%)1.299s21.00x
▲ VercelNitro50.597s (+8.0% 🔺)51.906s (+7.6% 🔺)1.309s21.04x
▲ VercelExpress51.275s (+10.9% 🔺)52.177s (+11.1% 🔺)0.903s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.371s (~)55.100s (~)0.729s21.00x
💻 LocalNext.js (Turbopack)56.953s (~)57.105s (~)0.152s21.05x
💻 LocalNitro57.278s (~)58.100s (~)0.822s21.05x
💻 LocalExpress57.336s (~)58.102s (~)0.766s21.05x
🌐 MongoDBNext.js (Turbopack)61.116s (+0.7%)61.576s (+0.9%)0.460s21.12x
🐘 PostgresExpress79.580s (-20.5% 🟢)80.178s (-20.0% 🟢)0.598s21.46x
🐘 PostgresNitro100.195s (~)100.236s (-1.0%)0.041s11.84x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express97.478s (+0.8%)98.523s (+0.5%)1.045s11.00x
▲ VercelNitro98.857s (+2.0%)100.171s (+2.8%)1.314s11.01x
▲ VercelNext.js (Turbopack)104.292s (+5.7% 🔺)105.129s (+6.2% 🔺)0.837s11.07x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.241s (~)2.006s (~)0.765s151.00x
💻 LocalNitro1.406s (-0.8%)2.006s (~)0.599s151.13x
💻 LocalExpress1.410s (~)2.005s (~)0.596s151.14x
💻 LocalNext.js (Turbopack)1.419s (+1.4%)2.006s (~)0.586s151.14x
🌐 MongoDBNext.js (Turbopack)2.168s (~)3.008s (~)0.840s101.75x
🐘 PostgresNitro2.182s (-9.5% 🟢)3.014s (~)0.833s101.76x
🐘 PostgresExpress2.233s (+3.2%)2.596s (-13.9% 🟢)0.363s121.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.807s (+4.5%)3.681s (+6.5% 🔺)0.874s91.00x
▲ VercelNext.js (Turbopack)3.014s (+2.9%)4.310s (+7.5% 🔺)1.296s81.07x
▲ VercelNitro3.569s (+34.5% 🔺)4.444s (+16.9% 🔺)0.874s71.27x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.513s (~)3.008s (~)0.495s101.00x
💻 LocalNitro2.599s (-0.8%)3.007s (~)0.408s101.03x
💻 LocalExpress2.635s (+2.2%)3.007s (~)0.372s101.05x
💻 LocalNext.js (Turbopack)2.705s (+5.2% 🔺)3.007s (~)0.302s101.08x
🌐 MongoDBNext.js (Turbopack)4.734s (-0.9%)5.177s (~)0.443s61.88x
🐘 PostgresNitro8.542s (-3.7%)9.043s (-2.6%)0.501s43.40x
🐘 PostgresExpress10.213s (+20.2% 🔺)10.698s (+18.3% 🔺)0.485s34.06x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.038s (-3.4%)4.161s (-0.9%)1.124s81.00x
▲ VercelNitro3.270s (-19.7% 🟢)4.475s (-19.5% 🟢)1.205s71.08x
▲ VercelNext.js (Turbopack)3.982s (+16.6% 🔺)5.435s (+21.6% 🔺)1.452s61.31x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.116s (+1.5%)4.868s (+3.0%)0.751s71.00x
💻 LocalNext.js (Turbopack)7.175s (~)7.766s (+2.0%)0.590s41.74x
💻 LocalNitro7.456s (-2.9%)8.021s (~)0.564s41.81x
💻 LocalExpress7.622s (+2.6%)8.019s (~)0.397s41.85x
🌐 MongoDBNext.js (Turbopack)9.837s (+1.2%)10.349s (~)0.512s32.39x
🐘 PostgresNitro49.785s (+6.5% 🔺)50.124s (+6.4% 🔺)0.339s112.09x
🐘 PostgresExpress50.464s (+10.3% 🔺)51.121s (+10.9% 🔺)0.657s112.26x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.460s (-12.5% 🟢)4.682s (-8.0% 🟢)1.223s71.00x
▲ VercelExpress3.921s (+21.7% 🔺)5.187s (+6.3% 🔺)1.265s61.13x
▲ VercelNext.js (Turbopack)3.997s (+6.3% 🔺)5.343s (+4.1%)1.346s61.16x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.264s (~)2.006s (~)0.742s151.00x
💻 LocalNext.js (Turbopack)1.428s (~)2.005s (~)0.577s151.13x
💻 LocalExpress1.439s (+1.4%)2.004s (~)0.565s151.14x
💻 LocalNitro1.440s (-1.5%)2.006s (~)0.566s151.14x
🐘 PostgresNitro2.137s (-5.2% 🟢)2.513s (-14.0% 🟢)0.376s121.69x
🌐 MongoDBNext.js (Turbopack)2.155s (-1.1%)3.009s (~)0.854s101.70x
🐘 PostgresExpress2.221s (-5.3% 🟢)2.512s (-16.6% 🟢)0.291s121.76x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.510s (-4.9%)3.456s (+1.9%)0.946s91.00x
▲ VercelExpress2.720s (+11.2% 🔺)3.578s (+3.6%)0.858s91.08x
▲ VercelNitro2.792s (+14.2% 🔺)4.239s (+17.8% 🔺)1.447s81.11x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.508s (~)3.008s (~)0.500s101.00x
💻 LocalNitro2.701s (-1.7%)3.007s (~)0.306s101.08x
💻 LocalExpress2.729s (+3.1%)3.007s (~)0.278s101.09x
💻 LocalNext.js (Turbopack)2.837s (+5.8% 🔺)3.007s (~)0.171s101.13x
🌐 MongoDBNext.js (Turbopack)4.806s (~)5.177s (~)0.372s61.92x
🐘 PostgresNitro11.404s (+47.4% 🔺)11.705s (+41.4% 🔺)0.301s34.55x
🐘 PostgresExpress12.784s (+22.5% 🔺)13.032s (+18.1% 🔺)0.248s35.10x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.883s (-24.3% 🟢)4.226s (-19.5% 🟢)1.343s81.00x
▲ VercelExpress2.954s (+11.4% 🔺)3.834s (+7.2% 🔺)0.880s81.02x
▲ VercelNext.js (Turbopack)3.008s (-3.1%)4.370s (-1.0%)1.362s71.04x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.136s (~)4.868s (~)0.732s71.00x
💻 LocalNext.js (Turbopack)7.242s (-5.0%)7.766s (-8.8% 🟢)0.525s41.75x
💻 LocalNitro7.944s (-1.2%)8.269s (-5.7% 🟢)0.325s41.92x
💻 LocalExpress8.083s (+3.4%)9.023s (+12.5% 🔺)0.939s41.95x
🌐 MongoDBNext.js (Turbopack)9.944s (~)10.684s (+3.3%)0.740s32.40x
🐘 PostgresNitro52.383s (+14.5% 🔺)53.118s (+15.2% 🔺)0.735s112.66x
🐘 PostgresExpress53.132s (+1.3%)54.116s (+1.8%)0.984s112.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.058s (-25.8% 🟢)3.931s (-24.6% 🟢)0.874s81.00x
▲ VercelNext.js (Turbopack)4.041s (-2.4%)5.520s (-1.5%)1.479s61.32x
▲ VercelNitro4.841s (+55.5% 🔺)6.079s (+33.8% 🔺)1.239s61.58x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.147s (-2.1%)1.001s (~)0.011s (+12.9% 🔺)1.017s (~)0.870s101.00x
🌐 RedisNext.js (Turbopack)0.150s (-2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.02x
💻 LocalNitro0.168s (-3.7%)1.002s (~)0.011s (-1.8%)1.016s (~)0.848s101.15x
💻 LocalExpress0.175s (+3.7%)1.003s (~)0.011s (-3.4%)1.017s (~)0.841s101.19x
🌐 MongoDBNext.js (Turbopack)0.504s (+5.6% 🔺)0.943s (-2.5%)0.002s (+14.3% 🔺)1.008s (~)0.505s103.43x
🐘 PostgresExpress1.408s (-38.2% 🟢)1.626s (-41.2% 🟢)0.001s (-13.3% 🟢)2.013s (-33.3% 🟢)0.604s109.58x
🐘 PostgresNitro2.290s (-7.2% 🟢)2.754s (+6.9% 🔺)0.001s (+8.3% 🔺)3.016s (~)0.726s1015.58x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.434s (+3.3%)2.752s (-3.2%)0.238s (+27.2% 🔺)3.633s (~)1.198s101.00x
▲ VercelExpress2.444s (+5.3% 🔺)2.720s (+0.6%)0.284s (+40.6% 🔺)3.690s (+5.2% 🔺)1.246s101.00x
▲ VercelNext.js (Turbopack)2.578s (+7.5% 🔺)3.116s (+1.6%)0.178s (-35.5% 🟢)4.055s (+2.9%)1.478s101.06x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro7/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local10/12
Next.js (Turbopack)🌐 Redis6/12
Nitro💻 Local10/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

github-actionsBot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production501038539
✅ 💻 Local Development428062490
✅ 📦 Local Production428062490
✅ 🐘 Local Postgres428062490
✅ 🪟 Windows460349
❌ 🌍 Community Worlds104439156
✅ 📋 Other126021147
Total2061432572361

❌ Failed Tests

🌍 Community Worlds (43 failed)

mongodb (1 failed):

  • webhookWorkflow

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
AppPassedFailedSkipped
✅ astro4504
✅ example4504
✅ express4504
✅ fastify4504
✅ hono4504
✅ nextjs-turbopack4801
✅ nextjs-webpack4801
✅ nitro4504
✅ nuxt4504
✅ sveltekit4504
✅ vite4504
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4603
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4513
✅ redis-dev300
✅ redis4603
✅ turso-dev300
❌ turso4423
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4207
✅ e2e-local-postgres-nest-stable4207
✅ e2e-local-prod-nest-stable4207

📋 View full workflow run

CopilotAI 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.

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.

FileDescription
packages/core/src/runtime/step-handler.tsWrap step lifecycle event creation with 5xx retry; add logic to rethrow persistent 5xx to defer to queue retry.
packages/core/src/runtime/helpers.tsIntroduce withServerErrorRetry with 3 retries and exponential backoff for 5xx WorkflowAPIErrors.
.changeset/retry-5xx-step-handler.mdPatch 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 threadpackages/core/src/runtime/step-handler.ts Outdated
Comment threadpackages/core/src/runtime/helpers.ts Outdated
Comment on lines +120 to +126
const startResult = await withServerErrorRetry(() =>
world.events.create(workflowRunId, {
eventType: 'step_started',
specVersion: SPEC_VERSION_CURRENT,
correlationId: stepId,
})
);

CopilotAIFeb 11, 2026

Copy link

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
Copy Markdown
ContributorAuthor

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
@vercel

vercelBot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

@VaguelySeriousVaguelySerious left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

Comment threadpackages/core/src/runtime/step-handler.ts
Comment threadpackages/world-vercel/src/queue.ts Outdated
};
}
// Wrap VQS server errors as WorkflowAPIError so withServerErrorRetry can catch them
if (error instanceof InternalServerError) {

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.

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

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

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
pranaygpand others added 6 commits February 12, 2026 16:45
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
VQS throws its own error types (InternalServerError, ConsumerDiscoveryError,
ConsumerRegistryNotConfiguredError) that don't match WorkflowAPIError.is().
Wrapping them at the world-vercel boundary enables withServerErrorRetry in
queueMessage() to automatically retry transient queue failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Queue retrying will be handled natively by the @vercel/queue client
instead. Reverts VQS error wrapping and withServerErrorRetry in
queueMessage().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

4 participants

@pranaygp@ctgowrie@VaguelySerious
, '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

Retry 5xx errors from workflow-server in step handler - #1011

Merged
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx
Feb 13, 2026
Merged

Retry 5xx errors from workflow-server in step handler#1011
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx

Conversation

@pranaygp

@pranaygppranaygp commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

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.

read on:

AI

Summary

  • Add withServerErrorRetry helper that retries world calls on 5xx errors 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

Extends the 5xx retry behavior from #966 to the step handler. The key insight: transient workflow-server errors should be retried silently without consuming step attempts, while persistent errors bubble to the queue for higher-level retry.

Tests added

  • Unit tests (helpers.test.ts): 26 tests covering getWorkflowQueueName (10 tests), withServerErrorRetry (7 tests) and withThrottleRetry (9 tests) — success passthrough, retry on 5xx with exponential backoff, retry exhaustion, non-retryable error passthrough, short/long retryAfter handling, double-throttle deferral, and default retryAfter behavior
  • 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
  • Unit tests: pnpm vitest run packages/core/src/runtime/helpers.test.ts — 26 tests pass
  • E2E test: serverError5xxRetryWorkflow passes locally against nextjs-turbopack dev server
  • CI e2e tests pass

🤖 Generated with Claude Code

CopilotAI review requested due to automatic review settings February 11, 2026 23:53
@changeset-bot

changeset-botBot commented Feb 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 87a0c91

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

This PR includes changesets to release 14 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 11, 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🥇 Nitro0.032s (-1.9%)1.005s (~)0.973s101.00x
💻 LocalExpress0.032s (+0.9%)1.005s (~)0.973s101.01x
💻 LocalNext.js (Turbopack)0.040s (-6.4% 🟢)1.005s (~)0.965s101.25x
🌐 RedisNext.js (Turbopack)0.050s (+9.2% 🔺)1.005s (~)0.955s101.58x
🌐 MongoDBNext.js (Turbopack)0.087s (-7.9% 🟢)1.008s (~)0.921s102.74x
🐘 PostgresExpress0.170s (-63.5% 🟢)1.009s (-1.0%)0.839s105.39x
🐘 PostgresNitro0.216s (+74.9% 🔺)1.011s (~)0.795s106.83x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.732s (+12.1% 🔺)2.012s (+4.9%)1.280s101.00x
▲ VercelNext.js (Turbopack)0.895s (+46.6% 🔺)2.300s (+24.4% 🔺)1.404s101.22x
▲ VercelNitro1.720s (+175.8% 🔺)2.964s (+46.7% 🔺)1.244s102.35x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.099s (-1.1%)2.006s (~)0.906s101.00x
💻 LocalExpress1.104s (~)2.006s (~)0.902s101.00x
💻 LocalNitro1.105s (~)2.006s (~)0.901s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🌐 MongoDBNext.js (Turbopack)1.308s (+1.0%)2.008s (~)0.700s101.19x
🐘 PostgresExpress2.205s (-7.5% 🟢)3.014s (~)0.809s102.01x
🐘 PostgresNitro2.432s (+1.0%)3.015s (~)0.582s102.21x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.506s (~)3.483s (-1.5%)0.977s101.00x
▲ VercelExpress2.621s (+2.2%)3.497s (~)0.876s101.05x
▲ VercelNitro2.988s (~)3.870s (-2.3%)0.882s101.19x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.723s (~)11.023s (~)0.301s31.00x
🌐 RedisNext.js (Turbopack)10.739s (~)11.023s (~)0.284s31.00x
💻 LocalNitro10.816s (~)11.023s (~)0.206s31.01x
💻 LocalExpress10.821s (~)11.022s (~)0.200s31.01x
🌐 MongoDBNext.js (Turbopack)12.275s (~)13.021s (~)0.746s31.14x
🐘 PostgresNitro20.298s (~)21.061s (~)0.763s21.89x
🐘 PostgresExpress20.438s (+1.0%)21.056s (~)0.619s21.91x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.453s (+2.1%)20.661s (+4.8%)1.208s21.00x
▲ VercelNext.js (Turbopack)19.520s (+1.0%)20.949s (-1.2%)1.429s21.00x
▲ VercelNitro19.598s (+4.2%)20.245s (-1.7%)0.648s21.01x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.968s (~)27.052s (~)0.084s31.00x
💻 LocalNext.js (Turbopack)27.202s (~)28.051s (~)0.849s31.01x
💻 LocalNitro27.466s (~)28.049s (~)0.583s31.02x
💻 LocalExpress27.495s (~)28.051s (~)0.556s31.02x
🌐 MongoDBNext.js (Turbopack)30.477s (+0.5%)31.038s (~)0.561s21.13x
🐘 PostgresExpress50.233s (-0.5%)51.128s (~)0.895s21.86x
🐘 PostgresNitro50.309s (~)50.626s (-1.0%)0.318s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)48.800s (+3.8%)50.099s (+4.7%)1.299s21.00x
▲ VercelNitro50.597s (+8.0% 🔺)51.906s (+7.6% 🔺)1.309s21.04x
▲ VercelExpress51.275s (+10.9% 🔺)52.177s (+11.1% 🔺)0.903s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.371s (~)55.100s (~)0.729s21.00x
💻 LocalNext.js (Turbopack)56.953s (~)57.105s (~)0.152s21.05x
💻 LocalNitro57.278s (~)58.100s (~)0.822s21.05x
💻 LocalExpress57.336s (~)58.102s (~)0.766s21.05x
🌐 MongoDBNext.js (Turbopack)61.116s (+0.7%)61.576s (+0.9%)0.460s21.12x
🐘 PostgresExpress79.580s (-20.5% 🟢)80.178s (-20.0% 🟢)0.598s21.46x
🐘 PostgresNitro100.195s (~)100.236s (-1.0%)0.041s11.84x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express97.478s (+0.8%)98.523s (+0.5%)1.045s11.00x
▲ VercelNitro98.857s (+2.0%)100.171s (+2.8%)1.314s11.01x
▲ VercelNext.js (Turbopack)104.292s (+5.7% 🔺)105.129s (+6.2% 🔺)0.837s11.07x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.241s (~)2.006s (~)0.765s151.00x
💻 LocalNitro1.406s (-0.8%)2.006s (~)0.599s151.13x
💻 LocalExpress1.410s (~)2.005s (~)0.596s151.14x
💻 LocalNext.js (Turbopack)1.419s (+1.4%)2.006s (~)0.586s151.14x
🌐 MongoDBNext.js (Turbopack)2.168s (~)3.008s (~)0.840s101.75x
🐘 PostgresNitro2.182s (-9.5% 🟢)3.014s (~)0.833s101.76x
🐘 PostgresExpress2.233s (+3.2%)2.596s (-13.9% 🟢)0.363s121.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.807s (+4.5%)3.681s (+6.5% 🔺)0.874s91.00x
▲ VercelNext.js (Turbopack)3.014s (+2.9%)4.310s (+7.5% 🔺)1.296s81.07x
▲ VercelNitro3.569s (+34.5% 🔺)4.444s (+16.9% 🔺)0.874s71.27x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.513s (~)3.008s (~)0.495s101.00x
💻 LocalNitro2.599s (-0.8%)3.007s (~)0.408s101.03x
💻 LocalExpress2.635s (+2.2%)3.007s (~)0.372s101.05x
💻 LocalNext.js (Turbopack)2.705s (+5.2% 🔺)3.007s (~)0.302s101.08x
🌐 MongoDBNext.js (Turbopack)4.734s (-0.9%)5.177s (~)0.443s61.88x
🐘 PostgresNitro8.542s (-3.7%)9.043s (-2.6%)0.501s43.40x
🐘 PostgresExpress10.213s (+20.2% 🔺)10.698s (+18.3% 🔺)0.485s34.06x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.038s (-3.4%)4.161s (-0.9%)1.124s81.00x
▲ VercelNitro3.270s (-19.7% 🟢)4.475s (-19.5% 🟢)1.205s71.08x
▲ VercelNext.js (Turbopack)3.982s (+16.6% 🔺)5.435s (+21.6% 🔺)1.452s61.31x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.116s (+1.5%)4.868s (+3.0%)0.751s71.00x
💻 LocalNext.js (Turbopack)7.175s (~)7.766s (+2.0%)0.590s41.74x
💻 LocalNitro7.456s (-2.9%)8.021s (~)0.564s41.81x
💻 LocalExpress7.622s (+2.6%)8.019s (~)0.397s41.85x
🌐 MongoDBNext.js (Turbopack)9.837s (+1.2%)10.349s (~)0.512s32.39x
🐘 PostgresNitro49.785s (+6.5% 🔺)50.124s (+6.4% 🔺)0.339s112.09x
🐘 PostgresExpress50.464s (+10.3% 🔺)51.121s (+10.9% 🔺)0.657s112.26x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.460s (-12.5% 🟢)4.682s (-8.0% 🟢)1.223s71.00x
▲ VercelExpress3.921s (+21.7% 🔺)5.187s (+6.3% 🔺)1.265s61.13x
▲ VercelNext.js (Turbopack)3.997s (+6.3% 🔺)5.343s (+4.1%)1.346s61.16x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.264s (~)2.006s (~)0.742s151.00x
💻 LocalNext.js (Turbopack)1.428s (~)2.005s (~)0.577s151.13x
💻 LocalExpress1.439s (+1.4%)2.004s (~)0.565s151.14x
💻 LocalNitro1.440s (-1.5%)2.006s (~)0.566s151.14x
🐘 PostgresNitro2.137s (-5.2% 🟢)2.513s (-14.0% 🟢)0.376s121.69x
🌐 MongoDBNext.js (Turbopack)2.155s (-1.1%)3.009s (~)0.854s101.70x
🐘 PostgresExpress2.221s (-5.3% 🟢)2.512s (-16.6% 🟢)0.291s121.76x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.510s (-4.9%)3.456s (+1.9%)0.946s91.00x
▲ VercelExpress2.720s (+11.2% 🔺)3.578s (+3.6%)0.858s91.08x
▲ VercelNitro2.792s (+14.2% 🔺)4.239s (+17.8% 🔺)1.447s81.11x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.508s (~)3.008s (~)0.500s101.00x
💻 LocalNitro2.701s (-1.7%)3.007s (~)0.306s101.08x
💻 LocalExpress2.729s (+3.1%)3.007s (~)0.278s101.09x
💻 LocalNext.js (Turbopack)2.837s (+5.8% 🔺)3.007s (~)0.171s101.13x
🌐 MongoDBNext.js (Turbopack)4.806s (~)5.177s (~)0.372s61.92x
🐘 PostgresNitro11.404s (+47.4% 🔺)11.705s (+41.4% 🔺)0.301s34.55x
🐘 PostgresExpress12.784s (+22.5% 🔺)13.032s (+18.1% 🔺)0.248s35.10x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.883s (-24.3% 🟢)4.226s (-19.5% 🟢)1.343s81.00x
▲ VercelExpress2.954s (+11.4% 🔺)3.834s (+7.2% 🔺)0.880s81.02x
▲ VercelNext.js (Turbopack)3.008s (-3.1%)4.370s (-1.0%)1.362s71.04x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.136s (~)4.868s (~)0.732s71.00x
💻 LocalNext.js (Turbopack)7.242s (-5.0%)7.766s (-8.8% 🟢)0.525s41.75x
💻 LocalNitro7.944s (-1.2%)8.269s (-5.7% 🟢)0.325s41.92x
💻 LocalExpress8.083s (+3.4%)9.023s (+12.5% 🔺)0.939s41.95x
🌐 MongoDBNext.js (Turbopack)9.944s (~)10.684s (+3.3%)0.740s32.40x
🐘 PostgresNitro52.383s (+14.5% 🔺)53.118s (+15.2% 🔺)0.735s112.66x
🐘 PostgresExpress53.132s (+1.3%)54.116s (+1.8%)0.984s112.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.058s (-25.8% 🟢)3.931s (-24.6% 🟢)0.874s81.00x
▲ VercelNext.js (Turbopack)4.041s (-2.4%)5.520s (-1.5%)1.479s61.32x
▲ VercelNitro4.841s (+55.5% 🔺)6.079s (+33.8% 🔺)1.239s61.58x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.147s (-2.1%)1.001s (~)0.011s (+12.9% 🔺)1.017s (~)0.870s101.00x
🌐 RedisNext.js (Turbopack)0.150s (-2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.02x
💻 LocalNitro0.168s (-3.7%)1.002s (~)0.011s (-1.8%)1.016s (~)0.848s101.15x
💻 LocalExpress0.175s (+3.7%)1.003s (~)0.011s (-3.4%)1.017s (~)0.841s101.19x
🌐 MongoDBNext.js (Turbopack)0.504s (+5.6% 🔺)0.943s (-2.5%)0.002s (+14.3% 🔺)1.008s (~)0.505s103.43x
🐘 PostgresExpress1.408s (-38.2% 🟢)1.626s (-41.2% 🟢)0.001s (-13.3% 🟢)2.013s (-33.3% 🟢)0.604s109.58x
🐘 PostgresNitro2.290s (-7.2% 🟢)2.754s (+6.9% 🔺)0.001s (+8.3% 🔺)3.016s (~)0.726s1015.58x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.434s (+3.3%)2.752s (-3.2%)0.238s (+27.2% 🔺)3.633s (~)1.198s101.00x
▲ VercelExpress2.444s (+5.3% 🔺)2.720s (+0.6%)0.284s (+40.6% 🔺)3.690s (+5.2% 🔺)1.246s101.00x
▲ VercelNext.js (Turbopack)2.578s (+7.5% 🔺)3.116s (+1.6%)0.178s (-35.5% 🟢)4.055s (+2.9%)1.478s101.06x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro7/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local10/12
Next.js (Turbopack)🌐 Redis6/12
Nitro💻 Local10/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

github-actionsBot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production501038539
✅ 💻 Local Development428062490
✅ 📦 Local Production428062490
✅ 🐘 Local Postgres428062490
✅ 🪟 Windows460349
❌ 🌍 Community Worlds104439156
✅ 📋 Other126021147
Total2061432572361

❌ Failed Tests

🌍 Community Worlds (43 failed)

mongodb (1 failed):

  • webhookWorkflow

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
AppPassedFailedSkipped
✅ astro4504
✅ example4504
✅ express4504
✅ fastify4504
✅ hono4504
✅ nextjs-turbopack4801
✅ nextjs-webpack4801
✅ nitro4504
✅ nuxt4504
✅ sveltekit4504
✅ vite4504
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4603
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4513
✅ redis-dev300
✅ redis4603
✅ turso-dev300
❌ turso4423
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4207
✅ e2e-local-postgres-nest-stable4207
✅ e2e-local-prod-nest-stable4207

📋 View full workflow run

CopilotAI 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.

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.

FileDescription
packages/core/src/runtime/step-handler.tsWrap step lifecycle event creation with 5xx retry; add logic to rethrow persistent 5xx to defer to queue retry.
packages/core/src/runtime/helpers.tsIntroduce withServerErrorRetry with 3 retries and exponential backoff for 5xx WorkflowAPIErrors.
.changeset/retry-5xx-step-handler.mdPatch 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 threadpackages/core/src/runtime/step-handler.ts Outdated
Comment threadpackages/core/src/runtime/helpers.ts Outdated
Comment on lines +120 to +126
const startResult = await withServerErrorRetry(() =>
world.events.create(workflowRunId, {
eventType: 'step_started',
specVersion: SPEC_VERSION_CURRENT,
correlationId: stepId,
})
);

CopilotAIFeb 11, 2026

Copy link

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
Copy Markdown
ContributorAuthor

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
@vercel

vercelBot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

@VaguelySeriousVaguelySerious left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

Comment threadpackages/core/src/runtime/step-handler.ts
Comment threadpackages/world-vercel/src/queue.ts Outdated
};
}
// Wrap VQS server errors as WorkflowAPIError so withServerErrorRetry can catch them
if (error instanceof InternalServerError) {

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.

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

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

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
pranaygpand others added 6 commits February 12, 2026 16:45
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
VQS throws its own error types (InternalServerError, ConsumerDiscoveryError,
ConsumerRegistryNotConfiguredError) that don't match WorkflowAPIError.is().
Wrapping them at the world-vercel boundary enables withServerErrorRetry in
queueMessage() to automatically retry transient queue failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Queue retrying will be handled natively by the @vercel/queue client
instead. Reverts VQS error wrapping and withServerErrorRetry in
queueMessage().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

4 participants

@pranaygp@ctgowrie@VaguelySerious
, '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

Retry 5xx errors from workflow-server in step handler - #1011

Merged
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx
Feb 13, 2026
Merged

Retry 5xx errors from workflow-server in step handler#1011
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx

Conversation

@pranaygp

@pranaygppranaygp commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

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.

read on:

AI

Summary

  • Add withServerErrorRetry helper that retries world calls on 5xx errors 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

Extends the 5xx retry behavior from #966 to the step handler. The key insight: transient workflow-server errors should be retried silently without consuming step attempts, while persistent errors bubble to the queue for higher-level retry.

Tests added

  • Unit tests (helpers.test.ts): 26 tests covering getWorkflowQueueName (10 tests), withServerErrorRetry (7 tests) and withThrottleRetry (9 tests) — success passthrough, retry on 5xx with exponential backoff, retry exhaustion, non-retryable error passthrough, short/long retryAfter handling, double-throttle deferral, and default retryAfter behavior
  • 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
  • Unit tests: pnpm vitest run packages/core/src/runtime/helpers.test.ts — 26 tests pass
  • E2E test: serverError5xxRetryWorkflow passes locally against nextjs-turbopack dev server
  • CI e2e tests pass

🤖 Generated with Claude Code

CopilotAI review requested due to automatic review settings February 11, 2026 23:53
@changeset-bot

changeset-botBot commented Feb 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 87a0c91

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

This PR includes changesets to release 14 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 11, 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🥇 Nitro0.032s (-1.9%)1.005s (~)0.973s101.00x
💻 LocalExpress0.032s (+0.9%)1.005s (~)0.973s101.01x
💻 LocalNext.js (Turbopack)0.040s (-6.4% 🟢)1.005s (~)0.965s101.25x
🌐 RedisNext.js (Turbopack)0.050s (+9.2% 🔺)1.005s (~)0.955s101.58x
🌐 MongoDBNext.js (Turbopack)0.087s (-7.9% 🟢)1.008s (~)0.921s102.74x
🐘 PostgresExpress0.170s (-63.5% 🟢)1.009s (-1.0%)0.839s105.39x
🐘 PostgresNitro0.216s (+74.9% 🔺)1.011s (~)0.795s106.83x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.732s (+12.1% 🔺)2.012s (+4.9%)1.280s101.00x
▲ VercelNext.js (Turbopack)0.895s (+46.6% 🔺)2.300s (+24.4% 🔺)1.404s101.22x
▲ VercelNitro1.720s (+175.8% 🔺)2.964s (+46.7% 🔺)1.244s102.35x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.099s (-1.1%)2.006s (~)0.906s101.00x
💻 LocalExpress1.104s (~)2.006s (~)0.902s101.00x
💻 LocalNitro1.105s (~)2.006s (~)0.901s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🌐 MongoDBNext.js (Turbopack)1.308s (+1.0%)2.008s (~)0.700s101.19x
🐘 PostgresExpress2.205s (-7.5% 🟢)3.014s (~)0.809s102.01x
🐘 PostgresNitro2.432s (+1.0%)3.015s (~)0.582s102.21x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.506s (~)3.483s (-1.5%)0.977s101.00x
▲ VercelExpress2.621s (+2.2%)3.497s (~)0.876s101.05x
▲ VercelNitro2.988s (~)3.870s (-2.3%)0.882s101.19x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.723s (~)11.023s (~)0.301s31.00x
🌐 RedisNext.js (Turbopack)10.739s (~)11.023s (~)0.284s31.00x
💻 LocalNitro10.816s (~)11.023s (~)0.206s31.01x
💻 LocalExpress10.821s (~)11.022s (~)0.200s31.01x
🌐 MongoDBNext.js (Turbopack)12.275s (~)13.021s (~)0.746s31.14x
🐘 PostgresNitro20.298s (~)21.061s (~)0.763s21.89x
🐘 PostgresExpress20.438s (+1.0%)21.056s (~)0.619s21.91x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.453s (+2.1%)20.661s (+4.8%)1.208s21.00x
▲ VercelNext.js (Turbopack)19.520s (+1.0%)20.949s (-1.2%)1.429s21.00x
▲ VercelNitro19.598s (+4.2%)20.245s (-1.7%)0.648s21.01x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.968s (~)27.052s (~)0.084s31.00x
💻 LocalNext.js (Turbopack)27.202s (~)28.051s (~)0.849s31.01x
💻 LocalNitro27.466s (~)28.049s (~)0.583s31.02x
💻 LocalExpress27.495s (~)28.051s (~)0.556s31.02x
🌐 MongoDBNext.js (Turbopack)30.477s (+0.5%)31.038s (~)0.561s21.13x
🐘 PostgresExpress50.233s (-0.5%)51.128s (~)0.895s21.86x
🐘 PostgresNitro50.309s (~)50.626s (-1.0%)0.318s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)48.800s (+3.8%)50.099s (+4.7%)1.299s21.00x
▲ VercelNitro50.597s (+8.0% 🔺)51.906s (+7.6% 🔺)1.309s21.04x
▲ VercelExpress51.275s (+10.9% 🔺)52.177s (+11.1% 🔺)0.903s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.371s (~)55.100s (~)0.729s21.00x
💻 LocalNext.js (Turbopack)56.953s (~)57.105s (~)0.152s21.05x
💻 LocalNitro57.278s (~)58.100s (~)0.822s21.05x
💻 LocalExpress57.336s (~)58.102s (~)0.766s21.05x
🌐 MongoDBNext.js (Turbopack)61.116s (+0.7%)61.576s (+0.9%)0.460s21.12x
🐘 PostgresExpress79.580s (-20.5% 🟢)80.178s (-20.0% 🟢)0.598s21.46x
🐘 PostgresNitro100.195s (~)100.236s (-1.0%)0.041s11.84x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express97.478s (+0.8%)98.523s (+0.5%)1.045s11.00x
▲ VercelNitro98.857s (+2.0%)100.171s (+2.8%)1.314s11.01x
▲ VercelNext.js (Turbopack)104.292s (+5.7% 🔺)105.129s (+6.2% 🔺)0.837s11.07x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.241s (~)2.006s (~)0.765s151.00x
💻 LocalNitro1.406s (-0.8%)2.006s (~)0.599s151.13x
💻 LocalExpress1.410s (~)2.005s (~)0.596s151.14x
💻 LocalNext.js (Turbopack)1.419s (+1.4%)2.006s (~)0.586s151.14x
🌐 MongoDBNext.js (Turbopack)2.168s (~)3.008s (~)0.840s101.75x
🐘 PostgresNitro2.182s (-9.5% 🟢)3.014s (~)0.833s101.76x
🐘 PostgresExpress2.233s (+3.2%)2.596s (-13.9% 🟢)0.363s121.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.807s (+4.5%)3.681s (+6.5% 🔺)0.874s91.00x
▲ VercelNext.js (Turbopack)3.014s (+2.9%)4.310s (+7.5% 🔺)1.296s81.07x
▲ VercelNitro3.569s (+34.5% 🔺)4.444s (+16.9% 🔺)0.874s71.27x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.513s (~)3.008s (~)0.495s101.00x
💻 LocalNitro2.599s (-0.8%)3.007s (~)0.408s101.03x
💻 LocalExpress2.635s (+2.2%)3.007s (~)0.372s101.05x
💻 LocalNext.js (Turbopack)2.705s (+5.2% 🔺)3.007s (~)0.302s101.08x
🌐 MongoDBNext.js (Turbopack)4.734s (-0.9%)5.177s (~)0.443s61.88x
🐘 PostgresNitro8.542s (-3.7%)9.043s (-2.6%)0.501s43.40x
🐘 PostgresExpress10.213s (+20.2% 🔺)10.698s (+18.3% 🔺)0.485s34.06x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.038s (-3.4%)4.161s (-0.9%)1.124s81.00x
▲ VercelNitro3.270s (-19.7% 🟢)4.475s (-19.5% 🟢)1.205s71.08x
▲ VercelNext.js (Turbopack)3.982s (+16.6% 🔺)5.435s (+21.6% 🔺)1.452s61.31x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.116s (+1.5%)4.868s (+3.0%)0.751s71.00x
💻 LocalNext.js (Turbopack)7.175s (~)7.766s (+2.0%)0.590s41.74x
💻 LocalNitro7.456s (-2.9%)8.021s (~)0.564s41.81x
💻 LocalExpress7.622s (+2.6%)8.019s (~)0.397s41.85x
🌐 MongoDBNext.js (Turbopack)9.837s (+1.2%)10.349s (~)0.512s32.39x
🐘 PostgresNitro49.785s (+6.5% 🔺)50.124s (+6.4% 🔺)0.339s112.09x
🐘 PostgresExpress50.464s (+10.3% 🔺)51.121s (+10.9% 🔺)0.657s112.26x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.460s (-12.5% 🟢)4.682s (-8.0% 🟢)1.223s71.00x
▲ VercelExpress3.921s (+21.7% 🔺)5.187s (+6.3% 🔺)1.265s61.13x
▲ VercelNext.js (Turbopack)3.997s (+6.3% 🔺)5.343s (+4.1%)1.346s61.16x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.264s (~)2.006s (~)0.742s151.00x
💻 LocalNext.js (Turbopack)1.428s (~)2.005s (~)0.577s151.13x
💻 LocalExpress1.439s (+1.4%)2.004s (~)0.565s151.14x
💻 LocalNitro1.440s (-1.5%)2.006s (~)0.566s151.14x
🐘 PostgresNitro2.137s (-5.2% 🟢)2.513s (-14.0% 🟢)0.376s121.69x
🌐 MongoDBNext.js (Turbopack)2.155s (-1.1%)3.009s (~)0.854s101.70x
🐘 PostgresExpress2.221s (-5.3% 🟢)2.512s (-16.6% 🟢)0.291s121.76x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.510s (-4.9%)3.456s (+1.9%)0.946s91.00x
▲ VercelExpress2.720s (+11.2% 🔺)3.578s (+3.6%)0.858s91.08x
▲ VercelNitro2.792s (+14.2% 🔺)4.239s (+17.8% 🔺)1.447s81.11x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.508s (~)3.008s (~)0.500s101.00x
💻 LocalNitro2.701s (-1.7%)3.007s (~)0.306s101.08x
💻 LocalExpress2.729s (+3.1%)3.007s (~)0.278s101.09x
💻 LocalNext.js (Turbopack)2.837s (+5.8% 🔺)3.007s (~)0.171s101.13x
🌐 MongoDBNext.js (Turbopack)4.806s (~)5.177s (~)0.372s61.92x
🐘 PostgresNitro11.404s (+47.4% 🔺)11.705s (+41.4% 🔺)0.301s34.55x
🐘 PostgresExpress12.784s (+22.5% 🔺)13.032s (+18.1% 🔺)0.248s35.10x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.883s (-24.3% 🟢)4.226s (-19.5% 🟢)1.343s81.00x
▲ VercelExpress2.954s (+11.4% 🔺)3.834s (+7.2% 🔺)0.880s81.02x
▲ VercelNext.js (Turbopack)3.008s (-3.1%)4.370s (-1.0%)1.362s71.04x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.136s (~)4.868s (~)0.732s71.00x
💻 LocalNext.js (Turbopack)7.242s (-5.0%)7.766s (-8.8% 🟢)0.525s41.75x
💻 LocalNitro7.944s (-1.2%)8.269s (-5.7% 🟢)0.325s41.92x
💻 LocalExpress8.083s (+3.4%)9.023s (+12.5% 🔺)0.939s41.95x
🌐 MongoDBNext.js (Turbopack)9.944s (~)10.684s (+3.3%)0.740s32.40x
🐘 PostgresNitro52.383s (+14.5% 🔺)53.118s (+15.2% 🔺)0.735s112.66x
🐘 PostgresExpress53.132s (+1.3%)54.116s (+1.8%)0.984s112.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.058s (-25.8% 🟢)3.931s (-24.6% 🟢)0.874s81.00x
▲ VercelNext.js (Turbopack)4.041s (-2.4%)5.520s (-1.5%)1.479s61.32x
▲ VercelNitro4.841s (+55.5% 🔺)6.079s (+33.8% 🔺)1.239s61.58x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.147s (-2.1%)1.001s (~)0.011s (+12.9% 🔺)1.017s (~)0.870s101.00x
🌐 RedisNext.js (Turbopack)0.150s (-2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.02x
💻 LocalNitro0.168s (-3.7%)1.002s (~)0.011s (-1.8%)1.016s (~)0.848s101.15x
💻 LocalExpress0.175s (+3.7%)1.003s (~)0.011s (-3.4%)1.017s (~)0.841s101.19x
🌐 MongoDBNext.js (Turbopack)0.504s (+5.6% 🔺)0.943s (-2.5%)0.002s (+14.3% 🔺)1.008s (~)0.505s103.43x
🐘 PostgresExpress1.408s (-38.2% 🟢)1.626s (-41.2% 🟢)0.001s (-13.3% 🟢)2.013s (-33.3% 🟢)0.604s109.58x
🐘 PostgresNitro2.290s (-7.2% 🟢)2.754s (+6.9% 🔺)0.001s (+8.3% 🔺)3.016s (~)0.726s1015.58x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.434s (+3.3%)2.752s (-3.2%)0.238s (+27.2% 🔺)3.633s (~)1.198s101.00x
▲ VercelExpress2.444s (+5.3% 🔺)2.720s (+0.6%)0.284s (+40.6% 🔺)3.690s (+5.2% 🔺)1.246s101.00x
▲ VercelNext.js (Turbopack)2.578s (+7.5% 🔺)3.116s (+1.6%)0.178s (-35.5% 🟢)4.055s (+2.9%)1.478s101.06x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro7/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local10/12
Next.js (Turbopack)🌐 Redis6/12
Nitro💻 Local10/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

github-actionsBot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production501038539
✅ 💻 Local Development428062490
✅ 📦 Local Production428062490
✅ 🐘 Local Postgres428062490
✅ 🪟 Windows460349
❌ 🌍 Community Worlds104439156
✅ 📋 Other126021147
Total2061432572361

❌ Failed Tests

🌍 Community Worlds (43 failed)

mongodb (1 failed):

  • webhookWorkflow

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
AppPassedFailedSkipped
✅ astro4504
✅ example4504
✅ express4504
✅ fastify4504
✅ hono4504
✅ nextjs-turbopack4801
✅ nextjs-webpack4801
✅ nitro4504
✅ nuxt4504
✅ sveltekit4504
✅ vite4504
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4603
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4513
✅ redis-dev300
✅ redis4603
✅ turso-dev300
❌ turso4423
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4207
✅ e2e-local-postgres-nest-stable4207
✅ e2e-local-prod-nest-stable4207

📋 View full workflow run

CopilotAI 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.

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.

FileDescription
packages/core/src/runtime/step-handler.tsWrap step lifecycle event creation with 5xx retry; add logic to rethrow persistent 5xx to defer to queue retry.
packages/core/src/runtime/helpers.tsIntroduce withServerErrorRetry with 3 retries and exponential backoff for 5xx WorkflowAPIErrors.
.changeset/retry-5xx-step-handler.mdPatch 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 threadpackages/core/src/runtime/step-handler.ts Outdated
Comment threadpackages/core/src/runtime/helpers.ts Outdated
Comment on lines +120 to +126
const startResult = await withServerErrorRetry(() =>
world.events.create(workflowRunId, {
eventType: 'step_started',
specVersion: SPEC_VERSION_CURRENT,
correlationId: stepId,
})
);

CopilotAIFeb 11, 2026

Copy link

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
Copy Markdown
ContributorAuthor

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
@vercel

vercelBot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

@VaguelySeriousVaguelySerious left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

Comment threadpackages/core/src/runtime/step-handler.ts
Comment threadpackages/world-vercel/src/queue.ts Outdated
};
}
// Wrap VQS server errors as WorkflowAPIError so withServerErrorRetry can catch them
if (error instanceof InternalServerError) {

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.

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

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

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
pranaygpand others added 6 commits February 12, 2026 16:45
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
VQS throws its own error types (InternalServerError, ConsumerDiscoveryError,
ConsumerRegistryNotConfiguredError) that don't match WorkflowAPIError.is().
Wrapping them at the world-vercel boundary enables withServerErrorRetry in
queueMessage() to automatically retry transient queue failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Queue retrying will be handled natively by the @vercel/queue client
instead. Reverts VQS error wrapping and withServerErrorRetry in
queueMessage().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

4 participants

@pranaygp@ctgowrie@VaguelySerious
, '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

Retry 5xx errors from workflow-server in step handler - #1011

Merged
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx
Feb 13, 2026
Merged

Retry 5xx errors from workflow-server in step handler#1011
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx

Conversation

@pranaygp

@pranaygppranaygp commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

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.

read on:

AI

Summary

  • Add withServerErrorRetry helper that retries world calls on 5xx errors 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

Extends the 5xx retry behavior from #966 to the step handler. The key insight: transient workflow-server errors should be retried silently without consuming step attempts, while persistent errors bubble to the queue for higher-level retry.

Tests added

  • Unit tests (helpers.test.ts): 26 tests covering getWorkflowQueueName (10 tests), withServerErrorRetry (7 tests) and withThrottleRetry (9 tests) — success passthrough, retry on 5xx with exponential backoff, retry exhaustion, non-retryable error passthrough, short/long retryAfter handling, double-throttle deferral, and default retryAfter behavior
  • 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
  • Unit tests: pnpm vitest run packages/core/src/runtime/helpers.test.ts — 26 tests pass
  • E2E test: serverError5xxRetryWorkflow passes locally against nextjs-turbopack dev server
  • CI e2e tests pass

🤖 Generated with Claude Code

CopilotAI review requested due to automatic review settings February 11, 2026 23:53
@changeset-bot

changeset-botBot commented Feb 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 87a0c91

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

This PR includes changesets to release 14 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 11, 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🥇 Nitro0.032s (-1.9%)1.005s (~)0.973s101.00x
💻 LocalExpress0.032s (+0.9%)1.005s (~)0.973s101.01x
💻 LocalNext.js (Turbopack)0.040s (-6.4% 🟢)1.005s (~)0.965s101.25x
🌐 RedisNext.js (Turbopack)0.050s (+9.2% 🔺)1.005s (~)0.955s101.58x
🌐 MongoDBNext.js (Turbopack)0.087s (-7.9% 🟢)1.008s (~)0.921s102.74x
🐘 PostgresExpress0.170s (-63.5% 🟢)1.009s (-1.0%)0.839s105.39x
🐘 PostgresNitro0.216s (+74.9% 🔺)1.011s (~)0.795s106.83x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.732s (+12.1% 🔺)2.012s (+4.9%)1.280s101.00x
▲ VercelNext.js (Turbopack)0.895s (+46.6% 🔺)2.300s (+24.4% 🔺)1.404s101.22x
▲ VercelNitro1.720s (+175.8% 🔺)2.964s (+46.7% 🔺)1.244s102.35x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.099s (-1.1%)2.006s (~)0.906s101.00x
💻 LocalExpress1.104s (~)2.006s (~)0.902s101.00x
💻 LocalNitro1.105s (~)2.006s (~)0.901s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🌐 MongoDBNext.js (Turbopack)1.308s (+1.0%)2.008s (~)0.700s101.19x
🐘 PostgresExpress2.205s (-7.5% 🟢)3.014s (~)0.809s102.01x
🐘 PostgresNitro2.432s (+1.0%)3.015s (~)0.582s102.21x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.506s (~)3.483s (-1.5%)0.977s101.00x
▲ VercelExpress2.621s (+2.2%)3.497s (~)0.876s101.05x
▲ VercelNitro2.988s (~)3.870s (-2.3%)0.882s101.19x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.723s (~)11.023s (~)0.301s31.00x
🌐 RedisNext.js (Turbopack)10.739s (~)11.023s (~)0.284s31.00x
💻 LocalNitro10.816s (~)11.023s (~)0.206s31.01x
💻 LocalExpress10.821s (~)11.022s (~)0.200s31.01x
🌐 MongoDBNext.js (Turbopack)12.275s (~)13.021s (~)0.746s31.14x
🐘 PostgresNitro20.298s (~)21.061s (~)0.763s21.89x
🐘 PostgresExpress20.438s (+1.0%)21.056s (~)0.619s21.91x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.453s (+2.1%)20.661s (+4.8%)1.208s21.00x
▲ VercelNext.js (Turbopack)19.520s (+1.0%)20.949s (-1.2%)1.429s21.00x
▲ VercelNitro19.598s (+4.2%)20.245s (-1.7%)0.648s21.01x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.968s (~)27.052s (~)0.084s31.00x
💻 LocalNext.js (Turbopack)27.202s (~)28.051s (~)0.849s31.01x
💻 LocalNitro27.466s (~)28.049s (~)0.583s31.02x
💻 LocalExpress27.495s (~)28.051s (~)0.556s31.02x
🌐 MongoDBNext.js (Turbopack)30.477s (+0.5%)31.038s (~)0.561s21.13x
🐘 PostgresExpress50.233s (-0.5%)51.128s (~)0.895s21.86x
🐘 PostgresNitro50.309s (~)50.626s (-1.0%)0.318s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)48.800s (+3.8%)50.099s (+4.7%)1.299s21.00x
▲ VercelNitro50.597s (+8.0% 🔺)51.906s (+7.6% 🔺)1.309s21.04x
▲ VercelExpress51.275s (+10.9% 🔺)52.177s (+11.1% 🔺)0.903s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.371s (~)55.100s (~)0.729s21.00x
💻 LocalNext.js (Turbopack)56.953s (~)57.105s (~)0.152s21.05x
💻 LocalNitro57.278s (~)58.100s (~)0.822s21.05x
💻 LocalExpress57.336s (~)58.102s (~)0.766s21.05x
🌐 MongoDBNext.js (Turbopack)61.116s (+0.7%)61.576s (+0.9%)0.460s21.12x
🐘 PostgresExpress79.580s (-20.5% 🟢)80.178s (-20.0% 🟢)0.598s21.46x
🐘 PostgresNitro100.195s (~)100.236s (-1.0%)0.041s11.84x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express97.478s (+0.8%)98.523s (+0.5%)1.045s11.00x
▲ VercelNitro98.857s (+2.0%)100.171s (+2.8%)1.314s11.01x
▲ VercelNext.js (Turbopack)104.292s (+5.7% 🔺)105.129s (+6.2% 🔺)0.837s11.07x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.241s (~)2.006s (~)0.765s151.00x
💻 LocalNitro1.406s (-0.8%)2.006s (~)0.599s151.13x
💻 LocalExpress1.410s (~)2.005s (~)0.596s151.14x
💻 LocalNext.js (Turbopack)1.419s (+1.4%)2.006s (~)0.586s151.14x
🌐 MongoDBNext.js (Turbopack)2.168s (~)3.008s (~)0.840s101.75x
🐘 PostgresNitro2.182s (-9.5% 🟢)3.014s (~)0.833s101.76x
🐘 PostgresExpress2.233s (+3.2%)2.596s (-13.9% 🟢)0.363s121.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.807s (+4.5%)3.681s (+6.5% 🔺)0.874s91.00x
▲ VercelNext.js (Turbopack)3.014s (+2.9%)4.310s (+7.5% 🔺)1.296s81.07x
▲ VercelNitro3.569s (+34.5% 🔺)4.444s (+16.9% 🔺)0.874s71.27x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.513s (~)3.008s (~)0.495s101.00x
💻 LocalNitro2.599s (-0.8%)3.007s (~)0.408s101.03x
💻 LocalExpress2.635s (+2.2%)3.007s (~)0.372s101.05x
💻 LocalNext.js (Turbopack)2.705s (+5.2% 🔺)3.007s (~)0.302s101.08x
🌐 MongoDBNext.js (Turbopack)4.734s (-0.9%)5.177s (~)0.443s61.88x
🐘 PostgresNitro8.542s (-3.7%)9.043s (-2.6%)0.501s43.40x
🐘 PostgresExpress10.213s (+20.2% 🔺)10.698s (+18.3% 🔺)0.485s34.06x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.038s (-3.4%)4.161s (-0.9%)1.124s81.00x
▲ VercelNitro3.270s (-19.7% 🟢)4.475s (-19.5% 🟢)1.205s71.08x
▲ VercelNext.js (Turbopack)3.982s (+16.6% 🔺)5.435s (+21.6% 🔺)1.452s61.31x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.116s (+1.5%)4.868s (+3.0%)0.751s71.00x
💻 LocalNext.js (Turbopack)7.175s (~)7.766s (+2.0%)0.590s41.74x
💻 LocalNitro7.456s (-2.9%)8.021s (~)0.564s41.81x
💻 LocalExpress7.622s (+2.6%)8.019s (~)0.397s41.85x
🌐 MongoDBNext.js (Turbopack)9.837s (+1.2%)10.349s (~)0.512s32.39x
🐘 PostgresNitro49.785s (+6.5% 🔺)50.124s (+6.4% 🔺)0.339s112.09x
🐘 PostgresExpress50.464s (+10.3% 🔺)51.121s (+10.9% 🔺)0.657s112.26x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.460s (-12.5% 🟢)4.682s (-8.0% 🟢)1.223s71.00x
▲ VercelExpress3.921s (+21.7% 🔺)5.187s (+6.3% 🔺)1.265s61.13x
▲ VercelNext.js (Turbopack)3.997s (+6.3% 🔺)5.343s (+4.1%)1.346s61.16x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.264s (~)2.006s (~)0.742s151.00x
💻 LocalNext.js (Turbopack)1.428s (~)2.005s (~)0.577s151.13x
💻 LocalExpress1.439s (+1.4%)2.004s (~)0.565s151.14x
💻 LocalNitro1.440s (-1.5%)2.006s (~)0.566s151.14x
🐘 PostgresNitro2.137s (-5.2% 🟢)2.513s (-14.0% 🟢)0.376s121.69x
🌐 MongoDBNext.js (Turbopack)2.155s (-1.1%)3.009s (~)0.854s101.70x
🐘 PostgresExpress2.221s (-5.3% 🟢)2.512s (-16.6% 🟢)0.291s121.76x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.510s (-4.9%)3.456s (+1.9%)0.946s91.00x
▲ VercelExpress2.720s (+11.2% 🔺)3.578s (+3.6%)0.858s91.08x
▲ VercelNitro2.792s (+14.2% 🔺)4.239s (+17.8% 🔺)1.447s81.11x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.508s (~)3.008s (~)0.500s101.00x
💻 LocalNitro2.701s (-1.7%)3.007s (~)0.306s101.08x
💻 LocalExpress2.729s (+3.1%)3.007s (~)0.278s101.09x
💻 LocalNext.js (Turbopack)2.837s (+5.8% 🔺)3.007s (~)0.171s101.13x
🌐 MongoDBNext.js (Turbopack)4.806s (~)5.177s (~)0.372s61.92x
🐘 PostgresNitro11.404s (+47.4% 🔺)11.705s (+41.4% 🔺)0.301s34.55x
🐘 PostgresExpress12.784s (+22.5% 🔺)13.032s (+18.1% 🔺)0.248s35.10x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.883s (-24.3% 🟢)4.226s (-19.5% 🟢)1.343s81.00x
▲ VercelExpress2.954s (+11.4% 🔺)3.834s (+7.2% 🔺)0.880s81.02x
▲ VercelNext.js (Turbopack)3.008s (-3.1%)4.370s (-1.0%)1.362s71.04x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.136s (~)4.868s (~)0.732s71.00x
💻 LocalNext.js (Turbopack)7.242s (-5.0%)7.766s (-8.8% 🟢)0.525s41.75x
💻 LocalNitro7.944s (-1.2%)8.269s (-5.7% 🟢)0.325s41.92x
💻 LocalExpress8.083s (+3.4%)9.023s (+12.5% 🔺)0.939s41.95x
🌐 MongoDBNext.js (Turbopack)9.944s (~)10.684s (+3.3%)0.740s32.40x
🐘 PostgresNitro52.383s (+14.5% 🔺)53.118s (+15.2% 🔺)0.735s112.66x
🐘 PostgresExpress53.132s (+1.3%)54.116s (+1.8%)0.984s112.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.058s (-25.8% 🟢)3.931s (-24.6% 🟢)0.874s81.00x
▲ VercelNext.js (Turbopack)4.041s (-2.4%)5.520s (-1.5%)1.479s61.32x
▲ VercelNitro4.841s (+55.5% 🔺)6.079s (+33.8% 🔺)1.239s61.58x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.147s (-2.1%)1.001s (~)0.011s (+12.9% 🔺)1.017s (~)0.870s101.00x
🌐 RedisNext.js (Turbopack)0.150s (-2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.02x
💻 LocalNitro0.168s (-3.7%)1.002s (~)0.011s (-1.8%)1.016s (~)0.848s101.15x
💻 LocalExpress0.175s (+3.7%)1.003s (~)0.011s (-3.4%)1.017s (~)0.841s101.19x
🌐 MongoDBNext.js (Turbopack)0.504s (+5.6% 🔺)0.943s (-2.5%)0.002s (+14.3% 🔺)1.008s (~)0.505s103.43x
🐘 PostgresExpress1.408s (-38.2% 🟢)1.626s (-41.2% 🟢)0.001s (-13.3% 🟢)2.013s (-33.3% 🟢)0.604s109.58x
🐘 PostgresNitro2.290s (-7.2% 🟢)2.754s (+6.9% 🔺)0.001s (+8.3% 🔺)3.016s (~)0.726s1015.58x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.434s (+3.3%)2.752s (-3.2%)0.238s (+27.2% 🔺)3.633s (~)1.198s101.00x
▲ VercelExpress2.444s (+5.3% 🔺)2.720s (+0.6%)0.284s (+40.6% 🔺)3.690s (+5.2% 🔺)1.246s101.00x
▲ VercelNext.js (Turbopack)2.578s (+7.5% 🔺)3.116s (+1.6%)0.178s (-35.5% 🟢)4.055s (+2.9%)1.478s101.06x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro7/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local10/12
Next.js (Turbopack)🌐 Redis6/12
Nitro💻 Local10/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

github-actionsBot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production501038539
✅ 💻 Local Development428062490
✅ 📦 Local Production428062490
✅ 🐘 Local Postgres428062490
✅ 🪟 Windows460349
❌ 🌍 Community Worlds104439156
✅ 📋 Other126021147
Total2061432572361

❌ Failed Tests

🌍 Community Worlds (43 failed)

mongodb (1 failed):

  • webhookWorkflow

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
AppPassedFailedSkipped
✅ astro4504
✅ example4504
✅ express4504
✅ fastify4504
✅ hono4504
✅ nextjs-turbopack4801
✅ nextjs-webpack4801
✅ nitro4504
✅ nuxt4504
✅ sveltekit4504
✅ vite4504
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4603
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4513
✅ redis-dev300
✅ redis4603
✅ turso-dev300
❌ turso4423
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4207
✅ e2e-local-postgres-nest-stable4207
✅ e2e-local-prod-nest-stable4207

📋 View full workflow run

CopilotAI 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.

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.

FileDescription
packages/core/src/runtime/step-handler.tsWrap step lifecycle event creation with 5xx retry; add logic to rethrow persistent 5xx to defer to queue retry.
packages/core/src/runtime/helpers.tsIntroduce withServerErrorRetry with 3 retries and exponential backoff for 5xx WorkflowAPIErrors.
.changeset/retry-5xx-step-handler.mdPatch 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 threadpackages/core/src/runtime/step-handler.ts Outdated
Comment threadpackages/core/src/runtime/helpers.ts Outdated
Comment on lines +120 to +126
const startResult = await withServerErrorRetry(() =>
world.events.create(workflowRunId, {
eventType: 'step_started',
specVersion: SPEC_VERSION_CURRENT,
correlationId: stepId,
})
);

CopilotAIFeb 11, 2026

Copy link

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
Copy Markdown
ContributorAuthor

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
@vercel

vercelBot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

@VaguelySeriousVaguelySerious left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

Comment threadpackages/core/src/runtime/step-handler.ts
Comment threadpackages/world-vercel/src/queue.ts Outdated
};
}
// Wrap VQS server errors as WorkflowAPIError so withServerErrorRetry can catch them
if (error instanceof InternalServerError) {

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.

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

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

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
pranaygpand others added 6 commits February 12, 2026 16:45
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
VQS throws its own error types (InternalServerError, ConsumerDiscoveryError,
ConsumerRegistryNotConfiguredError) that don't match WorkflowAPIError.is().
Wrapping them at the world-vercel boundary enables withServerErrorRetry in
queueMessage() to automatically retry transient queue failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Queue retrying will be handled natively by the @vercel/queue client
instead. Reverts VQS error wrapping and withServerErrorRetry in
queueMessage().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

4 participants

@pranaygp@ctgowrie@VaguelySerious
, '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

Retry 5xx errors from workflow-server in step handler - #1011

Merged
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx
Feb 13, 2026
Merged

Retry 5xx errors from workflow-server in step handler#1011
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx

Conversation

@pranaygp

@pranaygppranaygp commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

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.

read on:

AI

Summary

  • Add withServerErrorRetry helper that retries world calls on 5xx errors 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

Extends the 5xx retry behavior from #966 to the step handler. The key insight: transient workflow-server errors should be retried silently without consuming step attempts, while persistent errors bubble to the queue for higher-level retry.

Tests added

  • Unit tests (helpers.test.ts): 26 tests covering getWorkflowQueueName (10 tests), withServerErrorRetry (7 tests) and withThrottleRetry (9 tests) — success passthrough, retry on 5xx with exponential backoff, retry exhaustion, non-retryable error passthrough, short/long retryAfter handling, double-throttle deferral, and default retryAfter behavior
  • 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
  • Unit tests: pnpm vitest run packages/core/src/runtime/helpers.test.ts — 26 tests pass
  • E2E test: serverError5xxRetryWorkflow passes locally against nextjs-turbopack dev server
  • CI e2e tests pass

🤖 Generated with Claude Code

CopilotAI review requested due to automatic review settings February 11, 2026 23:53
@changeset-bot

changeset-botBot commented Feb 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 87a0c91

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

This PR includes changesets to release 14 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 11, 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🥇 Nitro0.032s (-1.9%)1.005s (~)0.973s101.00x
💻 LocalExpress0.032s (+0.9%)1.005s (~)0.973s101.01x
💻 LocalNext.js (Turbopack)0.040s (-6.4% 🟢)1.005s (~)0.965s101.25x
🌐 RedisNext.js (Turbopack)0.050s (+9.2% 🔺)1.005s (~)0.955s101.58x
🌐 MongoDBNext.js (Turbopack)0.087s (-7.9% 🟢)1.008s (~)0.921s102.74x
🐘 PostgresExpress0.170s (-63.5% 🟢)1.009s (-1.0%)0.839s105.39x
🐘 PostgresNitro0.216s (+74.9% 🔺)1.011s (~)0.795s106.83x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.732s (+12.1% 🔺)2.012s (+4.9%)1.280s101.00x
▲ VercelNext.js (Turbopack)0.895s (+46.6% 🔺)2.300s (+24.4% 🔺)1.404s101.22x
▲ VercelNitro1.720s (+175.8% 🔺)2.964s (+46.7% 🔺)1.244s102.35x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.099s (-1.1%)2.006s (~)0.906s101.00x
💻 LocalExpress1.104s (~)2.006s (~)0.902s101.00x
💻 LocalNitro1.105s (~)2.006s (~)0.901s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🌐 MongoDBNext.js (Turbopack)1.308s (+1.0%)2.008s (~)0.700s101.19x
🐘 PostgresExpress2.205s (-7.5% 🟢)3.014s (~)0.809s102.01x
🐘 PostgresNitro2.432s (+1.0%)3.015s (~)0.582s102.21x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.506s (~)3.483s (-1.5%)0.977s101.00x
▲ VercelExpress2.621s (+2.2%)3.497s (~)0.876s101.05x
▲ VercelNitro2.988s (~)3.870s (-2.3%)0.882s101.19x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.723s (~)11.023s (~)0.301s31.00x
🌐 RedisNext.js (Turbopack)10.739s (~)11.023s (~)0.284s31.00x
💻 LocalNitro10.816s (~)11.023s (~)0.206s31.01x
💻 LocalExpress10.821s (~)11.022s (~)0.200s31.01x
🌐 MongoDBNext.js (Turbopack)12.275s (~)13.021s (~)0.746s31.14x
🐘 PostgresNitro20.298s (~)21.061s (~)0.763s21.89x
🐘 PostgresExpress20.438s (+1.0%)21.056s (~)0.619s21.91x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.453s (+2.1%)20.661s (+4.8%)1.208s21.00x
▲ VercelNext.js (Turbopack)19.520s (+1.0%)20.949s (-1.2%)1.429s21.00x
▲ VercelNitro19.598s (+4.2%)20.245s (-1.7%)0.648s21.01x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.968s (~)27.052s (~)0.084s31.00x
💻 LocalNext.js (Turbopack)27.202s (~)28.051s (~)0.849s31.01x
💻 LocalNitro27.466s (~)28.049s (~)0.583s31.02x
💻 LocalExpress27.495s (~)28.051s (~)0.556s31.02x
🌐 MongoDBNext.js (Turbopack)30.477s (+0.5%)31.038s (~)0.561s21.13x
🐘 PostgresExpress50.233s (-0.5%)51.128s (~)0.895s21.86x
🐘 PostgresNitro50.309s (~)50.626s (-1.0%)0.318s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)48.800s (+3.8%)50.099s (+4.7%)1.299s21.00x
▲ VercelNitro50.597s (+8.0% 🔺)51.906s (+7.6% 🔺)1.309s21.04x
▲ VercelExpress51.275s (+10.9% 🔺)52.177s (+11.1% 🔺)0.903s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.371s (~)55.100s (~)0.729s21.00x
💻 LocalNext.js (Turbopack)56.953s (~)57.105s (~)0.152s21.05x
💻 LocalNitro57.278s (~)58.100s (~)0.822s21.05x
💻 LocalExpress57.336s (~)58.102s (~)0.766s21.05x
🌐 MongoDBNext.js (Turbopack)61.116s (+0.7%)61.576s (+0.9%)0.460s21.12x
🐘 PostgresExpress79.580s (-20.5% 🟢)80.178s (-20.0% 🟢)0.598s21.46x
🐘 PostgresNitro100.195s (~)100.236s (-1.0%)0.041s11.84x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express97.478s (+0.8%)98.523s (+0.5%)1.045s11.00x
▲ VercelNitro98.857s (+2.0%)100.171s (+2.8%)1.314s11.01x
▲ VercelNext.js (Turbopack)104.292s (+5.7% 🔺)105.129s (+6.2% 🔺)0.837s11.07x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.241s (~)2.006s (~)0.765s151.00x
💻 LocalNitro1.406s (-0.8%)2.006s (~)0.599s151.13x
💻 LocalExpress1.410s (~)2.005s (~)0.596s151.14x
💻 LocalNext.js (Turbopack)1.419s (+1.4%)2.006s (~)0.586s151.14x
🌐 MongoDBNext.js (Turbopack)2.168s (~)3.008s (~)0.840s101.75x
🐘 PostgresNitro2.182s (-9.5% 🟢)3.014s (~)0.833s101.76x
🐘 PostgresExpress2.233s (+3.2%)2.596s (-13.9% 🟢)0.363s121.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.807s (+4.5%)3.681s (+6.5% 🔺)0.874s91.00x
▲ VercelNext.js (Turbopack)3.014s (+2.9%)4.310s (+7.5% 🔺)1.296s81.07x
▲ VercelNitro3.569s (+34.5% 🔺)4.444s (+16.9% 🔺)0.874s71.27x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.513s (~)3.008s (~)0.495s101.00x
💻 LocalNitro2.599s (-0.8%)3.007s (~)0.408s101.03x
💻 LocalExpress2.635s (+2.2%)3.007s (~)0.372s101.05x
💻 LocalNext.js (Turbopack)2.705s (+5.2% 🔺)3.007s (~)0.302s101.08x
🌐 MongoDBNext.js (Turbopack)4.734s (-0.9%)5.177s (~)0.443s61.88x
🐘 PostgresNitro8.542s (-3.7%)9.043s (-2.6%)0.501s43.40x
🐘 PostgresExpress10.213s (+20.2% 🔺)10.698s (+18.3% 🔺)0.485s34.06x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.038s (-3.4%)4.161s (-0.9%)1.124s81.00x
▲ VercelNitro3.270s (-19.7% 🟢)4.475s (-19.5% 🟢)1.205s71.08x
▲ VercelNext.js (Turbopack)3.982s (+16.6% 🔺)5.435s (+21.6% 🔺)1.452s61.31x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.116s (+1.5%)4.868s (+3.0%)0.751s71.00x
💻 LocalNext.js (Turbopack)7.175s (~)7.766s (+2.0%)0.590s41.74x
💻 LocalNitro7.456s (-2.9%)8.021s (~)0.564s41.81x
💻 LocalExpress7.622s (+2.6%)8.019s (~)0.397s41.85x
🌐 MongoDBNext.js (Turbopack)9.837s (+1.2%)10.349s (~)0.512s32.39x
🐘 PostgresNitro49.785s (+6.5% 🔺)50.124s (+6.4% 🔺)0.339s112.09x
🐘 PostgresExpress50.464s (+10.3% 🔺)51.121s (+10.9% 🔺)0.657s112.26x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.460s (-12.5% 🟢)4.682s (-8.0% 🟢)1.223s71.00x
▲ VercelExpress3.921s (+21.7% 🔺)5.187s (+6.3% 🔺)1.265s61.13x
▲ VercelNext.js (Turbopack)3.997s (+6.3% 🔺)5.343s (+4.1%)1.346s61.16x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.264s (~)2.006s (~)0.742s151.00x
💻 LocalNext.js (Turbopack)1.428s (~)2.005s (~)0.577s151.13x
💻 LocalExpress1.439s (+1.4%)2.004s (~)0.565s151.14x
💻 LocalNitro1.440s (-1.5%)2.006s (~)0.566s151.14x
🐘 PostgresNitro2.137s (-5.2% 🟢)2.513s (-14.0% 🟢)0.376s121.69x
🌐 MongoDBNext.js (Turbopack)2.155s (-1.1%)3.009s (~)0.854s101.70x
🐘 PostgresExpress2.221s (-5.3% 🟢)2.512s (-16.6% 🟢)0.291s121.76x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.510s (-4.9%)3.456s (+1.9%)0.946s91.00x
▲ VercelExpress2.720s (+11.2% 🔺)3.578s (+3.6%)0.858s91.08x
▲ VercelNitro2.792s (+14.2% 🔺)4.239s (+17.8% 🔺)1.447s81.11x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.508s (~)3.008s (~)0.500s101.00x
💻 LocalNitro2.701s (-1.7%)3.007s (~)0.306s101.08x
💻 LocalExpress2.729s (+3.1%)3.007s (~)0.278s101.09x
💻 LocalNext.js (Turbopack)2.837s (+5.8% 🔺)3.007s (~)0.171s101.13x
🌐 MongoDBNext.js (Turbopack)4.806s (~)5.177s (~)0.372s61.92x
🐘 PostgresNitro11.404s (+47.4% 🔺)11.705s (+41.4% 🔺)0.301s34.55x
🐘 PostgresExpress12.784s (+22.5% 🔺)13.032s (+18.1% 🔺)0.248s35.10x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.883s (-24.3% 🟢)4.226s (-19.5% 🟢)1.343s81.00x
▲ VercelExpress2.954s (+11.4% 🔺)3.834s (+7.2% 🔺)0.880s81.02x
▲ VercelNext.js (Turbopack)3.008s (-3.1%)4.370s (-1.0%)1.362s71.04x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.136s (~)4.868s (~)0.732s71.00x
💻 LocalNext.js (Turbopack)7.242s (-5.0%)7.766s (-8.8% 🟢)0.525s41.75x
💻 LocalNitro7.944s (-1.2%)8.269s (-5.7% 🟢)0.325s41.92x
💻 LocalExpress8.083s (+3.4%)9.023s (+12.5% 🔺)0.939s41.95x
🌐 MongoDBNext.js (Turbopack)9.944s (~)10.684s (+3.3%)0.740s32.40x
🐘 PostgresNitro52.383s (+14.5% 🔺)53.118s (+15.2% 🔺)0.735s112.66x
🐘 PostgresExpress53.132s (+1.3%)54.116s (+1.8%)0.984s112.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.058s (-25.8% 🟢)3.931s (-24.6% 🟢)0.874s81.00x
▲ VercelNext.js (Turbopack)4.041s (-2.4%)5.520s (-1.5%)1.479s61.32x
▲ VercelNitro4.841s (+55.5% 🔺)6.079s (+33.8% 🔺)1.239s61.58x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.147s (-2.1%)1.001s (~)0.011s (+12.9% 🔺)1.017s (~)0.870s101.00x
🌐 RedisNext.js (Turbopack)0.150s (-2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.02x
💻 LocalNitro0.168s (-3.7%)1.002s (~)0.011s (-1.8%)1.016s (~)0.848s101.15x
💻 LocalExpress0.175s (+3.7%)1.003s (~)0.011s (-3.4%)1.017s (~)0.841s101.19x
🌐 MongoDBNext.js (Turbopack)0.504s (+5.6% 🔺)0.943s (-2.5%)0.002s (+14.3% 🔺)1.008s (~)0.505s103.43x
🐘 PostgresExpress1.408s (-38.2% 🟢)1.626s (-41.2% 🟢)0.001s (-13.3% 🟢)2.013s (-33.3% 🟢)0.604s109.58x
🐘 PostgresNitro2.290s (-7.2% 🟢)2.754s (+6.9% 🔺)0.001s (+8.3% 🔺)3.016s (~)0.726s1015.58x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.434s (+3.3%)2.752s (-3.2%)0.238s (+27.2% 🔺)3.633s (~)1.198s101.00x
▲ VercelExpress2.444s (+5.3% 🔺)2.720s (+0.6%)0.284s (+40.6% 🔺)3.690s (+5.2% 🔺)1.246s101.00x
▲ VercelNext.js (Turbopack)2.578s (+7.5% 🔺)3.116s (+1.6%)0.178s (-35.5% 🟢)4.055s (+2.9%)1.478s101.06x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro7/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local10/12
Next.js (Turbopack)🌐 Redis6/12
Nitro💻 Local10/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

github-actionsBot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production501038539
✅ 💻 Local Development428062490
✅ 📦 Local Production428062490
✅ 🐘 Local Postgres428062490
✅ 🪟 Windows460349
❌ 🌍 Community Worlds104439156
✅ 📋 Other126021147
Total2061432572361

❌ Failed Tests

🌍 Community Worlds (43 failed)

mongodb (1 failed):

  • webhookWorkflow

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
AppPassedFailedSkipped
✅ astro4504
✅ example4504
✅ express4504
✅ fastify4504
✅ hono4504
✅ nextjs-turbopack4801
✅ nextjs-webpack4801
✅ nitro4504
✅ nuxt4504
✅ sveltekit4504
✅ vite4504
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4603
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4513
✅ redis-dev300
✅ redis4603
✅ turso-dev300
❌ turso4423
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4207
✅ e2e-local-postgres-nest-stable4207
✅ e2e-local-prod-nest-stable4207

📋 View full workflow run

CopilotAI 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.

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.

FileDescription
packages/core/src/runtime/step-handler.tsWrap step lifecycle event creation with 5xx retry; add logic to rethrow persistent 5xx to defer to queue retry.
packages/core/src/runtime/helpers.tsIntroduce withServerErrorRetry with 3 retries and exponential backoff for 5xx WorkflowAPIErrors.
.changeset/retry-5xx-step-handler.mdPatch 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 threadpackages/core/src/runtime/step-handler.ts Outdated
Comment threadpackages/core/src/runtime/helpers.ts Outdated
Comment on lines +120 to +126
const startResult = await withServerErrorRetry(() =>
world.events.create(workflowRunId, {
eventType: 'step_started',
specVersion: SPEC_VERSION_CURRENT,
correlationId: stepId,
})
);

CopilotAIFeb 11, 2026

Copy link

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
Copy Markdown
ContributorAuthor

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
@vercel

vercelBot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

@VaguelySeriousVaguelySerious left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

Comment threadpackages/core/src/runtime/step-handler.ts
Comment threadpackages/world-vercel/src/queue.ts Outdated
};
}
// Wrap VQS server errors as WorkflowAPIError so withServerErrorRetry can catch them
if (error instanceof InternalServerError) {

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.

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

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

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
pranaygpand others added 6 commits February 12, 2026 16:45
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
VQS throws its own error types (InternalServerError, ConsumerDiscoveryError,
ConsumerRegistryNotConfiguredError) that don't match WorkflowAPIError.is().
Wrapping them at the world-vercel boundary enables withServerErrorRetry in
queueMessage() to automatically retry transient queue failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Queue retrying will be handled natively by the @vercel/queue client
instead. Reverts VQS error wrapping and withServerErrorRetry in
queueMessage().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

4 participants

@pranaygp@ctgowrie@VaguelySerious
, '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

Retry 5xx errors from workflow-server in step handler - #1011

Merged
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx
Feb 13, 2026
Merged

Retry 5xx errors from workflow-server in step handler#1011
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx

Conversation

@pranaygp

@pranaygppranaygp commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

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.

read on:

AI

Summary

  • Add withServerErrorRetry helper that retries world calls on 5xx errors 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

Extends the 5xx retry behavior from #966 to the step handler. The key insight: transient workflow-server errors should be retried silently without consuming step attempts, while persistent errors bubble to the queue for higher-level retry.

Tests added

  • Unit tests (helpers.test.ts): 26 tests covering getWorkflowQueueName (10 tests), withServerErrorRetry (7 tests) and withThrottleRetry (9 tests) — success passthrough, retry on 5xx with exponential backoff, retry exhaustion, non-retryable error passthrough, short/long retryAfter handling, double-throttle deferral, and default retryAfter behavior
  • 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
  • Unit tests: pnpm vitest run packages/core/src/runtime/helpers.test.ts — 26 tests pass
  • E2E test: serverError5xxRetryWorkflow passes locally against nextjs-turbopack dev server
  • CI e2e tests pass

🤖 Generated with Claude Code

CopilotAI review requested due to automatic review settings February 11, 2026 23:53
@changeset-bot

changeset-botBot commented Feb 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 87a0c91

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

This PR includes changesets to release 14 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 11, 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🥇 Nitro0.032s (-1.9%)1.005s (~)0.973s101.00x
💻 LocalExpress0.032s (+0.9%)1.005s (~)0.973s101.01x
💻 LocalNext.js (Turbopack)0.040s (-6.4% 🟢)1.005s (~)0.965s101.25x
🌐 RedisNext.js (Turbopack)0.050s (+9.2% 🔺)1.005s (~)0.955s101.58x
🌐 MongoDBNext.js (Turbopack)0.087s (-7.9% 🟢)1.008s (~)0.921s102.74x
🐘 PostgresExpress0.170s (-63.5% 🟢)1.009s (-1.0%)0.839s105.39x
🐘 PostgresNitro0.216s (+74.9% 🔺)1.011s (~)0.795s106.83x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.732s (+12.1% 🔺)2.012s (+4.9%)1.280s101.00x
▲ VercelNext.js (Turbopack)0.895s (+46.6% 🔺)2.300s (+24.4% 🔺)1.404s101.22x
▲ VercelNitro1.720s (+175.8% 🔺)2.964s (+46.7% 🔺)1.244s102.35x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.099s (-1.1%)2.006s (~)0.906s101.00x
💻 LocalExpress1.104s (~)2.006s (~)0.902s101.00x
💻 LocalNitro1.105s (~)2.006s (~)0.901s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🌐 MongoDBNext.js (Turbopack)1.308s (+1.0%)2.008s (~)0.700s101.19x
🐘 PostgresExpress2.205s (-7.5% 🟢)3.014s (~)0.809s102.01x
🐘 PostgresNitro2.432s (+1.0%)3.015s (~)0.582s102.21x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.506s (~)3.483s (-1.5%)0.977s101.00x
▲ VercelExpress2.621s (+2.2%)3.497s (~)0.876s101.05x
▲ VercelNitro2.988s (~)3.870s (-2.3%)0.882s101.19x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.723s (~)11.023s (~)0.301s31.00x
🌐 RedisNext.js (Turbopack)10.739s (~)11.023s (~)0.284s31.00x
💻 LocalNitro10.816s (~)11.023s (~)0.206s31.01x
💻 LocalExpress10.821s (~)11.022s (~)0.200s31.01x
🌐 MongoDBNext.js (Turbopack)12.275s (~)13.021s (~)0.746s31.14x
🐘 PostgresNitro20.298s (~)21.061s (~)0.763s21.89x
🐘 PostgresExpress20.438s (+1.0%)21.056s (~)0.619s21.91x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.453s (+2.1%)20.661s (+4.8%)1.208s21.00x
▲ VercelNext.js (Turbopack)19.520s (+1.0%)20.949s (-1.2%)1.429s21.00x
▲ VercelNitro19.598s (+4.2%)20.245s (-1.7%)0.648s21.01x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.968s (~)27.052s (~)0.084s31.00x
💻 LocalNext.js (Turbopack)27.202s (~)28.051s (~)0.849s31.01x
💻 LocalNitro27.466s (~)28.049s (~)0.583s31.02x
💻 LocalExpress27.495s (~)28.051s (~)0.556s31.02x
🌐 MongoDBNext.js (Turbopack)30.477s (+0.5%)31.038s (~)0.561s21.13x
🐘 PostgresExpress50.233s (-0.5%)51.128s (~)0.895s21.86x
🐘 PostgresNitro50.309s (~)50.626s (-1.0%)0.318s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)48.800s (+3.8%)50.099s (+4.7%)1.299s21.00x
▲ VercelNitro50.597s (+8.0% 🔺)51.906s (+7.6% 🔺)1.309s21.04x
▲ VercelExpress51.275s (+10.9% 🔺)52.177s (+11.1% 🔺)0.903s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.371s (~)55.100s (~)0.729s21.00x
💻 LocalNext.js (Turbopack)56.953s (~)57.105s (~)0.152s21.05x
💻 LocalNitro57.278s (~)58.100s (~)0.822s21.05x
💻 LocalExpress57.336s (~)58.102s (~)0.766s21.05x
🌐 MongoDBNext.js (Turbopack)61.116s (+0.7%)61.576s (+0.9%)0.460s21.12x
🐘 PostgresExpress79.580s (-20.5% 🟢)80.178s (-20.0% 🟢)0.598s21.46x
🐘 PostgresNitro100.195s (~)100.236s (-1.0%)0.041s11.84x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express97.478s (+0.8%)98.523s (+0.5%)1.045s11.00x
▲ VercelNitro98.857s (+2.0%)100.171s (+2.8%)1.314s11.01x
▲ VercelNext.js (Turbopack)104.292s (+5.7% 🔺)105.129s (+6.2% 🔺)0.837s11.07x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.241s (~)2.006s (~)0.765s151.00x
💻 LocalNitro1.406s (-0.8%)2.006s (~)0.599s151.13x
💻 LocalExpress1.410s (~)2.005s (~)0.596s151.14x
💻 LocalNext.js (Turbopack)1.419s (+1.4%)2.006s (~)0.586s151.14x
🌐 MongoDBNext.js (Turbopack)2.168s (~)3.008s (~)0.840s101.75x
🐘 PostgresNitro2.182s (-9.5% 🟢)3.014s (~)0.833s101.76x
🐘 PostgresExpress2.233s (+3.2%)2.596s (-13.9% 🟢)0.363s121.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.807s (+4.5%)3.681s (+6.5% 🔺)0.874s91.00x
▲ VercelNext.js (Turbopack)3.014s (+2.9%)4.310s (+7.5% 🔺)1.296s81.07x
▲ VercelNitro3.569s (+34.5% 🔺)4.444s (+16.9% 🔺)0.874s71.27x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.513s (~)3.008s (~)0.495s101.00x
💻 LocalNitro2.599s (-0.8%)3.007s (~)0.408s101.03x
💻 LocalExpress2.635s (+2.2%)3.007s (~)0.372s101.05x
💻 LocalNext.js (Turbopack)2.705s (+5.2% 🔺)3.007s (~)0.302s101.08x
🌐 MongoDBNext.js (Turbopack)4.734s (-0.9%)5.177s (~)0.443s61.88x
🐘 PostgresNitro8.542s (-3.7%)9.043s (-2.6%)0.501s43.40x
🐘 PostgresExpress10.213s (+20.2% 🔺)10.698s (+18.3% 🔺)0.485s34.06x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.038s (-3.4%)4.161s (-0.9%)1.124s81.00x
▲ VercelNitro3.270s (-19.7% 🟢)4.475s (-19.5% 🟢)1.205s71.08x
▲ VercelNext.js (Turbopack)3.982s (+16.6% 🔺)5.435s (+21.6% 🔺)1.452s61.31x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.116s (+1.5%)4.868s (+3.0%)0.751s71.00x
💻 LocalNext.js (Turbopack)7.175s (~)7.766s (+2.0%)0.590s41.74x
💻 LocalNitro7.456s (-2.9%)8.021s (~)0.564s41.81x
💻 LocalExpress7.622s (+2.6%)8.019s (~)0.397s41.85x
🌐 MongoDBNext.js (Turbopack)9.837s (+1.2%)10.349s (~)0.512s32.39x
🐘 PostgresNitro49.785s (+6.5% 🔺)50.124s (+6.4% 🔺)0.339s112.09x
🐘 PostgresExpress50.464s (+10.3% 🔺)51.121s (+10.9% 🔺)0.657s112.26x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.460s (-12.5% 🟢)4.682s (-8.0% 🟢)1.223s71.00x
▲ VercelExpress3.921s (+21.7% 🔺)5.187s (+6.3% 🔺)1.265s61.13x
▲ VercelNext.js (Turbopack)3.997s (+6.3% 🔺)5.343s (+4.1%)1.346s61.16x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.264s (~)2.006s (~)0.742s151.00x
💻 LocalNext.js (Turbopack)1.428s (~)2.005s (~)0.577s151.13x
💻 LocalExpress1.439s (+1.4%)2.004s (~)0.565s151.14x
💻 LocalNitro1.440s (-1.5%)2.006s (~)0.566s151.14x
🐘 PostgresNitro2.137s (-5.2% 🟢)2.513s (-14.0% 🟢)0.376s121.69x
🌐 MongoDBNext.js (Turbopack)2.155s (-1.1%)3.009s (~)0.854s101.70x
🐘 PostgresExpress2.221s (-5.3% 🟢)2.512s (-16.6% 🟢)0.291s121.76x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.510s (-4.9%)3.456s (+1.9%)0.946s91.00x
▲ VercelExpress2.720s (+11.2% 🔺)3.578s (+3.6%)0.858s91.08x
▲ VercelNitro2.792s (+14.2% 🔺)4.239s (+17.8% 🔺)1.447s81.11x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.508s (~)3.008s (~)0.500s101.00x
💻 LocalNitro2.701s (-1.7%)3.007s (~)0.306s101.08x
💻 LocalExpress2.729s (+3.1%)3.007s (~)0.278s101.09x
💻 LocalNext.js (Turbopack)2.837s (+5.8% 🔺)3.007s (~)0.171s101.13x
🌐 MongoDBNext.js (Turbopack)4.806s (~)5.177s (~)0.372s61.92x
🐘 PostgresNitro11.404s (+47.4% 🔺)11.705s (+41.4% 🔺)0.301s34.55x
🐘 PostgresExpress12.784s (+22.5% 🔺)13.032s (+18.1% 🔺)0.248s35.10x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.883s (-24.3% 🟢)4.226s (-19.5% 🟢)1.343s81.00x
▲ VercelExpress2.954s (+11.4% 🔺)3.834s (+7.2% 🔺)0.880s81.02x
▲ VercelNext.js (Turbopack)3.008s (-3.1%)4.370s (-1.0%)1.362s71.04x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.136s (~)4.868s (~)0.732s71.00x
💻 LocalNext.js (Turbopack)7.242s (-5.0%)7.766s (-8.8% 🟢)0.525s41.75x
💻 LocalNitro7.944s (-1.2%)8.269s (-5.7% 🟢)0.325s41.92x
💻 LocalExpress8.083s (+3.4%)9.023s (+12.5% 🔺)0.939s41.95x
🌐 MongoDBNext.js (Turbopack)9.944s (~)10.684s (+3.3%)0.740s32.40x
🐘 PostgresNitro52.383s (+14.5% 🔺)53.118s (+15.2% 🔺)0.735s112.66x
🐘 PostgresExpress53.132s (+1.3%)54.116s (+1.8%)0.984s112.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.058s (-25.8% 🟢)3.931s (-24.6% 🟢)0.874s81.00x
▲ VercelNext.js (Turbopack)4.041s (-2.4%)5.520s (-1.5%)1.479s61.32x
▲ VercelNitro4.841s (+55.5% 🔺)6.079s (+33.8% 🔺)1.239s61.58x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.147s (-2.1%)1.001s (~)0.011s (+12.9% 🔺)1.017s (~)0.870s101.00x
🌐 RedisNext.js (Turbopack)0.150s (-2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.02x
💻 LocalNitro0.168s (-3.7%)1.002s (~)0.011s (-1.8%)1.016s (~)0.848s101.15x
💻 LocalExpress0.175s (+3.7%)1.003s (~)0.011s (-3.4%)1.017s (~)0.841s101.19x
🌐 MongoDBNext.js (Turbopack)0.504s (+5.6% 🔺)0.943s (-2.5%)0.002s (+14.3% 🔺)1.008s (~)0.505s103.43x
🐘 PostgresExpress1.408s (-38.2% 🟢)1.626s (-41.2% 🟢)0.001s (-13.3% 🟢)2.013s (-33.3% 🟢)0.604s109.58x
🐘 PostgresNitro2.290s (-7.2% 🟢)2.754s (+6.9% 🔺)0.001s (+8.3% 🔺)3.016s (~)0.726s1015.58x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.434s (+3.3%)2.752s (-3.2%)0.238s (+27.2% 🔺)3.633s (~)1.198s101.00x
▲ VercelExpress2.444s (+5.3% 🔺)2.720s (+0.6%)0.284s (+40.6% 🔺)3.690s (+5.2% 🔺)1.246s101.00x
▲ VercelNext.js (Turbopack)2.578s (+7.5% 🔺)3.116s (+1.6%)0.178s (-35.5% 🟢)4.055s (+2.9%)1.478s101.06x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro7/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local10/12
Next.js (Turbopack)🌐 Redis6/12
Nitro💻 Local10/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

github-actionsBot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production501038539
✅ 💻 Local Development428062490
✅ 📦 Local Production428062490
✅ 🐘 Local Postgres428062490
✅ 🪟 Windows460349
❌ 🌍 Community Worlds104439156
✅ 📋 Other126021147
Total2061432572361

❌ Failed Tests

🌍 Community Worlds (43 failed)

mongodb (1 failed):

  • webhookWorkflow

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
AppPassedFailedSkipped
✅ astro4504
✅ example4504
✅ express4504
✅ fastify4504
✅ hono4504
✅ nextjs-turbopack4801
✅ nextjs-webpack4801
✅ nitro4504
✅ nuxt4504
✅ sveltekit4504
✅ vite4504
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4603
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4513
✅ redis-dev300
✅ redis4603
✅ turso-dev300
❌ turso4423
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4207
✅ e2e-local-postgres-nest-stable4207
✅ e2e-local-prod-nest-stable4207

📋 View full workflow run

CopilotAI 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.

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.

FileDescription
packages/core/src/runtime/step-handler.tsWrap step lifecycle event creation with 5xx retry; add logic to rethrow persistent 5xx to defer to queue retry.
packages/core/src/runtime/helpers.tsIntroduce withServerErrorRetry with 3 retries and exponential backoff for 5xx WorkflowAPIErrors.
.changeset/retry-5xx-step-handler.mdPatch 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 threadpackages/core/src/runtime/step-handler.ts Outdated
Comment threadpackages/core/src/runtime/helpers.ts Outdated
Comment on lines +120 to +126
const startResult = await withServerErrorRetry(() =>
world.events.create(workflowRunId, {
eventType: 'step_started',
specVersion: SPEC_VERSION_CURRENT,
correlationId: stepId,
})
);

CopilotAIFeb 11, 2026

Copy link

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
Copy Markdown
ContributorAuthor

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
@vercel

vercelBot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

@VaguelySeriousVaguelySerious left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

Comment threadpackages/core/src/runtime/step-handler.ts
Comment threadpackages/world-vercel/src/queue.ts Outdated
};
}
// Wrap VQS server errors as WorkflowAPIError so withServerErrorRetry can catch them
if (error instanceof InternalServerError) {

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.

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

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

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
pranaygpand others added 6 commits February 12, 2026 16:45
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
VQS throws its own error types (InternalServerError, ConsumerDiscoveryError,
ConsumerRegistryNotConfiguredError) that don't match WorkflowAPIError.is().
Wrapping them at the world-vercel boundary enables withServerErrorRetry in
queueMessage() to automatically retry transient queue failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Queue retrying will be handled natively by the @vercel/queue client
instead. Reverts VQS error wrapping and withServerErrorRetry in
queueMessage().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

4 participants

@pranaygp@ctgowrie@VaguelySerious
, '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

Retry 5xx errors from workflow-server in step handler - #1011

Merged
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx
Feb 13, 2026
Merged

Retry 5xx errors from workflow-server in step handler#1011
pranaygp merged 6 commits into
mainfrom
pranaygp/retry-5xx

Conversation

@pranaygp

@pranaygppranaygp commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

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.

read on:

AI

Summary

  • Add withServerErrorRetry helper that retries world calls on 5xx errors 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

Extends the 5xx retry behavior from #966 to the step handler. The key insight: transient workflow-server errors should be retried silently without consuming step attempts, while persistent errors bubble to the queue for higher-level retry.

Tests added

  • Unit tests (helpers.test.ts): 26 tests covering getWorkflowQueueName (10 tests), withServerErrorRetry (7 tests) and withThrottleRetry (9 tests) — success passthrough, retry on 5xx with exponential backoff, retry exhaustion, non-retryable error passthrough, short/long retryAfter handling, double-throttle deferral, and default retryAfter behavior
  • 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
  • Unit tests: pnpm vitest run packages/core/src/runtime/helpers.test.ts — 26 tests pass
  • E2E test: serverError5xxRetryWorkflow passes locally against nextjs-turbopack dev server
  • CI e2e tests pass

🤖 Generated with Claude Code

CopilotAI review requested due to automatic review settings February 11, 2026 23:53
@changeset-bot

changeset-botBot commented Feb 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 87a0c91

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

This PR includes changesets to release 14 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/world-testingPatch
@workflow/nuxtPatch

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

github-actionsBot commented Feb 11, 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🥇 Nitro0.032s (-1.9%)1.005s (~)0.973s101.00x
💻 LocalExpress0.032s (+0.9%)1.005s (~)0.973s101.01x
💻 LocalNext.js (Turbopack)0.040s (-6.4% 🟢)1.005s (~)0.965s101.25x
🌐 RedisNext.js (Turbopack)0.050s (+9.2% 🔺)1.005s (~)0.955s101.58x
🌐 MongoDBNext.js (Turbopack)0.087s (-7.9% 🟢)1.008s (~)0.921s102.74x
🐘 PostgresExpress0.170s (-63.5% 🟢)1.009s (-1.0%)0.839s105.39x
🐘 PostgresNitro0.216s (+74.9% 🔺)1.011s (~)0.795s106.83x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.732s (+12.1% 🔺)2.012s (+4.9%)1.280s101.00x
▲ VercelNext.js (Turbopack)0.895s (+46.6% 🔺)2.300s (+24.4% 🔺)1.404s101.22x
▲ VercelNitro1.720s (+175.8% 🔺)2.964s (+46.7% 🔺)1.244s102.35x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.099s (-1.1%)2.006s (~)0.906s101.00x
💻 LocalExpress1.104s (~)2.006s (~)0.902s101.00x
💻 LocalNitro1.105s (~)2.006s (~)0.901s101.00x
🌐 RedisNext.js (Turbopack)1.108s (~)2.006s (~)0.898s101.01x
🌐 MongoDBNext.js (Turbopack)1.308s (+1.0%)2.008s (~)0.700s101.19x
🐘 PostgresExpress2.205s (-7.5% 🟢)3.014s (~)0.809s102.01x
🐘 PostgresNitro2.432s (+1.0%)3.015s (~)0.582s102.21x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.506s (~)3.483s (-1.5%)0.977s101.00x
▲ VercelExpress2.621s (+2.2%)3.497s (~)0.876s101.05x
▲ VercelNitro2.988s (~)3.870s (-2.3%)0.882s101.19x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.723s (~)11.023s (~)0.301s31.00x
🌐 RedisNext.js (Turbopack)10.739s (~)11.023s (~)0.284s31.00x
💻 LocalNitro10.816s (~)11.023s (~)0.206s31.01x
💻 LocalExpress10.821s (~)11.022s (~)0.200s31.01x
🌐 MongoDBNext.js (Turbopack)12.275s (~)13.021s (~)0.746s31.14x
🐘 PostgresNitro20.298s (~)21.061s (~)0.763s21.89x
🐘 PostgresExpress20.438s (+1.0%)21.056s (~)0.619s21.91x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.453s (+2.1%)20.661s (+4.8%)1.208s21.00x
▲ VercelNext.js (Turbopack)19.520s (+1.0%)20.949s (-1.2%)1.429s21.00x
▲ VercelNitro19.598s (+4.2%)20.245s (-1.7%)0.648s21.01x

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

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)26.968s (~)27.052s (~)0.084s31.00x
💻 LocalNext.js (Turbopack)27.202s (~)28.051s (~)0.849s31.01x
💻 LocalNitro27.466s (~)28.049s (~)0.583s31.02x
💻 LocalExpress27.495s (~)28.051s (~)0.556s31.02x
🌐 MongoDBNext.js (Turbopack)30.477s (+0.5%)31.038s (~)0.561s21.13x
🐘 PostgresExpress50.233s (-0.5%)51.128s (~)0.895s21.86x
🐘 PostgresNitro50.309s (~)50.626s (-1.0%)0.318s21.87x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)48.800s (+3.8%)50.099s (+4.7%)1.299s21.00x
▲ VercelNitro50.597s (+8.0% 🔺)51.906s (+7.6% 🔺)1.309s21.04x
▲ VercelExpress51.275s (+10.9% 🔺)52.177s (+11.1% 🔺)0.903s21.05x

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

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)54.371s (~)55.100s (~)0.729s21.00x
💻 LocalNext.js (Turbopack)56.953s (~)57.105s (~)0.152s21.05x
💻 LocalNitro57.278s (~)58.100s (~)0.822s21.05x
💻 LocalExpress57.336s (~)58.102s (~)0.766s21.05x
🌐 MongoDBNext.js (Turbopack)61.116s (+0.7%)61.576s (+0.9%)0.460s21.12x
🐘 PostgresExpress79.580s (-20.5% 🟢)80.178s (-20.0% 🟢)0.598s21.46x
🐘 PostgresNitro100.195s (~)100.236s (-1.0%)0.041s11.84x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express97.478s (+0.8%)98.523s (+0.5%)1.045s11.00x
▲ VercelNitro98.857s (+2.0%)100.171s (+2.8%)1.314s11.01x
▲ VercelNext.js (Turbopack)104.292s (+5.7% 🔺)105.129s (+6.2% 🔺)0.837s11.07x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.241s (~)2.006s (~)0.765s151.00x
💻 LocalNitro1.406s (-0.8%)2.006s (~)0.599s151.13x
💻 LocalExpress1.410s (~)2.005s (~)0.596s151.14x
💻 LocalNext.js (Turbopack)1.419s (+1.4%)2.006s (~)0.586s151.14x
🌐 MongoDBNext.js (Turbopack)2.168s (~)3.008s (~)0.840s101.75x
🐘 PostgresNitro2.182s (-9.5% 🟢)3.014s (~)0.833s101.76x
🐘 PostgresExpress2.233s (+3.2%)2.596s (-13.9% 🟢)0.363s121.80x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.807s (+4.5%)3.681s (+6.5% 🔺)0.874s91.00x
▲ VercelNext.js (Turbopack)3.014s (+2.9%)4.310s (+7.5% 🔺)1.296s81.07x
▲ VercelNitro3.569s (+34.5% 🔺)4.444s (+16.9% 🔺)0.874s71.27x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.513s (~)3.008s (~)0.495s101.00x
💻 LocalNitro2.599s (-0.8%)3.007s (~)0.408s101.03x
💻 LocalExpress2.635s (+2.2%)3.007s (~)0.372s101.05x
💻 LocalNext.js (Turbopack)2.705s (+5.2% 🔺)3.007s (~)0.302s101.08x
🌐 MongoDBNext.js (Turbopack)4.734s (-0.9%)5.177s (~)0.443s61.88x
🐘 PostgresNitro8.542s (-3.7%)9.043s (-2.6%)0.501s43.40x
🐘 PostgresExpress10.213s (+20.2% 🔺)10.698s (+18.3% 🔺)0.485s34.06x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.038s (-3.4%)4.161s (-0.9%)1.124s81.00x
▲ VercelNitro3.270s (-19.7% 🟢)4.475s (-19.5% 🟢)1.205s71.08x
▲ VercelNext.js (Turbopack)3.982s (+16.6% 🔺)5.435s (+21.6% 🔺)1.452s61.31x

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

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.116s (+1.5%)4.868s (+3.0%)0.751s71.00x
💻 LocalNext.js (Turbopack)7.175s (~)7.766s (+2.0%)0.590s41.74x
💻 LocalNitro7.456s (-2.9%)8.021s (~)0.564s41.81x
💻 LocalExpress7.622s (+2.6%)8.019s (~)0.397s41.85x
🌐 MongoDBNext.js (Turbopack)9.837s (+1.2%)10.349s (~)0.512s32.39x
🐘 PostgresNitro49.785s (+6.5% 🔺)50.124s (+6.4% 🔺)0.339s112.09x
🐘 PostgresExpress50.464s (+10.3% 🔺)51.121s (+10.9% 🔺)0.657s112.26x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.460s (-12.5% 🟢)4.682s (-8.0% 🟢)1.223s71.00x
▲ VercelExpress3.921s (+21.7% 🔺)5.187s (+6.3% 🔺)1.265s61.13x
▲ VercelNext.js (Turbopack)3.997s (+6.3% 🔺)5.343s (+4.1%)1.346s61.16x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.264s (~)2.006s (~)0.742s151.00x
💻 LocalNext.js (Turbopack)1.428s (~)2.005s (~)0.577s151.13x
💻 LocalExpress1.439s (+1.4%)2.004s (~)0.565s151.14x
💻 LocalNitro1.440s (-1.5%)2.006s (~)0.566s151.14x
🐘 PostgresNitro2.137s (-5.2% 🟢)2.513s (-14.0% 🟢)0.376s121.69x
🌐 MongoDBNext.js (Turbopack)2.155s (-1.1%)3.009s (~)0.854s101.70x
🐘 PostgresExpress2.221s (-5.3% 🟢)2.512s (-16.6% 🟢)0.291s121.76x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.510s (-4.9%)3.456s (+1.9%)0.946s91.00x
▲ VercelExpress2.720s (+11.2% 🔺)3.578s (+3.6%)0.858s91.08x
▲ VercelNitro2.792s (+14.2% 🔺)4.239s (+17.8% 🔺)1.447s81.11x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)2.508s (~)3.008s (~)0.500s101.00x
💻 LocalNitro2.701s (-1.7%)3.007s (~)0.306s101.08x
💻 LocalExpress2.729s (+3.1%)3.007s (~)0.278s101.09x
💻 LocalNext.js (Turbopack)2.837s (+5.8% 🔺)3.007s (~)0.171s101.13x
🌐 MongoDBNext.js (Turbopack)4.806s (~)5.177s (~)0.372s61.92x
🐘 PostgresNitro11.404s (+47.4% 🔺)11.705s (+41.4% 🔺)0.301s34.55x
🐘 PostgresExpress12.784s (+22.5% 🔺)13.032s (+18.1% 🔺)0.248s35.10x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.883s (-24.3% 🟢)4.226s (-19.5% 🟢)1.343s81.00x
▲ VercelExpress2.954s (+11.4% 🔺)3.834s (+7.2% 🔺)0.880s81.02x
▲ VercelNext.js (Turbopack)3.008s (-3.1%)4.370s (-1.0%)1.362s71.04x

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

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)4.136s (~)4.868s (~)0.732s71.00x
💻 LocalNext.js (Turbopack)7.242s (-5.0%)7.766s (-8.8% 🟢)0.525s41.75x
💻 LocalNitro7.944s (-1.2%)8.269s (-5.7% 🟢)0.325s41.92x
💻 LocalExpress8.083s (+3.4%)9.023s (+12.5% 🔺)0.939s41.95x
🌐 MongoDBNext.js (Turbopack)9.944s (~)10.684s (+3.3%)0.740s32.40x
🐘 PostgresNitro52.383s (+14.5% 🔺)53.118s (+15.2% 🔺)0.735s112.66x
🐘 PostgresExpress53.132s (+1.3%)54.116s (+1.8%)0.984s112.85x
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.058s (-25.8% 🟢)3.931s (-24.6% 🟢)0.874s81.00x
▲ VercelNext.js (Turbopack)4.041s (-2.4%)5.520s (-1.5%)1.479s61.32x
▲ VercelNitro4.841s (+55.5% 🔺)6.079s (+33.8% 🔺)1.239s61.58x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.147s (-2.1%)1.001s (~)0.011s (+12.9% 🔺)1.017s (~)0.870s101.00x
🌐 RedisNext.js (Turbopack)0.150s (-2.2%)1.000s (~)0.001s (-7.1% 🟢)1.007s (~)0.857s101.02x
💻 LocalNitro0.168s (-3.7%)1.002s (~)0.011s (-1.8%)1.016s (~)0.848s101.15x
💻 LocalExpress0.175s (+3.7%)1.003s (~)0.011s (-3.4%)1.017s (~)0.841s101.19x
🌐 MongoDBNext.js (Turbopack)0.504s (+5.6% 🔺)0.943s (-2.5%)0.002s (+14.3% 🔺)1.008s (~)0.505s103.43x
🐘 PostgresExpress1.408s (-38.2% 🟢)1.626s (-41.2% 🟢)0.001s (-13.3% 🟢)2.013s (-33.3% 🟢)0.604s109.58x
🐘 PostgresNitro2.290s (-7.2% 🟢)2.754s (+6.9% 🔺)0.001s (+8.3% 🔺)3.016s (~)0.726s1015.58x
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.434s (+3.3%)2.752s (-3.2%)0.238s (+27.2% 🔺)3.633s (~)1.198s101.00x
▲ VercelExpress2.444s (+5.3% 🔺)2.720s (+0.6%)0.284s (+40.6% 🔺)3.690s (+5.2% 🔺)1.246s101.00x
▲ VercelNext.js (Turbopack)2.578s (+7.5% 🔺)3.116s (+1.6%)0.178s (-35.5% 🟢)4.055s (+2.9%)1.478s101.06x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/12
🐘 PostgresNitro7/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local10/12
Next.js (Turbopack)🌐 Redis6/12
Nitro💻 Local10/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

github-actionsBot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production501038539
✅ 💻 Local Development428062490
✅ 📦 Local Production428062490
✅ 🐘 Local Postgres428062490
✅ 🪟 Windows460349
❌ 🌍 Community Worlds104439156
✅ 📋 Other126021147
Total2061432572361

❌ Failed Tests

🌍 Community Worlds (43 failed)

mongodb (1 failed):

  • webhookWorkflow

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
AppPassedFailedSkipped
✅ astro4504
✅ example4504
✅ express4504
✅ fastify4504
✅ hono4504
✅ nextjs-turbopack4801
✅ nextjs-webpack4801
✅ nitro4504
✅ nuxt4504
✅ sveltekit4504
✅ vite4504
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable4207
✅ express-stable4207
✅ fastify-stable4207
✅ hono-stable4207
✅ nextjs-turbopack-stable4603
✅ nextjs-webpack-stable4603
✅ nitro-stable4207
✅ nuxt-stable4207
✅ sveltekit-stable4207
✅ vite-stable4207
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack4603
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb4513
✅ redis-dev300
✅ redis4603
✅ turso-dev300
❌ turso4423
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable4207
✅ e2e-local-postgres-nest-stable4207
✅ e2e-local-prod-nest-stable4207

📋 View full workflow run

CopilotAI 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.

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.

FileDescription
packages/core/src/runtime/step-handler.tsWrap step lifecycle event creation with 5xx retry; add logic to rethrow persistent 5xx to defer to queue retry.
packages/core/src/runtime/helpers.tsIntroduce withServerErrorRetry with 3 retries and exponential backoff for 5xx WorkflowAPIErrors.
.changeset/retry-5xx-step-handler.mdPatch 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 threadpackages/core/src/runtime/step-handler.ts Outdated
Comment threadpackages/core/src/runtime/helpers.ts Outdated
Comment on lines +120 to +126
const startResult = await withServerErrorRetry(() =>
world.events.create(workflowRunId, {
eventType: 'step_started',
specVersion: SPEC_VERSION_CURRENT,
correlationId: stepId,
})
);

CopilotAIFeb 11, 2026

Copy link

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
Copy Markdown
ContributorAuthor

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
@vercel

vercelBot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

@VaguelySeriousVaguelySerious left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

Comment threadpackages/core/src/runtime/step-handler.ts
Comment threadpackages/world-vercel/src/queue.ts Outdated
};
}
// Wrap VQS server errors as WorkflowAPIError so withServerErrorRetry can catch them
if (error instanceof InternalServerError) {

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.

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

@pranaygp

Copy link
Copy Markdown
ContributorAuthor

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
pranaygpand others added 6 commits February 12, 2026 16:45
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 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
VQS throws its own error types (InternalServerError, ConsumerDiscoveryError,
ConsumerRegistryNotConfiguredError) that don't match WorkflowAPIError.is().
Wrapping them at the world-vercel boundary enables withServerErrorRetry in
queueMessage() to automatically retry transient queue failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Queue retrying will be handled natively by the @vercel/queue client
instead. Reverts VQS error wrapping and withServerErrorRetry in
queueMessage().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

4 participants

@pranaygp@ctgowrie@VaguelySerious