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

@pranaygp pranaygp commented Feb 11, 2026

Human (hey it's me Pranay)

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

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

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

changeset-bot Bot commented Feb 11, 2026

🦋 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
Name Type
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/web-shared Patch
workflow Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/world-testing Patch
@workflow/nuxt Patch

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

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 11, 2026

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 0.032s (-1.9%) 1.005s (~) 0.973s 10 1.00x
💻 Local Express 0.032s (+0.9%) 1.005s (~) 0.973s 10 1.01x
💻 Local Next.js (Turbopack) 0.040s (-6.4% 🟢) 1.005s (~) 0.965s 10 1.25x
🌐 Redis Next.js (Turbopack) 0.050s (+9.2% 🔺) 1.005s (~) 0.955s 10 1.58x
🌐 MongoDB Next.js (Turbopack) 0.087s (-7.9% 🟢) 1.008s (~) 0.921s 10 2.74x
🐘 Postgres Express 0.170s (-63.5% 🟢) 1.009s (-1.0%) 0.839s 10 5.39x
🐘 Postgres Nitro 0.216s (+74.9% 🔺) 1.011s (~) 0.795s 10 6.83x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 0.732s (+12.1% 🔺) 2.012s (+4.9%) 1.280s 10 1.00x
▲ Vercel Next.js (Turbopack) 0.895s (+46.6% 🔺) 2.300s (+24.4% 🔺) 1.404s 10 1.22x
▲ Vercel Nitro 1.720s (+175.8% 🔺) 2.964s (+46.7% 🔺) 1.244s 10 2.35x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 1.099s (-1.1%) 2.006s (~) 0.906s 10 1.00x
💻 Local Express 1.104s (~) 2.006s (~) 0.902s 10 1.00x
💻 Local Nitro 1.105s (~) 2.006s (~) 0.901s 10 1.00x
🌐 Redis Next.js (Turbopack) 1.108s (~) 2.006s (~) 0.898s 10 1.01x
🌐 MongoDB Next.js (Turbopack) 1.308s (+1.0%) 2.008s (~) 0.700s 10 1.19x
🐘 Postgres Express 2.205s (-7.5% 🟢) 3.014s (~) 0.809s 10 2.01x
🐘 Postgres Nitro 2.432s (+1.0%) 3.015s (~) 0.582s 10 2.21x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.506s (~) 3.483s (-1.5%) 0.977s 10 1.00x
▲ Vercel Express 2.621s (+2.2%) 3.497s (~) 0.876s 10 1.05x
▲ Vercel Nitro 2.988s (~) 3.870s (-2.3%) 0.882s 10 1.19x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 10.723s (~) 11.023s (~) 0.301s 3 1.00x
🌐 Redis Next.js (Turbopack) 10.739s (~) 11.023s (~) 0.284s 3 1.00x
💻 Local Nitro 10.816s (~) 11.023s (~) 0.206s 3 1.01x
💻 Local Express 10.821s (~) 11.022s (~) 0.200s 3 1.01x
🌐 MongoDB Next.js (Turbopack) 12.275s (~) 13.021s (~) 0.746s 3 1.14x
🐘 Postgres Nitro 20.298s (~) 21.061s (~) 0.763s 2 1.89x
🐘 Postgres Express 20.438s (+1.0%) 21.056s (~) 0.619s 2 1.91x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 19.453s (+2.1%) 20.661s (+4.8%) 1.208s 2 1.00x
▲ Vercel Next.js (Turbopack) 19.520s (+1.0%) 20.949s (-1.2%) 1.429s 2 1.00x
▲ Vercel Nitro 19.598s (+4.2%) 20.245s (-1.7%) 0.648s 2 1.01x

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

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 26.968s (~) 27.052s (~) 0.084s 3 1.00x
💻 Local Next.js (Turbopack) 27.202s (~) 28.051s (~) 0.849s 3 1.01x
💻 Local Nitro 27.466s (~) 28.049s (~) 0.583s 3 1.02x
💻 Local Express 27.495s (~) 28.051s (~) 0.556s 3 1.02x
🌐 MongoDB Next.js (Turbopack) 30.477s (+0.5%) 31.038s (~) 0.561s 2 1.13x
🐘 Postgres Express 50.233s (-0.5%) 51.128s (~) 0.895s 2 1.86x
🐘 Postgres Nitro 50.309s (~) 50.626s (-1.0%) 0.318s 2 1.87x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 48.800s (+3.8%) 50.099s (+4.7%) 1.299s 2 1.00x
▲ Vercel Nitro 50.597s (+8.0% 🔺) 51.906s (+7.6% 🔺) 1.309s 2 1.04x
▲ Vercel Express 51.275s (+10.9% 🔺) 52.177s (+11.1% 🔺) 0.903s 2 1.05x

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

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 54.371s (~) 55.100s (~) 0.729s 2 1.00x
💻 Local Next.js (Turbopack) 56.953s (~) 57.105s (~) 0.152s 2 1.05x
💻 Local Nitro 57.278s (~) 58.100s (~) 0.822s 2 1.05x
💻 Local Express 57.336s (~) 58.102s (~) 0.766s 2 1.05x
🌐 MongoDB Next.js (Turbopack) 61.116s (+0.7%) 61.576s (+0.9%) 0.460s 2 1.12x
🐘 Postgres Express 79.580s (-20.5% 🟢) 80.178s (-20.0% 🟢) 0.598s 2 1.46x
🐘 Postgres Nitro 100.195s (~) 100.236s (-1.0%) 0.041s 1 1.84x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 97.478s (+0.8%) 98.523s (+0.5%) 1.045s 1 1.00x
▲ Vercel Nitro 98.857s (+2.0%) 100.171s (+2.8%) 1.314s 1 1.01x
▲ Vercel Next.js (Turbopack) 104.292s (+5.7% 🔺) 105.129s (+6.2% 🔺) 0.837s 1 1.07x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.241s (~) 2.006s (~) 0.765s 15 1.00x
💻 Local Nitro 1.406s (-0.8%) 2.006s (~) 0.599s 15 1.13x
💻 Local Express 1.410s (~) 2.005s (~) 0.596s 15 1.14x
💻 Local Next.js (Turbopack) 1.419s (+1.4%) 2.006s (~) 0.586s 15 1.14x
🌐 MongoDB Next.js (Turbopack) 2.168s (~) 3.008s (~) 0.840s 10 1.75x
🐘 Postgres Nitro 2.182s (-9.5% 🟢) 3.014s (~) 0.833s 10 1.76x
🐘 Postgres Express 2.233s (+3.2%) 2.596s (-13.9% 🟢) 0.363s 12 1.80x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.807s (+4.5%) 3.681s (+6.5% 🔺) 0.874s 9 1.00x
▲ Vercel Next.js (Turbopack) 3.014s (+2.9%) 4.310s (+7.5% 🔺) 1.296s 8 1.07x
▲ Vercel Nitro 3.569s (+34.5% 🔺) 4.444s (+16.9% 🔺) 0.874s 7 1.27x

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

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 2.513s (~) 3.008s (~) 0.495s 10 1.00x
💻 Local Nitro 2.599s (-0.8%) 3.007s (~) 0.408s 10 1.03x
💻 Local Express 2.635s (+2.2%) 3.007s (~) 0.372s 10 1.05x
💻 Local Next.js (Turbopack) 2.705s (+5.2% 🔺) 3.007s (~) 0.302s 10 1.08x
🌐 MongoDB Next.js (Turbopack) 4.734s (-0.9%) 5.177s (~) 0.443s 6 1.88x
🐘 Postgres Nitro 8.542s (-3.7%) 9.043s (-2.6%) 0.501s 4 3.40x
🐘 Postgres Express 10.213s (+20.2% 🔺) 10.698s (+18.3% 🔺) 0.485s 3 4.06x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.038s (-3.4%) 4.161s (-0.9%) 1.124s 8 1.00x
▲ Vercel Nitro 3.270s (-19.7% 🟢) 4.475s (-19.5% 🟢) 1.205s 7 1.08x
▲ Vercel Next.js (Turbopack) 3.982s (+16.6% 🔺) 5.435s (+21.6% 🔺) 1.452s 6 1.31x

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

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 4.116s (+1.5%) 4.868s (+3.0%) 0.751s 7 1.00x
💻 Local Next.js (Turbopack) 7.175s (~) 7.766s (+2.0%) 0.590s 4 1.74x
💻 Local Nitro 7.456s (-2.9%) 8.021s (~) 0.564s 4 1.81x
💻 Local Express 7.622s (+2.6%) 8.019s (~) 0.397s 4 1.85x
🌐 MongoDB Next.js (Turbopack) 9.837s (+1.2%) 10.349s (~) 0.512s 3 2.39x
🐘 Postgres Nitro 49.785s (+6.5% 🔺) 50.124s (+6.4% 🔺) 0.339s 1 12.09x
🐘 Postgres Express 50.464s (+10.3% 🔺) 51.121s (+10.9% 🔺) 0.657s 1 12.26x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.460s (-12.5% 🟢) 4.682s (-8.0% 🟢) 1.223s 7 1.00x
▲ Vercel Express 3.921s (+21.7% 🔺) 5.187s (+6.3% 🔺) 1.265s 6 1.13x
▲ Vercel Next.js (Turbopack) 3.997s (+6.3% 🔺) 5.343s (+4.1%) 1.346s 6 1.16x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.264s (~) 2.006s (~) 0.742s 15 1.00x
💻 Local Next.js (Turbopack) 1.428s (~) 2.005s (~) 0.577s 15 1.13x
💻 Local Express 1.439s (+1.4%) 2.004s (~) 0.565s 15 1.14x
💻 Local Nitro 1.440s (-1.5%) 2.006s (~) 0.566s 15 1.14x
🐘 Postgres Nitro 2.137s (-5.2% 🟢) 2.513s (-14.0% 🟢) 0.376s 12 1.69x
🌐 MongoDB Next.js (Turbopack) 2.155s (-1.1%) 3.009s (~) 0.854s 10 1.70x
🐘 Postgres Express 2.221s (-5.3% 🟢) 2.512s (-16.6% 🟢) 0.291s 12 1.76x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.510s (-4.9%) 3.456s (+1.9%) 0.946s 9 1.00x
▲ Vercel Express 2.720s (+11.2% 🔺) 3.578s (+3.6%) 0.858s 9 1.08x
▲ Vercel Nitro 2.792s (+14.2% 🔺) 4.239s (+17.8% 🔺) 1.447s 8 1.11x

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

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 2.508s (~) 3.008s (~) 0.500s 10 1.00x
💻 Local Nitro 2.701s (-1.7%) 3.007s (~) 0.306s 10 1.08x
💻 Local Express 2.729s (+3.1%) 3.007s (~) 0.278s 10 1.09x
💻 Local Next.js (Turbopack) 2.837s (+5.8% 🔺) 3.007s (~) 0.171s 10 1.13x
🌐 MongoDB Next.js (Turbopack) 4.806s (~) 5.177s (~) 0.372s 6 1.92x
🐘 Postgres Nitro 11.404s (+47.4% 🔺) 11.705s (+41.4% 🔺) 0.301s 3 4.55x
🐘 Postgres Express 12.784s (+22.5% 🔺) 13.032s (+18.1% 🔺) 0.248s 3 5.10x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.883s (-24.3% 🟢) 4.226s (-19.5% 🟢) 1.343s 8 1.00x
▲ Vercel Express 2.954s (+11.4% 🔺) 3.834s (+7.2% 🔺) 0.880s 8 1.02x
▲ Vercel Next.js (Turbopack) 3.008s (-3.1%) 4.370s (-1.0%) 1.362s 7 1.04x

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

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 4.136s (~) 4.868s (~) 0.732s 7 1.00x
💻 Local Next.js (Turbopack) 7.242s (-5.0%) 7.766s (-8.8% 🟢) 0.525s 4 1.75x
💻 Local Nitro 7.944s (-1.2%) 8.269s (-5.7% 🟢) 0.325s 4 1.92x
💻 Local Express 8.083s (+3.4%) 9.023s (+12.5% 🔺) 0.939s 4 1.95x
🌐 MongoDB Next.js (Turbopack) 9.944s (~) 10.684s (+3.3%) 0.740s 3 2.40x
🐘 Postgres Nitro 52.383s (+14.5% 🔺) 53.118s (+15.2% 🔺) 0.735s 1 12.66x
🐘 Postgres Express 53.132s (+1.3%) 54.116s (+1.8%) 0.984s 1 12.85x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 3.058s (-25.8% 🟢) 3.931s (-24.6% 🟢) 0.874s 8 1.00x
▲ Vercel Next.js (Turbopack) 4.041s (-2.4%) 5.520s (-1.5%) 1.479s 6 1.32x
▲ Vercel Nitro 4.841s (+55.5% 🔺) 6.079s (+33.8% 🔺) 1.239s 6 1.58x

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

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 0.147s (-2.1%) 1.001s (~) 0.011s (+12.9% 🔺) 1.017s (~) 0.870s 10 1.00x
🌐 Redis Next.js (Turbopack) 0.150s (-2.2%) 1.000s (~) 0.001s (-7.1% 🟢) 1.007s (~) 0.857s 10 1.02x
💻 Local Nitro 0.168s (-3.7%) 1.002s (~) 0.011s (-1.8%) 1.016s (~) 0.848s 10 1.15x
💻 Local Express 0.175s (+3.7%) 1.003s (~) 0.011s (-3.4%) 1.017s (~) 0.841s 10 1.19x
🌐 MongoDB Next.js (Turbopack) 0.504s (+5.6% 🔺) 0.943s (-2.5%) 0.002s (+14.3% 🔺) 1.008s (~) 0.505s 10 3.43x
🐘 Postgres Express 1.408s (-38.2% 🟢) 1.626s (-41.2% 🟢) 0.001s (-13.3% 🟢) 2.013s (-33.3% 🟢) 0.604s 10 9.58x
🐘 Postgres Nitro 2.290s (-7.2% 🟢) 2.754s (+6.9% 🔺) 0.001s (+8.3% 🔺) 3.016s (~) 0.726s 10 15.58x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.434s (+3.3%) 2.752s (-3.2%) 0.238s (+27.2% 🔺) 3.633s (~) 1.198s 10 1.00x
▲ Vercel Express 2.444s (+5.3% 🔺) 2.720s (+0.6%) 0.284s (+40.6% 🔺) 3.690s (+5.2% 🔺) 1.246s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.578s (+7.5% 🔺) 3.116s (+1.6%) 0.178s (-35.5% 🟢) 4.055s (+2.9%) 1.478s 10 1.06x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 11, 2026

🧪 E2E Test Results

Some tests failed

Summary

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

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

📋 View full workflow run

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Changes:

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

Reviewed changes

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

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

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

Comment thread packages/core/src/runtime/step-handler.ts Outdated
Comment thread packages/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,
})
);
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

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

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

@pranaygp pranaygp marked this pull request as draft February 12, 2026 01:12
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 12, 2026

Copy link
Copy Markdown
Member

@VaguelySerious VaguelySerious left a comment

Choose a reason for hiding this comment

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

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

export async function withServerErrorRetry<T>(
fn: () => Promise<T>
): Promise<T> {
const delays = [500, 1000, 2000];
Copy link
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 thread packages/core/src/runtime/step-handler.ts
Comment thread packages/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
Contributor Author

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

@pranaygp pranaygp marked this pull request as draft February 12, 2026 21:58
pranaygp and 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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants