Retry failed VQS handlers immediately - #1999

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry
May 15, 2026
Merged

Retry failed VQS handlers immediately#1999
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry

Conversation

@pranaygp

@pranaygppranaygp commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

When the Workflow queue handler throws, ask VQS to make the current message visible immediately instead of waiting for the default 300 second visibility lease to expire.

Root cause: the generated Workflow trigger config uses retryAfterSeconds: 5, but @workflow/world-vercel called QueueClient.handleCallback without a retry option. On handler failure, @vercel/queue propagated the error and the message stayed locked for the client default visibilityTimeoutSeconds: 300.

Changes

  • Pass retry: () => ({ afterSeconds: 0 }) to the VQS callback handler in @workflow/world-vercel.
  • Add a unit test asserting the retry directive is wired into handleCallback.
  • Add a patch changeset for @workflow/world-vercel.

Validation

  • git diff --check -- packages/world-vercel/src/queue.ts packages/world-vercel/src/queue.test.ts .changeset/retry-vqs-handler-errors-immediately.md
  • pnpm install with Node v24.15.0
  • pnpm --filter @workflow/utils build
  • pnpm --filter @workflow/errors build
  • pnpm --filter @workflow/world build
  • pnpm --filter @workflow/world-vercel build
  • pnpm --filter @workflow/world-vercel test -- queue.test.ts (69 tests passed)

CopilotAI review requested due to automatic review settings May 14, 2026 23:19
@pranaygp
pranaygp requested a review from a team as a code ownerMay 14, 2026 23:19
@changeset-bot

changeset-botBot commented May 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 45feb40

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

This PR includes changesets to release 19 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
tarballsPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@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

@vercel

vercelBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.025s (-44.0% 🟢)1.004s (~)0.979s101.00x
💻 LocalNitro0.030s (-29.7% 🟢)1.005s (~)0.975s101.22x
🐘 PostgresNitro0.054s (-43.2% 🟢)1.012s (-2.9%)0.958s102.18x
🐘 PostgresExpress0.063s (+9.3% 🔺)1.022s (+1.1%)0.959s102.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.231s (-43.7% 🟢)1.905s (-24.1% 🟢)1.675s101.00x
▲ VercelNext.js (Turbopack)0.304s (+20.9% 🔺)2.565s (+9.9% 🔺)2.261s101.32x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.056s (-6.2% 🟢)2.005s (~)0.949s101.00x
💻 LocalNitro1.065s (-5.8% 🟢)2.006s (~)0.941s101.01x
🐘 PostgresNitro1.082s (-5.1% 🟢)2.009s (~)0.927s101.02x
🐘 PostgresExpress1.086s (-5.3% 🟢)2.009s (~)0.923s101.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.602s (-21.3% 🟢)3.795s (-0.9%)2.193s101.00x
▲ VercelNitro1.681s (-56.8% 🟢)3.658s (-38.1% 🟢)1.976s101.05x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.327s (-5.4% 🟢)11.020s (~)0.693s31.00x
💻 LocalNitro10.404s (-4.9%)11.023s (~)0.618s31.01x
🐘 PostgresExpress10.417s (-5.0%)11.016s (~)0.599s31.01x
🐘 PostgresNitro10.427s (-4.1%)11.018s (~)0.591s31.01x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro13.713s (-42.2% 🟢)15.652s (-37.7% 🟢)1.939s21.00x
▲ VercelNext.js (Turbopack)13.851s (-20.0% 🟢)16.149s (-16.8% 🟢)2.299s21.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express13.252s (-11.5% 🟢)14.024s (-6.7% 🟢)0.772s51.00x
💻 LocalNitro13.425s (-10.9% 🟢)14.028s (-12.5% 🟢)0.603s51.01x
🐘 PostgresNitro13.454s (-7.8% 🟢)14.017s (-6.7% 🟢)0.563s51.02x
🐘 PostgresExpress13.530s (-7.2% 🟢)14.018s (-6.7% 🟢)0.488s51.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)21.402s (-59.3% 🟢)23.235s (-57.5% 🟢)1.833s31.00x
▲ VercelNitro21.447s (-66.7% 🟢)23.241s (-65.1% 🟢)1.794s31.00x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express11.579s (-30.3% 🟢)12.021s (-29.4% 🟢)0.443s81.00x
💻 LocalNitro11.845s (-29.4% 🟢)12.024s (-29.4% 🟢)0.179s81.02x
🐘 PostgresNitro12.024s (-13.9% 🟢)12.643s (-11.6% 🟢)0.619s81.04x
🐘 PostgresExpress12.057s (-13.9% 🟢)12.516s (-14.2% 🟢)0.459s81.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro35.366s (-91.6% 🟢)37.002s (-91.3% 🟢)1.636s31.00x
▲ VercelNext.js (Turbopack)36.089s (-90.8% 🟢)39.185s (-90.1% 🟢)3.096s31.02x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.135s (-23.7% 🟢)2.005s (~)0.870s151.00x
🐘 PostgresExpress1.136s (-9.8% 🟢)2.008s (~)0.871s151.00x
🐘 PostgresNitro1.145s (-10.2% 🟢)2.007s (~)0.862s151.01x
💻 LocalNitro1.173s (-28.1% 🟢)2.006s (-3.3%)0.833s151.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.552s (-9.4% 🟢)4.180s (-3.3%)1.627s81.00x
▲ VercelNext.js (Turbopack)2.792s (-17.8% 🟢)4.564s (-7.5% 🟢)1.772s71.09x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-48.7% 🟢)2.007s (-33.3% 🟢)0.797s151.00x
🐘 PostgresNitro1.272s (-45.9% 🟢)2.074s (-31.1% 🟢)0.802s151.05x
💻 LocalExpress1.553s (-47.4% 🟢)2.006s (-41.9% 🟢)0.453s151.28x
💻 LocalNitro1.678s (-46.6% 🟢)2.005s (-48.4% 🟢)0.327s151.39x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.458s (-37.2% 🟢)6.227s (-30.1% 🟢)1.769s61.00x
▲ VercelNitro5.689s (+40.4% 🔺)7.790s (+31.6% 🔺)2.101s41.28x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.328s (-61.9% 🟢)2.009s (-49.9% 🟢)0.680s151.00x
🐘 PostgresNitro1.395s (-59.9% 🟢)2.008s (-49.9% 🟢)0.613s151.05x
💻 LocalExpress3.522s (-57.8% 🟢)4.011s (-55.6% 🟢)0.488s82.65x
💻 LocalNitro4.447s (-46.7% 🟢)5.011s (-44.4% 🟢)0.564s63.35x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.432s (+54.1% 🔺)6.911s (+24.9% 🔺)1.479s51.00x
▲ VercelNext.js (Turbopack)5.852s (-34.4% 🟢)7.738s (-29.4% 🟢)1.886s41.08x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.152s (-8.4% 🟢)2.009s (~)0.857s151.00x
🐘 PostgresExpress1.158s (-7.9% 🟢)2.008s (~)0.850s151.01x
💻 LocalExpress1.238s (-34.6% 🟢)2.006s (-15.1% 🟢)0.768s151.07x
💻 LocalNitro1.376s (-26.2% 🟢)2.006s (-14.3% 🟢)0.629s151.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.483s (+1.0%)3.737s (-10.4% 🟢)1.254s91.00x
▲ VercelNext.js (Turbopack)2.575s (-12.2% 🟢)4.082s (-12.1% 🟢)1.507s81.04x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.209s (-48.3% 🟢)2.008s (-33.3% 🟢)0.799s151.00x
🐘 PostgresExpress1.219s (-47.9% 🟢)2.007s (-33.3% 🟢)0.788s151.01x
💻 LocalExpress1.644s (-47.5% 🟢)2.005s (-46.7% 🟢)0.361s151.36x
💻 LocalNitro2.046s (-33.2% 🟢)2.469s (-36.5% 🟢)0.423s131.69x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.040s (+25.0% 🔺)5.730s (+12.9% 🔺)1.690s61.00x
▲ VercelNext.js (Turbopack)4.073s (+29.6% 🔺)5.712s (+26.3% 🔺)1.638s61.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.322s (-62.0% 🟢)2.009s (-49.9% 🟢)0.687s151.00x
🐘 PostgresExpress1.324s (-62.2% 🟢)2.007s (-50.0% 🟢)0.684s151.00x
💻 LocalExpress4.114s (-53.3% 🟢)4.868s (-47.5% 🟢)0.754s73.11x
💻 LocalNitro4.825s (-47.2% 🟢)5.345s (-46.7% 🟢)0.520s63.65x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.443s (+6.9% 🔺)7.984s (+17.1% 🔺)2.541s41.00x
▲ VercelNext.js (Turbopack)6.066s (-10.2% 🟢)8.119s (-5.0%)2.054s41.11x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.443s (-46.0% 🟢)1.007s (~)0.564s601.00x
💻 LocalExpress0.448s (-54.5% 🟢)1.003s (-6.7% 🟢)0.556s601.01x
🐘 PostgresExpress0.467s (-44.3% 🟢)1.007s (-1.6%)0.540s601.05x
💻 LocalNitro0.525s (-46.4% 🟢)1.039s (-5.1% 🟢)0.513s581.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.693s (-78.7% 🟢)6.239s (-74.0% 🟢)1.546s101.00x
▲ VercelNext.js (Turbopack)5.172s (-64.3% 🟢)6.923s (-57.0% 🟢)1.751s91.10x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.075s (-44.2% 🟢)1.964s (-6.5% 🟢)0.889s461.00x
💻 LocalExpress1.093s (-63.7% 🟢)1.702s (-52.5% 🟢)0.609s531.02x
🐘 PostgresExpress1.138s (-42.4% 🟢)2.030s (-10.1% 🟢)0.892s451.06x
💻 LocalNitro1.159s (-61.8% 🟢)2.006s (-46.6% 🟢)0.847s451.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro12.782s (-67.6% 🟢)14.361s (-65.2% 🟢)1.580s71.00x
▲ VercelNext.js (Turbopack)12.891s (-74.1% 🟢)14.919s (-71.2% 🟢)2.027s71.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.211s (-46.1% 🟢)2.865s (-37.8% 🟢)0.654s421.00x
🐘 PostgresExpress2.219s (-44.4% 🟢)3.085s (-29.4% 🟢)0.866s391.00x
💻 LocalExpress2.310s (-74.9% 🟢)3.007s (-70.0% 🟢)0.697s401.04x
💻 LocalNitro2.659s (-71.4% 🟢)3.033s (-69.7% 🟢)0.373s401.20x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro41.221s (-57.5% 🟢)43.002s (-56.3% 🟢)1.781s41.00x
▲ VercelNext.js (Turbopack)41.812s (-61.0% 🟢)43.995s (-59.6% 🟢)2.183s31.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.177s (-37.5% 🟢)1.006s (~)0.829s601.00x
🐘 PostgresExpress0.178s (-37.1% 🟢)1.006s (~)0.829s601.00x
💻 LocalExpress0.376s (-32.9% 🟢)1.003s (~)0.627s602.12x
💻 LocalNitro0.430s (-29.0% 🟢)1.004s (-1.7%)0.574s602.43x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.619s (+57.7% 🔺)4.330s (+29.2% 🔺)1.711s141.00x
▲ VercelNext.js (Turbopack)2.972s (+46.9% 🔺)5.256s (+38.5% 🔺)2.284s121.13x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.307s (-38.1% 🟢)1.007s (~)0.699s901.00x
🐘 PostgresExpress0.311s (-39.0% 🟢)1.014s (+0.7%)0.702s891.01x
💻 LocalExpress1.849s (-26.4% 🟢)2.252s (-25.2% 🟢)0.402s416.02x
💻 LocalNitro2.152s (-15.2% 🟢)2.797s (-7.1% 🟢)0.645s337.00x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.983s (+125.8% 🔺)9.874s (+90.1% 🔺)1.892s101.00x
▲ VercelNitro9.295s (+188.1% 🔺)10.915s (+126.4% 🔺)1.620s91.16x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.621s (-24.1% 🟢)1.006s (-1.1%)0.385s1201.00x
🐘 PostgresNitro0.639s (-19.2% 🟢)1.015s (+0.7%)0.376s1191.03x
💻 LocalExpress8.003s (-28.5% 🟢)8.667s (-27.4% 🟢)0.664s1412.88x
💻 LocalNitro9.963s (-11.0% 🟢)10.363s (-11.2% 🟢)0.400s1216.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.990s (+158.9% 🔺)21.905s (+133.0% 🔺)1.915s61.00x
▲ VercelNext.js (Turbopack)23.747s (+129.9% 🔺)26.134s (+112.7% 🔺)2.387s51.19x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.104s (+454.5% 🔺)2.004s (+99.5% 🔺)0.008s (-32.2% 🟢)2.014s (+97.9% 🔺)0.910s101.00x
💻 LocalNitro1.131s (+429.1% 🔺)2.005s (+99.6% 🔺)0.010s (-18.4% 🟢)2.017s (+98.0% 🔺)0.887s101.02x
🐘 PostgresExpress1.137s (+454.5% 🔺)2.000s (+100.3% 🔺)0.002s (-6.3% 🟢)2.010s (+98.7% 🔺)0.873s101.03x
🐘 PostgresNitro1.145s (+458.7% 🔺)1.999s (+100.0% 🔺)0.001s (-20.0% 🟢)2.010s (+98.7% 🔺)0.864s101.04x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.241s (-41.5% 🟢)3.316s (-37.2% 🟢)2.054s (+176.8% 🔺)5.808s (-10.4% 🟢)3.567s101.00x
▲ VercelNext.js (Turbopack)2.318s (-66.2% 🟢)3.661s (-57.7% 🟢)2.081s (+229.3% 🔺)6.240s (-36.3% 🟢)3.922s101.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.510s (+80.1% 🔺)2.010s (+98.7% 🔺)0.009s (-6.4% 🟢)2.021s (+81.1% 🔺)0.511s301.00x
🐘 PostgresExpress1.565s (+148.5% 🔺)2.005s (+99.2% 🔺)0.004s (+1.8%)2.026s (+98.1% 🔺)0.461s301.04x
🐘 PostgresNitro1.571s (+151.7% 🔺)2.037s (+102.4% 🔺)0.004s (-4.9%)2.058s (+101.3% 🔺)0.487s301.04x
💻 LocalExpress1.612s (+112.9% 🔺)2.010s (+95.3% 🔺)0.008s (-15.8% 🟢)2.198s (+111.4% 🔺)0.586s281.07x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.811s (-65.7% 🟢)7.125s (-60.9% 🟢)0.250s (+18.3% 🔺)7.983s (-57.8% 🟢)2.171s81.00x
▲ VercelNitro5.976s (-79.7% 🟢)7.199s (-76.6% 🟢)0.202s (+80.7% 🔺)7.811s (-75.4% 🟢)1.835s81.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.669s (-30.9% 🟢)1.033s (-17.2% 🟢)0.000s (-15.8% 🟢)1.058s (-15.9% 🟢)0.389s571.00x
🐘 PostgresExpress0.686s (-28.6% 🟢)1.051s (-17.8% 🟢)0.000s (+61.4% 🔺)1.060s (-18.9% 🟢)0.374s571.03x
💻 LocalExpress1.149s (-6.2% 🟢)1.981s (-2.0%)0.000s (-51.6% 🟢)1.983s (-2.0%)0.833s311.72x
💻 LocalNitro1.338s (+9.4% 🔺)2.016s (~)0.000s (+33.3% 🔺)2.018s (~)0.680s302.00x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.037s (-60.4% 🟢)5.321s (-53.8% 🟢)0.001s (+Infinity% 🔺)5.851s (-51.4% 🟢)1.814s111.00x
▲ VercelNitro4.253s (+39.4% 🔺)5.600s (+27.5% 🔺)0.000s (+30.0% 🔺)6.027s (+25.3% 🔺)1.774s101.05x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.325s (-26.1% 🟢)2.066s (-3.5%)0.000s (-3.4%)2.085s (-4.1%)0.761s291.00x
🐘 PostgresExpress1.389s (-21.6% 🟢)2.103s (-3.4%)0.000s (+Infinity% 🔺)2.114s (-3.8%)0.725s291.05x
💻 LocalExpress2.590s (-25.3% 🟢)2.974s (-26.3% 🟢)0.001s (-28.6% 🟢)2.979s (-26.2% 🟢)0.389s211.96x
💻 LocalNitro3.100s (-8.5% 🟢)3.967s (-1.6%)0.001s (+5.5% 🔺)3.970s (-1.6%)0.870s162.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.450s (+33.1% 🔺)6.924s (+28.8% 🔺)0.000s (-100.0% 🟢)7.361s (+27.1% 🔺)1.912s91.00x
▲ VercelNext.js (Turbopack)6.618s (+17.8% 🔺)7.864s (+12.6% 🔺)0.000s (-100.0% 🟢)8.355s (+10.8% 🔺)1.737s81.21x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress20/21
🐘 PostgresNitro14/21
▲ VercelNitro15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres12/21
Next.js (Turbopack)▲ Vercel21/21
Nitro🐘 Postgres14/21
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)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production119642191419
✅ 💻 Local Development158702191806
✅ 📦 Local Production158702191806
❌ 🐘 Local Postgres158612191806
✅ 🪟 Windows12900129
✅ 📋 Other7270176903
Total6812510527869

❌ Failed Tests

▲ Vercel Production (4 failed)

astro (1 failed):

  • AbortController abortAnyInStepWorkflow: AbortSignal.any inside a step composes deserialized signals

express (1 failed):

  • AbortController abortDeterministicBranchFromStepWorkflow: branches stay consistent when abort comes from a step

nuxt (1 failed):

  • runClassSerializationWorkflow - Run instances serialize across workflow/step boundaries | wrun_01KRMHFSCJH1N8FQ7XV2Z0EYWG | 🔍 observability

vite (1 failed):

  • fibonacciWorkflow - recursive workflow composition via start() | wrun_01KRMHG8R8XFT3RMXVQ70JM22A | 🔍 observability
🐘 Local Postgres (1 failed)

nextjs-webpack-stable-lazy-discovery-disabled (1 failed):

  • addTenWorkflow | wrun_01KRMH3MTK3F9C2E3XSFN0VC5C

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro102126
✅ example103026
❌ express102126
✅ fastify103026
✅ hono103026
✅ nextjs-turbopack12702
✅ nextjs-webpack12702
✅ nitro103026
❌ nuxt102126
✅ sveltekit12207
❌ vite102126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
❌ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
❌ nextjs-webpack-stable-lazy-discovery-disabled12810
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack12900
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable104025
✅ e2e-local-dev-tanstack-start-104025
✅ e2e-local-postgres-nest-stable104025
✅ e2e-local-postgres-tanstack-start-104025
✅ e2e-local-prod-nest-stable104025
✅ e2e-local-prod-tanstack-start-104025
✅ e2e-vercel-prod-tanstack-start103026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Add a comment please

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.

Done in c0a0ea35f / 107c5cbee: added a block comment explaining the 300s VQS visibility-timeout default, why we pass an explicit retry directive, and the idempotency expectation for close-together retries.

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 updates @workflow/world-vercel queue handling so failed VQS workflow handler invocations request an immediate retry directive instead of relying on the default visibility timeout.

Changes:

  • Adds a retry option to QueueClient.handleCallback.
  • Updates unit coverage for the callback retry option.
  • Adds a patch changeset for @workflow/world-vercel.

Reviewed changes

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

FileDescription
packages/world-vercel/src/queue.tsWires retry options into the VQS callback handler.
packages/world-vercel/src/queue.test.tsAdds/updates assertions for handleCallback retry behavior.
.changeset/retry-vqs-handler-errors-immediately.mdAdds release metadata for the world-vercel patch.

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

Comment thread.changeset/retry-vqs-handler-errors-immediately.md Outdated
Comment on lines +294 to 296
{
retry: () => ({ afterSeconds: 0 }),
}

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.

Updated in 107c5cbee: this no longer forces afterSeconds: 0. Handler failures now use delivery-count backoff starting at 1s and capped at 60s, so retries are quick without burning the delivery budget in a tight loop.

Comment on lines +368 to +373
expect(
options.retry(new Error('workflow server unavailable'), {
messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Updated in 107c5cbee: the test now asserts the bounded retry sequence instead of { afterSeconds: 0 }.

@karthikscale3karthikscale3 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.

Diagnosis is right — confirmed independently from staging Datadog logs that the 300s gap is the @vercel/queue default visibilityTimeoutSeconds. Fix wires the right API surface, but afterSeconds: 0 overcorrects in a few ways. Inline comments cover them. Worth pairing with a workflow-server-side change that maps getaddrinfo EBUSY / transient AWS SDK errors to 503 Retry-After: 1 so the SDK can retry without ever bouncing back to the queue.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

afterSeconds: 0 overrides the configured retryAfterSeconds: 5.

Per the @vercel/queue README: "the message is re-delivered after the configured retry delay (from retryAfterSeconds in vercel.json or the retry callback's afterSeconds)". So returning 0 here bypasses the trigger-config value the SDK already generates.

For the concrete bug that motivated this (DNS EBUSY on a Fluid Compute lambda whose libuv DNS thread pool was wedged for ~9s), a 0s retry will land back on the same wedged container before it recycles. The configured 5s would actually be the right floor.

Suggest: retry: () => ({ afterSeconds: 5 }) to match retryAfterSeconds in the generated trigger config, or read the value from a shared constant so they can't drift apart.

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.

5 seconds seems too long still. where is that floor coming from?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a good point about the interaction between afterSeconds in the retry callback and the retryAfterSeconds: 5 in the trigger config.

However, looking at the handler-side code in packages/core/src/runtime.ts (line 158) and packages/core/src/runtime/step-handler.ts (line 98), runs/steps are bounded at MAX_QUEUE_DELIVERIES = 48 attempts — the handler will gracefully fail the run before unbounded looping occurs. The comment in constants.ts does note the 48-attempt budget was sized assuming ~20 hours of elapsed time with the 5s backoff schedule, so with afterSeconds: 0 those 48 attempts would exhaust much faster.

That said, the main fix here (avoiding the 300s visibility lock) is clearly correct. The question is whether afterSeconds: 0 vs something like afterSeconds: 5 matters in practice — @pranaygp would know best whether VQS applies its own backoff on top of the afterSeconds value from the retry callback or if this truly replaces the entire schedule.

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.

Good catch. I agree that afterSeconds: 0 is more aggressive than needed. The retryAfterSeconds: 5 in the trigger config (also defined in packages/builders/src/constants.ts as WORKFLOW_QUEUE_TRIGGER.retryAfterSeconds) exists for a reason, and the retry callback's afterSeconds overrides it entirely.

The suggestion to use afterSeconds: 5 (or better, import from the shared WORKFLOW_QUEUE_TRIGGER constant) makes sense — it fixes the 300s visibility timeout problem while preserving the backoff floor that MAX_QUEUE_DELIVERIES = 48 was sized around.

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.

Adjusted in 107c5cbee after Pranay’s follow-up: instead of a 5s floor, the retry starts at 1s and then backs off by delivery count. That keeps the first retry quick while avoiding the original 0s hot-loop risk.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

No deliveryCount-aware backoff — poison messages will hot-loop.

This returns 0 for every delivery. For a permanently-broken message (malformed payload, schema mismatch, a workflow-server 500 that isn't transient), VQS will redeliver every ~0s until it hits its max-receive limit / DLQ. That's much hotter than the current 300s behavior.

Standard shape that handles both transient and stuck without classification:

retry: (_err,{ deliveryCount })=>({afterSeconds: Math.min(2**(deliveryCount-1),60),})

Gives 1s → 2s → 4s → 8s … capped at 60s. Fast enough for transient (full recovery within seconds), gentle enough not to thrash on a poison message.

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.

Implemented in 107c5cbee: handler errors now use delivery-count-aware backoff (1s -> 2s -> 4s -> 8s ...) capped at 60s.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Cross-system amplification risk during a workflow-server outage.

The 300s default is bad for happy-path latency but accidentally acts as a circuit-breaker when workflow-server is browning out — each in-flight message is held off-line for 5 min, naturally throttling redrive volume. With afterSeconds: 0, every dispatched VQS message will thrash workflow-server at full speed during exactly the situations we'd want to be gentle on.

The deliveryCount-aware backoff in my other comment addresses this too — once retries pile up, the per-message redrive rate self-throttles via exponential backoff.

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.

Addressed by the same backoff in 107c5cbee: repeated failures self-throttle up to a 60s cap instead of hammering workflow-server with 0s redrives.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Worth a comment here explaining why this retry handler exists.

Future readers will see retry: () => ({ afterSeconds: 0 }) and wonder why we explicitly opt into a non-default. A short block comment naming the 300s visibilityTimeoutSeconds default and the incident that motivated it (or the linked PR / issue) would make this durable. Without it, the next person to touch this is likely to remove it as redundant.

Also worth a one-line note that workflow/step handlers must be idempotent — the event-sourced model already required this for the 300s replay path, but tightening the redrive window makes back-to-back replays much more likely in practice.

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.

Done in c0a0ea35f / 107c5cbee: added the explanatory comment and called out the idempotency requirement.

messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Test asserts the directive shape but not the contract.

This invokes options.retry directly with a stubbed error, which verifies the function we pass in returns the right thing — but it doesn't exercise the path where @vercel/queue actually calls retry on a real handler throw. If handleCallback's contract for retry ever changes (different metadata shape, different return-type, called/not-called timing), this test still passes.

A small integration-style test using a real QueueClient with a throwing handler, then asserting redelivery happened with the expected delay, would catch contract drift. Not blocking — @vercel/queue owns the other side — but worth considering as a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test validates the contract that the production code passes to @vercel/queue — i.e., the retry callback shape and return value. Testing the actual handleCallback integration would require either not mocking @vercel/queue or a more complex integration test, which seems out of scope for a unit test. The mock-based approach here is consistent with how other handleCallback behavior is tested in this file (e.g., the existing mockHandleCallback pattern).

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.

Agree this is fine for now — it verifies the wiring correctly. An integration test with a real QueueClient would be more robust against contract drift but isn't blocking for this change.

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.

Leaving the real @vercel/queue contract test as a follow-up since that side is owned by the queue package. This PR now covers the world-vercel retry directive and the backoff values it returns.

@ctgowriectgowrie 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.

I don't think this will work. The problem is that we claim the message for 5 minutes. So even if we retry immediately, we will fail to claim the message.

Actually, this is a new message. We probably want some sort of backoff here, so we don't hammer the consumer. Lets discuss in slack

Comment threadpackages/world-vercel/src/queue.ts Outdated
Comment on lines +305 to +310
// Without an explicit retry directive, @vercel/queue leaves failed
// handler messages invisible until the default 300s visibility timeout
// expires. Start retrying quickly, then back off by delivery count so
// an outage or poison message cannot hot-loop. Workflow handlers are
// event-sourced and must remain idempotent because queue retries can
// happen close together.

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.

shouldn't VQS fallback to the configured 5s retryAfter configured in the config when nothing is explicitly set, instead of 300s visibility timeout?

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.

Checked against the @vercel/queue callback path in ~/github/vercel/vqs: the handler creates a consumer group with visibilityTimeoutSeconds defaulting to 300, and on handler throw it only calls changeVisibility when the retry callback returns { afterSeconds }. If the retry callback is absent/undefined, the error propagates and the message stays hidden until that visibility timeout expires. So this path does not appear to fall back to the trigger config’s retryAfterSeconds: 5; that matches the observed 300s retry delay and is why this PR keeps an explicit retry directive.

@pranaygp
pranaygp enabled auto-merge (squash) May 15, 2026 00:36
@pranaygp
pranaygp disabled auto-merge May 15, 2026 20:17
@pranaygp
pranaygp merged commit c43e721 into mainMay 15, 2026
113 of 120 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2007.

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.

5 participants

@pranaygp@TooTallNate@ctgowrie@karthikscale3
, '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 failed VQS handlers immediately - #1999

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry
May 15, 2026
Merged

Retry failed VQS handlers immediately#1999
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry

Conversation

@pranaygp

@pranaygppranaygp commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

When the Workflow queue handler throws, ask VQS to make the current message visible immediately instead of waiting for the default 300 second visibility lease to expire.

Root cause: the generated Workflow trigger config uses retryAfterSeconds: 5, but @workflow/world-vercel called QueueClient.handleCallback without a retry option. On handler failure, @vercel/queue propagated the error and the message stayed locked for the client default visibilityTimeoutSeconds: 300.

Changes

  • Pass retry: () => ({ afterSeconds: 0 }) to the VQS callback handler in @workflow/world-vercel.
  • Add a unit test asserting the retry directive is wired into handleCallback.
  • Add a patch changeset for @workflow/world-vercel.

Validation

  • git diff --check -- packages/world-vercel/src/queue.ts packages/world-vercel/src/queue.test.ts .changeset/retry-vqs-handler-errors-immediately.md
  • pnpm install with Node v24.15.0
  • pnpm --filter @workflow/utils build
  • pnpm --filter @workflow/errors build
  • pnpm --filter @workflow/world build
  • pnpm --filter @workflow/world-vercel build
  • pnpm --filter @workflow/world-vercel test -- queue.test.ts (69 tests passed)

CopilotAI review requested due to automatic review settings May 14, 2026 23:19
@pranaygp
pranaygp requested a review from a team as a code ownerMay 14, 2026 23:19
@changeset-bot

changeset-botBot commented May 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 45feb40

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

This PR includes changesets to release 19 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
tarballsPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@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

@vercel

vercelBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.025s (-44.0% 🟢)1.004s (~)0.979s101.00x
💻 LocalNitro0.030s (-29.7% 🟢)1.005s (~)0.975s101.22x
🐘 PostgresNitro0.054s (-43.2% 🟢)1.012s (-2.9%)0.958s102.18x
🐘 PostgresExpress0.063s (+9.3% 🔺)1.022s (+1.1%)0.959s102.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.231s (-43.7% 🟢)1.905s (-24.1% 🟢)1.675s101.00x
▲ VercelNext.js (Turbopack)0.304s (+20.9% 🔺)2.565s (+9.9% 🔺)2.261s101.32x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.056s (-6.2% 🟢)2.005s (~)0.949s101.00x
💻 LocalNitro1.065s (-5.8% 🟢)2.006s (~)0.941s101.01x
🐘 PostgresNitro1.082s (-5.1% 🟢)2.009s (~)0.927s101.02x
🐘 PostgresExpress1.086s (-5.3% 🟢)2.009s (~)0.923s101.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.602s (-21.3% 🟢)3.795s (-0.9%)2.193s101.00x
▲ VercelNitro1.681s (-56.8% 🟢)3.658s (-38.1% 🟢)1.976s101.05x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.327s (-5.4% 🟢)11.020s (~)0.693s31.00x
💻 LocalNitro10.404s (-4.9%)11.023s (~)0.618s31.01x
🐘 PostgresExpress10.417s (-5.0%)11.016s (~)0.599s31.01x
🐘 PostgresNitro10.427s (-4.1%)11.018s (~)0.591s31.01x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro13.713s (-42.2% 🟢)15.652s (-37.7% 🟢)1.939s21.00x
▲ VercelNext.js (Turbopack)13.851s (-20.0% 🟢)16.149s (-16.8% 🟢)2.299s21.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express13.252s (-11.5% 🟢)14.024s (-6.7% 🟢)0.772s51.00x
💻 LocalNitro13.425s (-10.9% 🟢)14.028s (-12.5% 🟢)0.603s51.01x
🐘 PostgresNitro13.454s (-7.8% 🟢)14.017s (-6.7% 🟢)0.563s51.02x
🐘 PostgresExpress13.530s (-7.2% 🟢)14.018s (-6.7% 🟢)0.488s51.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)21.402s (-59.3% 🟢)23.235s (-57.5% 🟢)1.833s31.00x
▲ VercelNitro21.447s (-66.7% 🟢)23.241s (-65.1% 🟢)1.794s31.00x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express11.579s (-30.3% 🟢)12.021s (-29.4% 🟢)0.443s81.00x
💻 LocalNitro11.845s (-29.4% 🟢)12.024s (-29.4% 🟢)0.179s81.02x
🐘 PostgresNitro12.024s (-13.9% 🟢)12.643s (-11.6% 🟢)0.619s81.04x
🐘 PostgresExpress12.057s (-13.9% 🟢)12.516s (-14.2% 🟢)0.459s81.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro35.366s (-91.6% 🟢)37.002s (-91.3% 🟢)1.636s31.00x
▲ VercelNext.js (Turbopack)36.089s (-90.8% 🟢)39.185s (-90.1% 🟢)3.096s31.02x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.135s (-23.7% 🟢)2.005s (~)0.870s151.00x
🐘 PostgresExpress1.136s (-9.8% 🟢)2.008s (~)0.871s151.00x
🐘 PostgresNitro1.145s (-10.2% 🟢)2.007s (~)0.862s151.01x
💻 LocalNitro1.173s (-28.1% 🟢)2.006s (-3.3%)0.833s151.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.552s (-9.4% 🟢)4.180s (-3.3%)1.627s81.00x
▲ VercelNext.js (Turbopack)2.792s (-17.8% 🟢)4.564s (-7.5% 🟢)1.772s71.09x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-48.7% 🟢)2.007s (-33.3% 🟢)0.797s151.00x
🐘 PostgresNitro1.272s (-45.9% 🟢)2.074s (-31.1% 🟢)0.802s151.05x
💻 LocalExpress1.553s (-47.4% 🟢)2.006s (-41.9% 🟢)0.453s151.28x
💻 LocalNitro1.678s (-46.6% 🟢)2.005s (-48.4% 🟢)0.327s151.39x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.458s (-37.2% 🟢)6.227s (-30.1% 🟢)1.769s61.00x
▲ VercelNitro5.689s (+40.4% 🔺)7.790s (+31.6% 🔺)2.101s41.28x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.328s (-61.9% 🟢)2.009s (-49.9% 🟢)0.680s151.00x
🐘 PostgresNitro1.395s (-59.9% 🟢)2.008s (-49.9% 🟢)0.613s151.05x
💻 LocalExpress3.522s (-57.8% 🟢)4.011s (-55.6% 🟢)0.488s82.65x
💻 LocalNitro4.447s (-46.7% 🟢)5.011s (-44.4% 🟢)0.564s63.35x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.432s (+54.1% 🔺)6.911s (+24.9% 🔺)1.479s51.00x
▲ VercelNext.js (Turbopack)5.852s (-34.4% 🟢)7.738s (-29.4% 🟢)1.886s41.08x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.152s (-8.4% 🟢)2.009s (~)0.857s151.00x
🐘 PostgresExpress1.158s (-7.9% 🟢)2.008s (~)0.850s151.01x
💻 LocalExpress1.238s (-34.6% 🟢)2.006s (-15.1% 🟢)0.768s151.07x
💻 LocalNitro1.376s (-26.2% 🟢)2.006s (-14.3% 🟢)0.629s151.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.483s (+1.0%)3.737s (-10.4% 🟢)1.254s91.00x
▲ VercelNext.js (Turbopack)2.575s (-12.2% 🟢)4.082s (-12.1% 🟢)1.507s81.04x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.209s (-48.3% 🟢)2.008s (-33.3% 🟢)0.799s151.00x
🐘 PostgresExpress1.219s (-47.9% 🟢)2.007s (-33.3% 🟢)0.788s151.01x
💻 LocalExpress1.644s (-47.5% 🟢)2.005s (-46.7% 🟢)0.361s151.36x
💻 LocalNitro2.046s (-33.2% 🟢)2.469s (-36.5% 🟢)0.423s131.69x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.040s (+25.0% 🔺)5.730s (+12.9% 🔺)1.690s61.00x
▲ VercelNext.js (Turbopack)4.073s (+29.6% 🔺)5.712s (+26.3% 🔺)1.638s61.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.322s (-62.0% 🟢)2.009s (-49.9% 🟢)0.687s151.00x
🐘 PostgresExpress1.324s (-62.2% 🟢)2.007s (-50.0% 🟢)0.684s151.00x
💻 LocalExpress4.114s (-53.3% 🟢)4.868s (-47.5% 🟢)0.754s73.11x
💻 LocalNitro4.825s (-47.2% 🟢)5.345s (-46.7% 🟢)0.520s63.65x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.443s (+6.9% 🔺)7.984s (+17.1% 🔺)2.541s41.00x
▲ VercelNext.js (Turbopack)6.066s (-10.2% 🟢)8.119s (-5.0%)2.054s41.11x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.443s (-46.0% 🟢)1.007s (~)0.564s601.00x
💻 LocalExpress0.448s (-54.5% 🟢)1.003s (-6.7% 🟢)0.556s601.01x
🐘 PostgresExpress0.467s (-44.3% 🟢)1.007s (-1.6%)0.540s601.05x
💻 LocalNitro0.525s (-46.4% 🟢)1.039s (-5.1% 🟢)0.513s581.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.693s (-78.7% 🟢)6.239s (-74.0% 🟢)1.546s101.00x
▲ VercelNext.js (Turbopack)5.172s (-64.3% 🟢)6.923s (-57.0% 🟢)1.751s91.10x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.075s (-44.2% 🟢)1.964s (-6.5% 🟢)0.889s461.00x
💻 LocalExpress1.093s (-63.7% 🟢)1.702s (-52.5% 🟢)0.609s531.02x
🐘 PostgresExpress1.138s (-42.4% 🟢)2.030s (-10.1% 🟢)0.892s451.06x
💻 LocalNitro1.159s (-61.8% 🟢)2.006s (-46.6% 🟢)0.847s451.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro12.782s (-67.6% 🟢)14.361s (-65.2% 🟢)1.580s71.00x
▲ VercelNext.js (Turbopack)12.891s (-74.1% 🟢)14.919s (-71.2% 🟢)2.027s71.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.211s (-46.1% 🟢)2.865s (-37.8% 🟢)0.654s421.00x
🐘 PostgresExpress2.219s (-44.4% 🟢)3.085s (-29.4% 🟢)0.866s391.00x
💻 LocalExpress2.310s (-74.9% 🟢)3.007s (-70.0% 🟢)0.697s401.04x
💻 LocalNitro2.659s (-71.4% 🟢)3.033s (-69.7% 🟢)0.373s401.20x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro41.221s (-57.5% 🟢)43.002s (-56.3% 🟢)1.781s41.00x
▲ VercelNext.js (Turbopack)41.812s (-61.0% 🟢)43.995s (-59.6% 🟢)2.183s31.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.177s (-37.5% 🟢)1.006s (~)0.829s601.00x
🐘 PostgresExpress0.178s (-37.1% 🟢)1.006s (~)0.829s601.00x
💻 LocalExpress0.376s (-32.9% 🟢)1.003s (~)0.627s602.12x
💻 LocalNitro0.430s (-29.0% 🟢)1.004s (-1.7%)0.574s602.43x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.619s (+57.7% 🔺)4.330s (+29.2% 🔺)1.711s141.00x
▲ VercelNext.js (Turbopack)2.972s (+46.9% 🔺)5.256s (+38.5% 🔺)2.284s121.13x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.307s (-38.1% 🟢)1.007s (~)0.699s901.00x
🐘 PostgresExpress0.311s (-39.0% 🟢)1.014s (+0.7%)0.702s891.01x
💻 LocalExpress1.849s (-26.4% 🟢)2.252s (-25.2% 🟢)0.402s416.02x
💻 LocalNitro2.152s (-15.2% 🟢)2.797s (-7.1% 🟢)0.645s337.00x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.983s (+125.8% 🔺)9.874s (+90.1% 🔺)1.892s101.00x
▲ VercelNitro9.295s (+188.1% 🔺)10.915s (+126.4% 🔺)1.620s91.16x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.621s (-24.1% 🟢)1.006s (-1.1%)0.385s1201.00x
🐘 PostgresNitro0.639s (-19.2% 🟢)1.015s (+0.7%)0.376s1191.03x
💻 LocalExpress8.003s (-28.5% 🟢)8.667s (-27.4% 🟢)0.664s1412.88x
💻 LocalNitro9.963s (-11.0% 🟢)10.363s (-11.2% 🟢)0.400s1216.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.990s (+158.9% 🔺)21.905s (+133.0% 🔺)1.915s61.00x
▲ VercelNext.js (Turbopack)23.747s (+129.9% 🔺)26.134s (+112.7% 🔺)2.387s51.19x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.104s (+454.5% 🔺)2.004s (+99.5% 🔺)0.008s (-32.2% 🟢)2.014s (+97.9% 🔺)0.910s101.00x
💻 LocalNitro1.131s (+429.1% 🔺)2.005s (+99.6% 🔺)0.010s (-18.4% 🟢)2.017s (+98.0% 🔺)0.887s101.02x
🐘 PostgresExpress1.137s (+454.5% 🔺)2.000s (+100.3% 🔺)0.002s (-6.3% 🟢)2.010s (+98.7% 🔺)0.873s101.03x
🐘 PostgresNitro1.145s (+458.7% 🔺)1.999s (+100.0% 🔺)0.001s (-20.0% 🟢)2.010s (+98.7% 🔺)0.864s101.04x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.241s (-41.5% 🟢)3.316s (-37.2% 🟢)2.054s (+176.8% 🔺)5.808s (-10.4% 🟢)3.567s101.00x
▲ VercelNext.js (Turbopack)2.318s (-66.2% 🟢)3.661s (-57.7% 🟢)2.081s (+229.3% 🔺)6.240s (-36.3% 🟢)3.922s101.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.510s (+80.1% 🔺)2.010s (+98.7% 🔺)0.009s (-6.4% 🟢)2.021s (+81.1% 🔺)0.511s301.00x
🐘 PostgresExpress1.565s (+148.5% 🔺)2.005s (+99.2% 🔺)0.004s (+1.8%)2.026s (+98.1% 🔺)0.461s301.04x
🐘 PostgresNitro1.571s (+151.7% 🔺)2.037s (+102.4% 🔺)0.004s (-4.9%)2.058s (+101.3% 🔺)0.487s301.04x
💻 LocalExpress1.612s (+112.9% 🔺)2.010s (+95.3% 🔺)0.008s (-15.8% 🟢)2.198s (+111.4% 🔺)0.586s281.07x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.811s (-65.7% 🟢)7.125s (-60.9% 🟢)0.250s (+18.3% 🔺)7.983s (-57.8% 🟢)2.171s81.00x
▲ VercelNitro5.976s (-79.7% 🟢)7.199s (-76.6% 🟢)0.202s (+80.7% 🔺)7.811s (-75.4% 🟢)1.835s81.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.669s (-30.9% 🟢)1.033s (-17.2% 🟢)0.000s (-15.8% 🟢)1.058s (-15.9% 🟢)0.389s571.00x
🐘 PostgresExpress0.686s (-28.6% 🟢)1.051s (-17.8% 🟢)0.000s (+61.4% 🔺)1.060s (-18.9% 🟢)0.374s571.03x
💻 LocalExpress1.149s (-6.2% 🟢)1.981s (-2.0%)0.000s (-51.6% 🟢)1.983s (-2.0%)0.833s311.72x
💻 LocalNitro1.338s (+9.4% 🔺)2.016s (~)0.000s (+33.3% 🔺)2.018s (~)0.680s302.00x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.037s (-60.4% 🟢)5.321s (-53.8% 🟢)0.001s (+Infinity% 🔺)5.851s (-51.4% 🟢)1.814s111.00x
▲ VercelNitro4.253s (+39.4% 🔺)5.600s (+27.5% 🔺)0.000s (+30.0% 🔺)6.027s (+25.3% 🔺)1.774s101.05x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.325s (-26.1% 🟢)2.066s (-3.5%)0.000s (-3.4%)2.085s (-4.1%)0.761s291.00x
🐘 PostgresExpress1.389s (-21.6% 🟢)2.103s (-3.4%)0.000s (+Infinity% 🔺)2.114s (-3.8%)0.725s291.05x
💻 LocalExpress2.590s (-25.3% 🟢)2.974s (-26.3% 🟢)0.001s (-28.6% 🟢)2.979s (-26.2% 🟢)0.389s211.96x
💻 LocalNitro3.100s (-8.5% 🟢)3.967s (-1.6%)0.001s (+5.5% 🔺)3.970s (-1.6%)0.870s162.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.450s (+33.1% 🔺)6.924s (+28.8% 🔺)0.000s (-100.0% 🟢)7.361s (+27.1% 🔺)1.912s91.00x
▲ VercelNext.js (Turbopack)6.618s (+17.8% 🔺)7.864s (+12.6% 🔺)0.000s (-100.0% 🟢)8.355s (+10.8% 🔺)1.737s81.21x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress20/21
🐘 PostgresNitro14/21
▲ VercelNitro15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres12/21
Next.js (Turbopack)▲ Vercel21/21
Nitro🐘 Postgres14/21
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)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production119642191419
✅ 💻 Local Development158702191806
✅ 📦 Local Production158702191806
❌ 🐘 Local Postgres158612191806
✅ 🪟 Windows12900129
✅ 📋 Other7270176903
Total6812510527869

❌ Failed Tests

▲ Vercel Production (4 failed)

astro (1 failed):

  • AbortController abortAnyInStepWorkflow: AbortSignal.any inside a step composes deserialized signals

express (1 failed):

  • AbortController abortDeterministicBranchFromStepWorkflow: branches stay consistent when abort comes from a step

nuxt (1 failed):

  • runClassSerializationWorkflow - Run instances serialize across workflow/step boundaries | wrun_01KRMHFSCJH1N8FQ7XV2Z0EYWG | 🔍 observability

vite (1 failed):

  • fibonacciWorkflow - recursive workflow composition via start() | wrun_01KRMHG8R8XFT3RMXVQ70JM22A | 🔍 observability
🐘 Local Postgres (1 failed)

nextjs-webpack-stable-lazy-discovery-disabled (1 failed):

  • addTenWorkflow | wrun_01KRMH3MTK3F9C2E3XSFN0VC5C

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro102126
✅ example103026
❌ express102126
✅ fastify103026
✅ hono103026
✅ nextjs-turbopack12702
✅ nextjs-webpack12702
✅ nitro103026
❌ nuxt102126
✅ sveltekit12207
❌ vite102126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
❌ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
❌ nextjs-webpack-stable-lazy-discovery-disabled12810
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack12900
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable104025
✅ e2e-local-dev-tanstack-start-104025
✅ e2e-local-postgres-nest-stable104025
✅ e2e-local-postgres-tanstack-start-104025
✅ e2e-local-prod-nest-stable104025
✅ e2e-local-prod-tanstack-start-104025
✅ e2e-vercel-prod-tanstack-start103026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Add a comment please

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.

Done in c0a0ea35f / 107c5cbee: added a block comment explaining the 300s VQS visibility-timeout default, why we pass an explicit retry directive, and the idempotency expectation for close-together retries.

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 updates @workflow/world-vercel queue handling so failed VQS workflow handler invocations request an immediate retry directive instead of relying on the default visibility timeout.

Changes:

  • Adds a retry option to QueueClient.handleCallback.
  • Updates unit coverage for the callback retry option.
  • Adds a patch changeset for @workflow/world-vercel.

Reviewed changes

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

FileDescription
packages/world-vercel/src/queue.tsWires retry options into the VQS callback handler.
packages/world-vercel/src/queue.test.tsAdds/updates assertions for handleCallback retry behavior.
.changeset/retry-vqs-handler-errors-immediately.mdAdds release metadata for the world-vercel patch.

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

Comment thread.changeset/retry-vqs-handler-errors-immediately.md Outdated
Comment on lines +294 to 296
{
retry: () => ({ afterSeconds: 0 }),
}

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.

Updated in 107c5cbee: this no longer forces afterSeconds: 0. Handler failures now use delivery-count backoff starting at 1s and capped at 60s, so retries are quick without burning the delivery budget in a tight loop.

Comment on lines +368 to +373
expect(
options.retry(new Error('workflow server unavailable'), {
messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Updated in 107c5cbee: the test now asserts the bounded retry sequence instead of { afterSeconds: 0 }.

@karthikscale3karthikscale3 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.

Diagnosis is right — confirmed independently from staging Datadog logs that the 300s gap is the @vercel/queue default visibilityTimeoutSeconds. Fix wires the right API surface, but afterSeconds: 0 overcorrects in a few ways. Inline comments cover them. Worth pairing with a workflow-server-side change that maps getaddrinfo EBUSY / transient AWS SDK errors to 503 Retry-After: 1 so the SDK can retry without ever bouncing back to the queue.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

afterSeconds: 0 overrides the configured retryAfterSeconds: 5.

Per the @vercel/queue README: "the message is re-delivered after the configured retry delay (from retryAfterSeconds in vercel.json or the retry callback's afterSeconds)". So returning 0 here bypasses the trigger-config value the SDK already generates.

For the concrete bug that motivated this (DNS EBUSY on a Fluid Compute lambda whose libuv DNS thread pool was wedged for ~9s), a 0s retry will land back on the same wedged container before it recycles. The configured 5s would actually be the right floor.

Suggest: retry: () => ({ afterSeconds: 5 }) to match retryAfterSeconds in the generated trigger config, or read the value from a shared constant so they can't drift apart.

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.

5 seconds seems too long still. where is that floor coming from?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a good point about the interaction between afterSeconds in the retry callback and the retryAfterSeconds: 5 in the trigger config.

However, looking at the handler-side code in packages/core/src/runtime.ts (line 158) and packages/core/src/runtime/step-handler.ts (line 98), runs/steps are bounded at MAX_QUEUE_DELIVERIES = 48 attempts — the handler will gracefully fail the run before unbounded looping occurs. The comment in constants.ts does note the 48-attempt budget was sized assuming ~20 hours of elapsed time with the 5s backoff schedule, so with afterSeconds: 0 those 48 attempts would exhaust much faster.

That said, the main fix here (avoiding the 300s visibility lock) is clearly correct. The question is whether afterSeconds: 0 vs something like afterSeconds: 5 matters in practice — @pranaygp would know best whether VQS applies its own backoff on top of the afterSeconds value from the retry callback or if this truly replaces the entire schedule.

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.

Good catch. I agree that afterSeconds: 0 is more aggressive than needed. The retryAfterSeconds: 5 in the trigger config (also defined in packages/builders/src/constants.ts as WORKFLOW_QUEUE_TRIGGER.retryAfterSeconds) exists for a reason, and the retry callback's afterSeconds overrides it entirely.

The suggestion to use afterSeconds: 5 (or better, import from the shared WORKFLOW_QUEUE_TRIGGER constant) makes sense — it fixes the 300s visibility timeout problem while preserving the backoff floor that MAX_QUEUE_DELIVERIES = 48 was sized around.

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.

Adjusted in 107c5cbee after Pranay’s follow-up: instead of a 5s floor, the retry starts at 1s and then backs off by delivery count. That keeps the first retry quick while avoiding the original 0s hot-loop risk.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

No deliveryCount-aware backoff — poison messages will hot-loop.

This returns 0 for every delivery. For a permanently-broken message (malformed payload, schema mismatch, a workflow-server 500 that isn't transient), VQS will redeliver every ~0s until it hits its max-receive limit / DLQ. That's much hotter than the current 300s behavior.

Standard shape that handles both transient and stuck without classification:

retry: (_err,{ deliveryCount })=>({afterSeconds: Math.min(2**(deliveryCount-1),60),})

Gives 1s → 2s → 4s → 8s … capped at 60s. Fast enough for transient (full recovery within seconds), gentle enough not to thrash on a poison message.

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.

Implemented in 107c5cbee: handler errors now use delivery-count-aware backoff (1s -> 2s -> 4s -> 8s ...) capped at 60s.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Cross-system amplification risk during a workflow-server outage.

The 300s default is bad for happy-path latency but accidentally acts as a circuit-breaker when workflow-server is browning out — each in-flight message is held off-line for 5 min, naturally throttling redrive volume. With afterSeconds: 0, every dispatched VQS message will thrash workflow-server at full speed during exactly the situations we'd want to be gentle on.

The deliveryCount-aware backoff in my other comment addresses this too — once retries pile up, the per-message redrive rate self-throttles via exponential backoff.

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.

Addressed by the same backoff in 107c5cbee: repeated failures self-throttle up to a 60s cap instead of hammering workflow-server with 0s redrives.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Worth a comment here explaining why this retry handler exists.

Future readers will see retry: () => ({ afterSeconds: 0 }) and wonder why we explicitly opt into a non-default. A short block comment naming the 300s visibilityTimeoutSeconds default and the incident that motivated it (or the linked PR / issue) would make this durable. Without it, the next person to touch this is likely to remove it as redundant.

Also worth a one-line note that workflow/step handlers must be idempotent — the event-sourced model already required this for the 300s replay path, but tightening the redrive window makes back-to-back replays much more likely in practice.

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.

Done in c0a0ea35f / 107c5cbee: added the explanatory comment and called out the idempotency requirement.

messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Test asserts the directive shape but not the contract.

This invokes options.retry directly with a stubbed error, which verifies the function we pass in returns the right thing — but it doesn't exercise the path where @vercel/queue actually calls retry on a real handler throw. If handleCallback's contract for retry ever changes (different metadata shape, different return-type, called/not-called timing), this test still passes.

A small integration-style test using a real QueueClient with a throwing handler, then asserting redelivery happened with the expected delay, would catch contract drift. Not blocking — @vercel/queue owns the other side — but worth considering as a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test validates the contract that the production code passes to @vercel/queue — i.e., the retry callback shape and return value. Testing the actual handleCallback integration would require either not mocking @vercel/queue or a more complex integration test, which seems out of scope for a unit test. The mock-based approach here is consistent with how other handleCallback behavior is tested in this file (e.g., the existing mockHandleCallback pattern).

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.

Agree this is fine for now — it verifies the wiring correctly. An integration test with a real QueueClient would be more robust against contract drift but isn't blocking for this change.

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.

Leaving the real @vercel/queue contract test as a follow-up since that side is owned by the queue package. This PR now covers the world-vercel retry directive and the backoff values it returns.

@ctgowriectgowrie 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.

I don't think this will work. The problem is that we claim the message for 5 minutes. So even if we retry immediately, we will fail to claim the message.

Actually, this is a new message. We probably want some sort of backoff here, so we don't hammer the consumer. Lets discuss in slack

Comment threadpackages/world-vercel/src/queue.ts Outdated
Comment on lines +305 to +310
// Without an explicit retry directive, @vercel/queue leaves failed
// handler messages invisible until the default 300s visibility timeout
// expires. Start retrying quickly, then back off by delivery count so
// an outage or poison message cannot hot-loop. Workflow handlers are
// event-sourced and must remain idempotent because queue retries can
// happen close together.

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.

shouldn't VQS fallback to the configured 5s retryAfter configured in the config when nothing is explicitly set, instead of 300s visibility timeout?

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.

Checked against the @vercel/queue callback path in ~/github/vercel/vqs: the handler creates a consumer group with visibilityTimeoutSeconds defaulting to 300, and on handler throw it only calls changeVisibility when the retry callback returns { afterSeconds }. If the retry callback is absent/undefined, the error propagates and the message stays hidden until that visibility timeout expires. So this path does not appear to fall back to the trigger config’s retryAfterSeconds: 5; that matches the observed 300s retry delay and is why this PR keeps an explicit retry directive.

@pranaygp
pranaygp enabled auto-merge (squash) May 15, 2026 00:36
@pranaygp
pranaygp disabled auto-merge May 15, 2026 20:17
@pranaygp
pranaygp merged commit c43e721 into mainMay 15, 2026
113 of 120 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2007.

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.

5 participants

@pranaygp@TooTallNate@ctgowrie@karthikscale3
, '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 failed VQS handlers immediately - #1999

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry
May 15, 2026
Merged

Retry failed VQS handlers immediately#1999
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry

Conversation

@pranaygp

@pranaygppranaygp commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

When the Workflow queue handler throws, ask VQS to make the current message visible immediately instead of waiting for the default 300 second visibility lease to expire.

Root cause: the generated Workflow trigger config uses retryAfterSeconds: 5, but @workflow/world-vercel called QueueClient.handleCallback without a retry option. On handler failure, @vercel/queue propagated the error and the message stayed locked for the client default visibilityTimeoutSeconds: 300.

Changes

  • Pass retry: () => ({ afterSeconds: 0 }) to the VQS callback handler in @workflow/world-vercel.
  • Add a unit test asserting the retry directive is wired into handleCallback.
  • Add a patch changeset for @workflow/world-vercel.

Validation

  • git diff --check -- packages/world-vercel/src/queue.ts packages/world-vercel/src/queue.test.ts .changeset/retry-vqs-handler-errors-immediately.md
  • pnpm install with Node v24.15.0
  • pnpm --filter @workflow/utils build
  • pnpm --filter @workflow/errors build
  • pnpm --filter @workflow/world build
  • pnpm --filter @workflow/world-vercel build
  • pnpm --filter @workflow/world-vercel test -- queue.test.ts (69 tests passed)

CopilotAI review requested due to automatic review settings May 14, 2026 23:19
@pranaygp
pranaygp requested a review from a team as a code ownerMay 14, 2026 23:19
@changeset-bot

changeset-botBot commented May 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 45feb40

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

This PR includes changesets to release 19 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
tarballsPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@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

@vercel

vercelBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.025s (-44.0% 🟢)1.004s (~)0.979s101.00x
💻 LocalNitro0.030s (-29.7% 🟢)1.005s (~)0.975s101.22x
🐘 PostgresNitro0.054s (-43.2% 🟢)1.012s (-2.9%)0.958s102.18x
🐘 PostgresExpress0.063s (+9.3% 🔺)1.022s (+1.1%)0.959s102.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.231s (-43.7% 🟢)1.905s (-24.1% 🟢)1.675s101.00x
▲ VercelNext.js (Turbopack)0.304s (+20.9% 🔺)2.565s (+9.9% 🔺)2.261s101.32x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.056s (-6.2% 🟢)2.005s (~)0.949s101.00x
💻 LocalNitro1.065s (-5.8% 🟢)2.006s (~)0.941s101.01x
🐘 PostgresNitro1.082s (-5.1% 🟢)2.009s (~)0.927s101.02x
🐘 PostgresExpress1.086s (-5.3% 🟢)2.009s (~)0.923s101.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.602s (-21.3% 🟢)3.795s (-0.9%)2.193s101.00x
▲ VercelNitro1.681s (-56.8% 🟢)3.658s (-38.1% 🟢)1.976s101.05x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.327s (-5.4% 🟢)11.020s (~)0.693s31.00x
💻 LocalNitro10.404s (-4.9%)11.023s (~)0.618s31.01x
🐘 PostgresExpress10.417s (-5.0%)11.016s (~)0.599s31.01x
🐘 PostgresNitro10.427s (-4.1%)11.018s (~)0.591s31.01x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro13.713s (-42.2% 🟢)15.652s (-37.7% 🟢)1.939s21.00x
▲ VercelNext.js (Turbopack)13.851s (-20.0% 🟢)16.149s (-16.8% 🟢)2.299s21.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express13.252s (-11.5% 🟢)14.024s (-6.7% 🟢)0.772s51.00x
💻 LocalNitro13.425s (-10.9% 🟢)14.028s (-12.5% 🟢)0.603s51.01x
🐘 PostgresNitro13.454s (-7.8% 🟢)14.017s (-6.7% 🟢)0.563s51.02x
🐘 PostgresExpress13.530s (-7.2% 🟢)14.018s (-6.7% 🟢)0.488s51.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)21.402s (-59.3% 🟢)23.235s (-57.5% 🟢)1.833s31.00x
▲ VercelNitro21.447s (-66.7% 🟢)23.241s (-65.1% 🟢)1.794s31.00x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express11.579s (-30.3% 🟢)12.021s (-29.4% 🟢)0.443s81.00x
💻 LocalNitro11.845s (-29.4% 🟢)12.024s (-29.4% 🟢)0.179s81.02x
🐘 PostgresNitro12.024s (-13.9% 🟢)12.643s (-11.6% 🟢)0.619s81.04x
🐘 PostgresExpress12.057s (-13.9% 🟢)12.516s (-14.2% 🟢)0.459s81.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro35.366s (-91.6% 🟢)37.002s (-91.3% 🟢)1.636s31.00x
▲ VercelNext.js (Turbopack)36.089s (-90.8% 🟢)39.185s (-90.1% 🟢)3.096s31.02x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.135s (-23.7% 🟢)2.005s (~)0.870s151.00x
🐘 PostgresExpress1.136s (-9.8% 🟢)2.008s (~)0.871s151.00x
🐘 PostgresNitro1.145s (-10.2% 🟢)2.007s (~)0.862s151.01x
💻 LocalNitro1.173s (-28.1% 🟢)2.006s (-3.3%)0.833s151.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.552s (-9.4% 🟢)4.180s (-3.3%)1.627s81.00x
▲ VercelNext.js (Turbopack)2.792s (-17.8% 🟢)4.564s (-7.5% 🟢)1.772s71.09x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-48.7% 🟢)2.007s (-33.3% 🟢)0.797s151.00x
🐘 PostgresNitro1.272s (-45.9% 🟢)2.074s (-31.1% 🟢)0.802s151.05x
💻 LocalExpress1.553s (-47.4% 🟢)2.006s (-41.9% 🟢)0.453s151.28x
💻 LocalNitro1.678s (-46.6% 🟢)2.005s (-48.4% 🟢)0.327s151.39x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.458s (-37.2% 🟢)6.227s (-30.1% 🟢)1.769s61.00x
▲ VercelNitro5.689s (+40.4% 🔺)7.790s (+31.6% 🔺)2.101s41.28x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.328s (-61.9% 🟢)2.009s (-49.9% 🟢)0.680s151.00x
🐘 PostgresNitro1.395s (-59.9% 🟢)2.008s (-49.9% 🟢)0.613s151.05x
💻 LocalExpress3.522s (-57.8% 🟢)4.011s (-55.6% 🟢)0.488s82.65x
💻 LocalNitro4.447s (-46.7% 🟢)5.011s (-44.4% 🟢)0.564s63.35x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.432s (+54.1% 🔺)6.911s (+24.9% 🔺)1.479s51.00x
▲ VercelNext.js (Turbopack)5.852s (-34.4% 🟢)7.738s (-29.4% 🟢)1.886s41.08x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.152s (-8.4% 🟢)2.009s (~)0.857s151.00x
🐘 PostgresExpress1.158s (-7.9% 🟢)2.008s (~)0.850s151.01x
💻 LocalExpress1.238s (-34.6% 🟢)2.006s (-15.1% 🟢)0.768s151.07x
💻 LocalNitro1.376s (-26.2% 🟢)2.006s (-14.3% 🟢)0.629s151.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.483s (+1.0%)3.737s (-10.4% 🟢)1.254s91.00x
▲ VercelNext.js (Turbopack)2.575s (-12.2% 🟢)4.082s (-12.1% 🟢)1.507s81.04x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.209s (-48.3% 🟢)2.008s (-33.3% 🟢)0.799s151.00x
🐘 PostgresExpress1.219s (-47.9% 🟢)2.007s (-33.3% 🟢)0.788s151.01x
💻 LocalExpress1.644s (-47.5% 🟢)2.005s (-46.7% 🟢)0.361s151.36x
💻 LocalNitro2.046s (-33.2% 🟢)2.469s (-36.5% 🟢)0.423s131.69x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.040s (+25.0% 🔺)5.730s (+12.9% 🔺)1.690s61.00x
▲ VercelNext.js (Turbopack)4.073s (+29.6% 🔺)5.712s (+26.3% 🔺)1.638s61.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.322s (-62.0% 🟢)2.009s (-49.9% 🟢)0.687s151.00x
🐘 PostgresExpress1.324s (-62.2% 🟢)2.007s (-50.0% 🟢)0.684s151.00x
💻 LocalExpress4.114s (-53.3% 🟢)4.868s (-47.5% 🟢)0.754s73.11x
💻 LocalNitro4.825s (-47.2% 🟢)5.345s (-46.7% 🟢)0.520s63.65x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.443s (+6.9% 🔺)7.984s (+17.1% 🔺)2.541s41.00x
▲ VercelNext.js (Turbopack)6.066s (-10.2% 🟢)8.119s (-5.0%)2.054s41.11x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.443s (-46.0% 🟢)1.007s (~)0.564s601.00x
💻 LocalExpress0.448s (-54.5% 🟢)1.003s (-6.7% 🟢)0.556s601.01x
🐘 PostgresExpress0.467s (-44.3% 🟢)1.007s (-1.6%)0.540s601.05x
💻 LocalNitro0.525s (-46.4% 🟢)1.039s (-5.1% 🟢)0.513s581.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.693s (-78.7% 🟢)6.239s (-74.0% 🟢)1.546s101.00x
▲ VercelNext.js (Turbopack)5.172s (-64.3% 🟢)6.923s (-57.0% 🟢)1.751s91.10x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.075s (-44.2% 🟢)1.964s (-6.5% 🟢)0.889s461.00x
💻 LocalExpress1.093s (-63.7% 🟢)1.702s (-52.5% 🟢)0.609s531.02x
🐘 PostgresExpress1.138s (-42.4% 🟢)2.030s (-10.1% 🟢)0.892s451.06x
💻 LocalNitro1.159s (-61.8% 🟢)2.006s (-46.6% 🟢)0.847s451.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro12.782s (-67.6% 🟢)14.361s (-65.2% 🟢)1.580s71.00x
▲ VercelNext.js (Turbopack)12.891s (-74.1% 🟢)14.919s (-71.2% 🟢)2.027s71.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.211s (-46.1% 🟢)2.865s (-37.8% 🟢)0.654s421.00x
🐘 PostgresExpress2.219s (-44.4% 🟢)3.085s (-29.4% 🟢)0.866s391.00x
💻 LocalExpress2.310s (-74.9% 🟢)3.007s (-70.0% 🟢)0.697s401.04x
💻 LocalNitro2.659s (-71.4% 🟢)3.033s (-69.7% 🟢)0.373s401.20x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro41.221s (-57.5% 🟢)43.002s (-56.3% 🟢)1.781s41.00x
▲ VercelNext.js (Turbopack)41.812s (-61.0% 🟢)43.995s (-59.6% 🟢)2.183s31.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.177s (-37.5% 🟢)1.006s (~)0.829s601.00x
🐘 PostgresExpress0.178s (-37.1% 🟢)1.006s (~)0.829s601.00x
💻 LocalExpress0.376s (-32.9% 🟢)1.003s (~)0.627s602.12x
💻 LocalNitro0.430s (-29.0% 🟢)1.004s (-1.7%)0.574s602.43x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.619s (+57.7% 🔺)4.330s (+29.2% 🔺)1.711s141.00x
▲ VercelNext.js (Turbopack)2.972s (+46.9% 🔺)5.256s (+38.5% 🔺)2.284s121.13x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.307s (-38.1% 🟢)1.007s (~)0.699s901.00x
🐘 PostgresExpress0.311s (-39.0% 🟢)1.014s (+0.7%)0.702s891.01x
💻 LocalExpress1.849s (-26.4% 🟢)2.252s (-25.2% 🟢)0.402s416.02x
💻 LocalNitro2.152s (-15.2% 🟢)2.797s (-7.1% 🟢)0.645s337.00x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.983s (+125.8% 🔺)9.874s (+90.1% 🔺)1.892s101.00x
▲ VercelNitro9.295s (+188.1% 🔺)10.915s (+126.4% 🔺)1.620s91.16x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.621s (-24.1% 🟢)1.006s (-1.1%)0.385s1201.00x
🐘 PostgresNitro0.639s (-19.2% 🟢)1.015s (+0.7%)0.376s1191.03x
💻 LocalExpress8.003s (-28.5% 🟢)8.667s (-27.4% 🟢)0.664s1412.88x
💻 LocalNitro9.963s (-11.0% 🟢)10.363s (-11.2% 🟢)0.400s1216.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.990s (+158.9% 🔺)21.905s (+133.0% 🔺)1.915s61.00x
▲ VercelNext.js (Turbopack)23.747s (+129.9% 🔺)26.134s (+112.7% 🔺)2.387s51.19x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.104s (+454.5% 🔺)2.004s (+99.5% 🔺)0.008s (-32.2% 🟢)2.014s (+97.9% 🔺)0.910s101.00x
💻 LocalNitro1.131s (+429.1% 🔺)2.005s (+99.6% 🔺)0.010s (-18.4% 🟢)2.017s (+98.0% 🔺)0.887s101.02x
🐘 PostgresExpress1.137s (+454.5% 🔺)2.000s (+100.3% 🔺)0.002s (-6.3% 🟢)2.010s (+98.7% 🔺)0.873s101.03x
🐘 PostgresNitro1.145s (+458.7% 🔺)1.999s (+100.0% 🔺)0.001s (-20.0% 🟢)2.010s (+98.7% 🔺)0.864s101.04x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.241s (-41.5% 🟢)3.316s (-37.2% 🟢)2.054s (+176.8% 🔺)5.808s (-10.4% 🟢)3.567s101.00x
▲ VercelNext.js (Turbopack)2.318s (-66.2% 🟢)3.661s (-57.7% 🟢)2.081s (+229.3% 🔺)6.240s (-36.3% 🟢)3.922s101.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.510s (+80.1% 🔺)2.010s (+98.7% 🔺)0.009s (-6.4% 🟢)2.021s (+81.1% 🔺)0.511s301.00x
🐘 PostgresExpress1.565s (+148.5% 🔺)2.005s (+99.2% 🔺)0.004s (+1.8%)2.026s (+98.1% 🔺)0.461s301.04x
🐘 PostgresNitro1.571s (+151.7% 🔺)2.037s (+102.4% 🔺)0.004s (-4.9%)2.058s (+101.3% 🔺)0.487s301.04x
💻 LocalExpress1.612s (+112.9% 🔺)2.010s (+95.3% 🔺)0.008s (-15.8% 🟢)2.198s (+111.4% 🔺)0.586s281.07x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.811s (-65.7% 🟢)7.125s (-60.9% 🟢)0.250s (+18.3% 🔺)7.983s (-57.8% 🟢)2.171s81.00x
▲ VercelNitro5.976s (-79.7% 🟢)7.199s (-76.6% 🟢)0.202s (+80.7% 🔺)7.811s (-75.4% 🟢)1.835s81.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.669s (-30.9% 🟢)1.033s (-17.2% 🟢)0.000s (-15.8% 🟢)1.058s (-15.9% 🟢)0.389s571.00x
🐘 PostgresExpress0.686s (-28.6% 🟢)1.051s (-17.8% 🟢)0.000s (+61.4% 🔺)1.060s (-18.9% 🟢)0.374s571.03x
💻 LocalExpress1.149s (-6.2% 🟢)1.981s (-2.0%)0.000s (-51.6% 🟢)1.983s (-2.0%)0.833s311.72x
💻 LocalNitro1.338s (+9.4% 🔺)2.016s (~)0.000s (+33.3% 🔺)2.018s (~)0.680s302.00x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.037s (-60.4% 🟢)5.321s (-53.8% 🟢)0.001s (+Infinity% 🔺)5.851s (-51.4% 🟢)1.814s111.00x
▲ VercelNitro4.253s (+39.4% 🔺)5.600s (+27.5% 🔺)0.000s (+30.0% 🔺)6.027s (+25.3% 🔺)1.774s101.05x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.325s (-26.1% 🟢)2.066s (-3.5%)0.000s (-3.4%)2.085s (-4.1%)0.761s291.00x
🐘 PostgresExpress1.389s (-21.6% 🟢)2.103s (-3.4%)0.000s (+Infinity% 🔺)2.114s (-3.8%)0.725s291.05x
💻 LocalExpress2.590s (-25.3% 🟢)2.974s (-26.3% 🟢)0.001s (-28.6% 🟢)2.979s (-26.2% 🟢)0.389s211.96x
💻 LocalNitro3.100s (-8.5% 🟢)3.967s (-1.6%)0.001s (+5.5% 🔺)3.970s (-1.6%)0.870s162.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.450s (+33.1% 🔺)6.924s (+28.8% 🔺)0.000s (-100.0% 🟢)7.361s (+27.1% 🔺)1.912s91.00x
▲ VercelNext.js (Turbopack)6.618s (+17.8% 🔺)7.864s (+12.6% 🔺)0.000s (-100.0% 🟢)8.355s (+10.8% 🔺)1.737s81.21x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress20/21
🐘 PostgresNitro14/21
▲ VercelNitro15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres12/21
Next.js (Turbopack)▲ Vercel21/21
Nitro🐘 Postgres14/21
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)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production119642191419
✅ 💻 Local Development158702191806
✅ 📦 Local Production158702191806
❌ 🐘 Local Postgres158612191806
✅ 🪟 Windows12900129
✅ 📋 Other7270176903
Total6812510527869

❌ Failed Tests

▲ Vercel Production (4 failed)

astro (1 failed):

  • AbortController abortAnyInStepWorkflow: AbortSignal.any inside a step composes deserialized signals

express (1 failed):

  • AbortController abortDeterministicBranchFromStepWorkflow: branches stay consistent when abort comes from a step

nuxt (1 failed):

  • runClassSerializationWorkflow - Run instances serialize across workflow/step boundaries | wrun_01KRMHFSCJH1N8FQ7XV2Z0EYWG | 🔍 observability

vite (1 failed):

  • fibonacciWorkflow - recursive workflow composition via start() | wrun_01KRMHG8R8XFT3RMXVQ70JM22A | 🔍 observability
🐘 Local Postgres (1 failed)

nextjs-webpack-stable-lazy-discovery-disabled (1 failed):

  • addTenWorkflow | wrun_01KRMH3MTK3F9C2E3XSFN0VC5C

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro102126
✅ example103026
❌ express102126
✅ fastify103026
✅ hono103026
✅ nextjs-turbopack12702
✅ nextjs-webpack12702
✅ nitro103026
❌ nuxt102126
✅ sveltekit12207
❌ vite102126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
❌ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
❌ nextjs-webpack-stable-lazy-discovery-disabled12810
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack12900
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable104025
✅ e2e-local-dev-tanstack-start-104025
✅ e2e-local-postgres-nest-stable104025
✅ e2e-local-postgres-tanstack-start-104025
✅ e2e-local-prod-nest-stable104025
✅ e2e-local-prod-tanstack-start-104025
✅ e2e-vercel-prod-tanstack-start103026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Add a comment please

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.

Done in c0a0ea35f / 107c5cbee: added a block comment explaining the 300s VQS visibility-timeout default, why we pass an explicit retry directive, and the idempotency expectation for close-together retries.

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 updates @workflow/world-vercel queue handling so failed VQS workflow handler invocations request an immediate retry directive instead of relying on the default visibility timeout.

Changes:

  • Adds a retry option to QueueClient.handleCallback.
  • Updates unit coverage for the callback retry option.
  • Adds a patch changeset for @workflow/world-vercel.

Reviewed changes

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

FileDescription
packages/world-vercel/src/queue.tsWires retry options into the VQS callback handler.
packages/world-vercel/src/queue.test.tsAdds/updates assertions for handleCallback retry behavior.
.changeset/retry-vqs-handler-errors-immediately.mdAdds release metadata for the world-vercel patch.

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

Comment thread.changeset/retry-vqs-handler-errors-immediately.md Outdated
Comment on lines +294 to 296
{
retry: () => ({ afterSeconds: 0 }),
}

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.

Updated in 107c5cbee: this no longer forces afterSeconds: 0. Handler failures now use delivery-count backoff starting at 1s and capped at 60s, so retries are quick without burning the delivery budget in a tight loop.

Comment on lines +368 to +373
expect(
options.retry(new Error('workflow server unavailable'), {
messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Updated in 107c5cbee: the test now asserts the bounded retry sequence instead of { afterSeconds: 0 }.

@karthikscale3karthikscale3 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.

Diagnosis is right — confirmed independently from staging Datadog logs that the 300s gap is the @vercel/queue default visibilityTimeoutSeconds. Fix wires the right API surface, but afterSeconds: 0 overcorrects in a few ways. Inline comments cover them. Worth pairing with a workflow-server-side change that maps getaddrinfo EBUSY / transient AWS SDK errors to 503 Retry-After: 1 so the SDK can retry without ever bouncing back to the queue.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

afterSeconds: 0 overrides the configured retryAfterSeconds: 5.

Per the @vercel/queue README: "the message is re-delivered after the configured retry delay (from retryAfterSeconds in vercel.json or the retry callback's afterSeconds)". So returning 0 here bypasses the trigger-config value the SDK already generates.

For the concrete bug that motivated this (DNS EBUSY on a Fluid Compute lambda whose libuv DNS thread pool was wedged for ~9s), a 0s retry will land back on the same wedged container before it recycles. The configured 5s would actually be the right floor.

Suggest: retry: () => ({ afterSeconds: 5 }) to match retryAfterSeconds in the generated trigger config, or read the value from a shared constant so they can't drift apart.

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.

5 seconds seems too long still. where is that floor coming from?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a good point about the interaction between afterSeconds in the retry callback and the retryAfterSeconds: 5 in the trigger config.

However, looking at the handler-side code in packages/core/src/runtime.ts (line 158) and packages/core/src/runtime/step-handler.ts (line 98), runs/steps are bounded at MAX_QUEUE_DELIVERIES = 48 attempts — the handler will gracefully fail the run before unbounded looping occurs. The comment in constants.ts does note the 48-attempt budget was sized assuming ~20 hours of elapsed time with the 5s backoff schedule, so with afterSeconds: 0 those 48 attempts would exhaust much faster.

That said, the main fix here (avoiding the 300s visibility lock) is clearly correct. The question is whether afterSeconds: 0 vs something like afterSeconds: 5 matters in practice — @pranaygp would know best whether VQS applies its own backoff on top of the afterSeconds value from the retry callback or if this truly replaces the entire schedule.

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.

Good catch. I agree that afterSeconds: 0 is more aggressive than needed. The retryAfterSeconds: 5 in the trigger config (also defined in packages/builders/src/constants.ts as WORKFLOW_QUEUE_TRIGGER.retryAfterSeconds) exists for a reason, and the retry callback's afterSeconds overrides it entirely.

The suggestion to use afterSeconds: 5 (or better, import from the shared WORKFLOW_QUEUE_TRIGGER constant) makes sense — it fixes the 300s visibility timeout problem while preserving the backoff floor that MAX_QUEUE_DELIVERIES = 48 was sized around.

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.

Adjusted in 107c5cbee after Pranay’s follow-up: instead of a 5s floor, the retry starts at 1s and then backs off by delivery count. That keeps the first retry quick while avoiding the original 0s hot-loop risk.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

No deliveryCount-aware backoff — poison messages will hot-loop.

This returns 0 for every delivery. For a permanently-broken message (malformed payload, schema mismatch, a workflow-server 500 that isn't transient), VQS will redeliver every ~0s until it hits its max-receive limit / DLQ. That's much hotter than the current 300s behavior.

Standard shape that handles both transient and stuck without classification:

retry: (_err,{ deliveryCount })=>({afterSeconds: Math.min(2**(deliveryCount-1),60),})

Gives 1s → 2s → 4s → 8s … capped at 60s. Fast enough for transient (full recovery within seconds), gentle enough not to thrash on a poison message.

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.

Implemented in 107c5cbee: handler errors now use delivery-count-aware backoff (1s -> 2s -> 4s -> 8s ...) capped at 60s.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Cross-system amplification risk during a workflow-server outage.

The 300s default is bad for happy-path latency but accidentally acts as a circuit-breaker when workflow-server is browning out — each in-flight message is held off-line for 5 min, naturally throttling redrive volume. With afterSeconds: 0, every dispatched VQS message will thrash workflow-server at full speed during exactly the situations we'd want to be gentle on.

The deliveryCount-aware backoff in my other comment addresses this too — once retries pile up, the per-message redrive rate self-throttles via exponential backoff.

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.

Addressed by the same backoff in 107c5cbee: repeated failures self-throttle up to a 60s cap instead of hammering workflow-server with 0s redrives.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Worth a comment here explaining why this retry handler exists.

Future readers will see retry: () => ({ afterSeconds: 0 }) and wonder why we explicitly opt into a non-default. A short block comment naming the 300s visibilityTimeoutSeconds default and the incident that motivated it (or the linked PR / issue) would make this durable. Without it, the next person to touch this is likely to remove it as redundant.

Also worth a one-line note that workflow/step handlers must be idempotent — the event-sourced model already required this for the 300s replay path, but tightening the redrive window makes back-to-back replays much more likely in practice.

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.

Done in c0a0ea35f / 107c5cbee: added the explanatory comment and called out the idempotency requirement.

messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Test asserts the directive shape but not the contract.

This invokes options.retry directly with a stubbed error, which verifies the function we pass in returns the right thing — but it doesn't exercise the path where @vercel/queue actually calls retry on a real handler throw. If handleCallback's contract for retry ever changes (different metadata shape, different return-type, called/not-called timing), this test still passes.

A small integration-style test using a real QueueClient with a throwing handler, then asserting redelivery happened with the expected delay, would catch contract drift. Not blocking — @vercel/queue owns the other side — but worth considering as a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test validates the contract that the production code passes to @vercel/queue — i.e., the retry callback shape and return value. Testing the actual handleCallback integration would require either not mocking @vercel/queue or a more complex integration test, which seems out of scope for a unit test. The mock-based approach here is consistent with how other handleCallback behavior is tested in this file (e.g., the existing mockHandleCallback pattern).

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.

Agree this is fine for now — it verifies the wiring correctly. An integration test with a real QueueClient would be more robust against contract drift but isn't blocking for this change.

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.

Leaving the real @vercel/queue contract test as a follow-up since that side is owned by the queue package. This PR now covers the world-vercel retry directive and the backoff values it returns.

@ctgowriectgowrie 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.

I don't think this will work. The problem is that we claim the message for 5 minutes. So even if we retry immediately, we will fail to claim the message.

Actually, this is a new message. We probably want some sort of backoff here, so we don't hammer the consumer. Lets discuss in slack

Comment threadpackages/world-vercel/src/queue.ts Outdated
Comment on lines +305 to +310
// Without an explicit retry directive, @vercel/queue leaves failed
// handler messages invisible until the default 300s visibility timeout
// expires. Start retrying quickly, then back off by delivery count so
// an outage or poison message cannot hot-loop. Workflow handlers are
// event-sourced and must remain idempotent because queue retries can
// happen close together.

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.

shouldn't VQS fallback to the configured 5s retryAfter configured in the config when nothing is explicitly set, instead of 300s visibility timeout?

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.

Checked against the @vercel/queue callback path in ~/github/vercel/vqs: the handler creates a consumer group with visibilityTimeoutSeconds defaulting to 300, and on handler throw it only calls changeVisibility when the retry callback returns { afterSeconds }. If the retry callback is absent/undefined, the error propagates and the message stays hidden until that visibility timeout expires. So this path does not appear to fall back to the trigger config’s retryAfterSeconds: 5; that matches the observed 300s retry delay and is why this PR keeps an explicit retry directive.

@pranaygp
pranaygp enabled auto-merge (squash) May 15, 2026 00:36
@pranaygp
pranaygp disabled auto-merge May 15, 2026 20:17
@pranaygp
pranaygp merged commit c43e721 into mainMay 15, 2026
113 of 120 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2007.

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.

5 participants

@pranaygp@TooTallNate@ctgowrie@karthikscale3
, '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 failed VQS handlers immediately - #1999

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry
May 15, 2026
Merged

Retry failed VQS handlers immediately#1999
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry

Conversation

@pranaygp

@pranaygppranaygp commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

When the Workflow queue handler throws, ask VQS to make the current message visible immediately instead of waiting for the default 300 second visibility lease to expire.

Root cause: the generated Workflow trigger config uses retryAfterSeconds: 5, but @workflow/world-vercel called QueueClient.handleCallback without a retry option. On handler failure, @vercel/queue propagated the error and the message stayed locked for the client default visibilityTimeoutSeconds: 300.

Changes

  • Pass retry: () => ({ afterSeconds: 0 }) to the VQS callback handler in @workflow/world-vercel.
  • Add a unit test asserting the retry directive is wired into handleCallback.
  • Add a patch changeset for @workflow/world-vercel.

Validation

  • git diff --check -- packages/world-vercel/src/queue.ts packages/world-vercel/src/queue.test.ts .changeset/retry-vqs-handler-errors-immediately.md
  • pnpm install with Node v24.15.0
  • pnpm --filter @workflow/utils build
  • pnpm --filter @workflow/errors build
  • pnpm --filter @workflow/world build
  • pnpm --filter @workflow/world-vercel build
  • pnpm --filter @workflow/world-vercel test -- queue.test.ts (69 tests passed)

CopilotAI review requested due to automatic review settings May 14, 2026 23:19
@pranaygp
pranaygp requested a review from a team as a code ownerMay 14, 2026 23:19
@changeset-bot

changeset-botBot commented May 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 45feb40

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

This PR includes changesets to release 19 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
tarballsPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@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

@vercel

vercelBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.025s (-44.0% 🟢)1.004s (~)0.979s101.00x
💻 LocalNitro0.030s (-29.7% 🟢)1.005s (~)0.975s101.22x
🐘 PostgresNitro0.054s (-43.2% 🟢)1.012s (-2.9%)0.958s102.18x
🐘 PostgresExpress0.063s (+9.3% 🔺)1.022s (+1.1%)0.959s102.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.231s (-43.7% 🟢)1.905s (-24.1% 🟢)1.675s101.00x
▲ VercelNext.js (Turbopack)0.304s (+20.9% 🔺)2.565s (+9.9% 🔺)2.261s101.32x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.056s (-6.2% 🟢)2.005s (~)0.949s101.00x
💻 LocalNitro1.065s (-5.8% 🟢)2.006s (~)0.941s101.01x
🐘 PostgresNitro1.082s (-5.1% 🟢)2.009s (~)0.927s101.02x
🐘 PostgresExpress1.086s (-5.3% 🟢)2.009s (~)0.923s101.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.602s (-21.3% 🟢)3.795s (-0.9%)2.193s101.00x
▲ VercelNitro1.681s (-56.8% 🟢)3.658s (-38.1% 🟢)1.976s101.05x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.327s (-5.4% 🟢)11.020s (~)0.693s31.00x
💻 LocalNitro10.404s (-4.9%)11.023s (~)0.618s31.01x
🐘 PostgresExpress10.417s (-5.0%)11.016s (~)0.599s31.01x
🐘 PostgresNitro10.427s (-4.1%)11.018s (~)0.591s31.01x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro13.713s (-42.2% 🟢)15.652s (-37.7% 🟢)1.939s21.00x
▲ VercelNext.js (Turbopack)13.851s (-20.0% 🟢)16.149s (-16.8% 🟢)2.299s21.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express13.252s (-11.5% 🟢)14.024s (-6.7% 🟢)0.772s51.00x
💻 LocalNitro13.425s (-10.9% 🟢)14.028s (-12.5% 🟢)0.603s51.01x
🐘 PostgresNitro13.454s (-7.8% 🟢)14.017s (-6.7% 🟢)0.563s51.02x
🐘 PostgresExpress13.530s (-7.2% 🟢)14.018s (-6.7% 🟢)0.488s51.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)21.402s (-59.3% 🟢)23.235s (-57.5% 🟢)1.833s31.00x
▲ VercelNitro21.447s (-66.7% 🟢)23.241s (-65.1% 🟢)1.794s31.00x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express11.579s (-30.3% 🟢)12.021s (-29.4% 🟢)0.443s81.00x
💻 LocalNitro11.845s (-29.4% 🟢)12.024s (-29.4% 🟢)0.179s81.02x
🐘 PostgresNitro12.024s (-13.9% 🟢)12.643s (-11.6% 🟢)0.619s81.04x
🐘 PostgresExpress12.057s (-13.9% 🟢)12.516s (-14.2% 🟢)0.459s81.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro35.366s (-91.6% 🟢)37.002s (-91.3% 🟢)1.636s31.00x
▲ VercelNext.js (Turbopack)36.089s (-90.8% 🟢)39.185s (-90.1% 🟢)3.096s31.02x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.135s (-23.7% 🟢)2.005s (~)0.870s151.00x
🐘 PostgresExpress1.136s (-9.8% 🟢)2.008s (~)0.871s151.00x
🐘 PostgresNitro1.145s (-10.2% 🟢)2.007s (~)0.862s151.01x
💻 LocalNitro1.173s (-28.1% 🟢)2.006s (-3.3%)0.833s151.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.552s (-9.4% 🟢)4.180s (-3.3%)1.627s81.00x
▲ VercelNext.js (Turbopack)2.792s (-17.8% 🟢)4.564s (-7.5% 🟢)1.772s71.09x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-48.7% 🟢)2.007s (-33.3% 🟢)0.797s151.00x
🐘 PostgresNitro1.272s (-45.9% 🟢)2.074s (-31.1% 🟢)0.802s151.05x
💻 LocalExpress1.553s (-47.4% 🟢)2.006s (-41.9% 🟢)0.453s151.28x
💻 LocalNitro1.678s (-46.6% 🟢)2.005s (-48.4% 🟢)0.327s151.39x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.458s (-37.2% 🟢)6.227s (-30.1% 🟢)1.769s61.00x
▲ VercelNitro5.689s (+40.4% 🔺)7.790s (+31.6% 🔺)2.101s41.28x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.328s (-61.9% 🟢)2.009s (-49.9% 🟢)0.680s151.00x
🐘 PostgresNitro1.395s (-59.9% 🟢)2.008s (-49.9% 🟢)0.613s151.05x
💻 LocalExpress3.522s (-57.8% 🟢)4.011s (-55.6% 🟢)0.488s82.65x
💻 LocalNitro4.447s (-46.7% 🟢)5.011s (-44.4% 🟢)0.564s63.35x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.432s (+54.1% 🔺)6.911s (+24.9% 🔺)1.479s51.00x
▲ VercelNext.js (Turbopack)5.852s (-34.4% 🟢)7.738s (-29.4% 🟢)1.886s41.08x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.152s (-8.4% 🟢)2.009s (~)0.857s151.00x
🐘 PostgresExpress1.158s (-7.9% 🟢)2.008s (~)0.850s151.01x
💻 LocalExpress1.238s (-34.6% 🟢)2.006s (-15.1% 🟢)0.768s151.07x
💻 LocalNitro1.376s (-26.2% 🟢)2.006s (-14.3% 🟢)0.629s151.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.483s (+1.0%)3.737s (-10.4% 🟢)1.254s91.00x
▲ VercelNext.js (Turbopack)2.575s (-12.2% 🟢)4.082s (-12.1% 🟢)1.507s81.04x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.209s (-48.3% 🟢)2.008s (-33.3% 🟢)0.799s151.00x
🐘 PostgresExpress1.219s (-47.9% 🟢)2.007s (-33.3% 🟢)0.788s151.01x
💻 LocalExpress1.644s (-47.5% 🟢)2.005s (-46.7% 🟢)0.361s151.36x
💻 LocalNitro2.046s (-33.2% 🟢)2.469s (-36.5% 🟢)0.423s131.69x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.040s (+25.0% 🔺)5.730s (+12.9% 🔺)1.690s61.00x
▲ VercelNext.js (Turbopack)4.073s (+29.6% 🔺)5.712s (+26.3% 🔺)1.638s61.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.322s (-62.0% 🟢)2.009s (-49.9% 🟢)0.687s151.00x
🐘 PostgresExpress1.324s (-62.2% 🟢)2.007s (-50.0% 🟢)0.684s151.00x
💻 LocalExpress4.114s (-53.3% 🟢)4.868s (-47.5% 🟢)0.754s73.11x
💻 LocalNitro4.825s (-47.2% 🟢)5.345s (-46.7% 🟢)0.520s63.65x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.443s (+6.9% 🔺)7.984s (+17.1% 🔺)2.541s41.00x
▲ VercelNext.js (Turbopack)6.066s (-10.2% 🟢)8.119s (-5.0%)2.054s41.11x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.443s (-46.0% 🟢)1.007s (~)0.564s601.00x
💻 LocalExpress0.448s (-54.5% 🟢)1.003s (-6.7% 🟢)0.556s601.01x
🐘 PostgresExpress0.467s (-44.3% 🟢)1.007s (-1.6%)0.540s601.05x
💻 LocalNitro0.525s (-46.4% 🟢)1.039s (-5.1% 🟢)0.513s581.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.693s (-78.7% 🟢)6.239s (-74.0% 🟢)1.546s101.00x
▲ VercelNext.js (Turbopack)5.172s (-64.3% 🟢)6.923s (-57.0% 🟢)1.751s91.10x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.075s (-44.2% 🟢)1.964s (-6.5% 🟢)0.889s461.00x
💻 LocalExpress1.093s (-63.7% 🟢)1.702s (-52.5% 🟢)0.609s531.02x
🐘 PostgresExpress1.138s (-42.4% 🟢)2.030s (-10.1% 🟢)0.892s451.06x
💻 LocalNitro1.159s (-61.8% 🟢)2.006s (-46.6% 🟢)0.847s451.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro12.782s (-67.6% 🟢)14.361s (-65.2% 🟢)1.580s71.00x
▲ VercelNext.js (Turbopack)12.891s (-74.1% 🟢)14.919s (-71.2% 🟢)2.027s71.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.211s (-46.1% 🟢)2.865s (-37.8% 🟢)0.654s421.00x
🐘 PostgresExpress2.219s (-44.4% 🟢)3.085s (-29.4% 🟢)0.866s391.00x
💻 LocalExpress2.310s (-74.9% 🟢)3.007s (-70.0% 🟢)0.697s401.04x
💻 LocalNitro2.659s (-71.4% 🟢)3.033s (-69.7% 🟢)0.373s401.20x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro41.221s (-57.5% 🟢)43.002s (-56.3% 🟢)1.781s41.00x
▲ VercelNext.js (Turbopack)41.812s (-61.0% 🟢)43.995s (-59.6% 🟢)2.183s31.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.177s (-37.5% 🟢)1.006s (~)0.829s601.00x
🐘 PostgresExpress0.178s (-37.1% 🟢)1.006s (~)0.829s601.00x
💻 LocalExpress0.376s (-32.9% 🟢)1.003s (~)0.627s602.12x
💻 LocalNitro0.430s (-29.0% 🟢)1.004s (-1.7%)0.574s602.43x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.619s (+57.7% 🔺)4.330s (+29.2% 🔺)1.711s141.00x
▲ VercelNext.js (Turbopack)2.972s (+46.9% 🔺)5.256s (+38.5% 🔺)2.284s121.13x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.307s (-38.1% 🟢)1.007s (~)0.699s901.00x
🐘 PostgresExpress0.311s (-39.0% 🟢)1.014s (+0.7%)0.702s891.01x
💻 LocalExpress1.849s (-26.4% 🟢)2.252s (-25.2% 🟢)0.402s416.02x
💻 LocalNitro2.152s (-15.2% 🟢)2.797s (-7.1% 🟢)0.645s337.00x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.983s (+125.8% 🔺)9.874s (+90.1% 🔺)1.892s101.00x
▲ VercelNitro9.295s (+188.1% 🔺)10.915s (+126.4% 🔺)1.620s91.16x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.621s (-24.1% 🟢)1.006s (-1.1%)0.385s1201.00x
🐘 PostgresNitro0.639s (-19.2% 🟢)1.015s (+0.7%)0.376s1191.03x
💻 LocalExpress8.003s (-28.5% 🟢)8.667s (-27.4% 🟢)0.664s1412.88x
💻 LocalNitro9.963s (-11.0% 🟢)10.363s (-11.2% 🟢)0.400s1216.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.990s (+158.9% 🔺)21.905s (+133.0% 🔺)1.915s61.00x
▲ VercelNext.js (Turbopack)23.747s (+129.9% 🔺)26.134s (+112.7% 🔺)2.387s51.19x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.104s (+454.5% 🔺)2.004s (+99.5% 🔺)0.008s (-32.2% 🟢)2.014s (+97.9% 🔺)0.910s101.00x
💻 LocalNitro1.131s (+429.1% 🔺)2.005s (+99.6% 🔺)0.010s (-18.4% 🟢)2.017s (+98.0% 🔺)0.887s101.02x
🐘 PostgresExpress1.137s (+454.5% 🔺)2.000s (+100.3% 🔺)0.002s (-6.3% 🟢)2.010s (+98.7% 🔺)0.873s101.03x
🐘 PostgresNitro1.145s (+458.7% 🔺)1.999s (+100.0% 🔺)0.001s (-20.0% 🟢)2.010s (+98.7% 🔺)0.864s101.04x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.241s (-41.5% 🟢)3.316s (-37.2% 🟢)2.054s (+176.8% 🔺)5.808s (-10.4% 🟢)3.567s101.00x
▲ VercelNext.js (Turbopack)2.318s (-66.2% 🟢)3.661s (-57.7% 🟢)2.081s (+229.3% 🔺)6.240s (-36.3% 🟢)3.922s101.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.510s (+80.1% 🔺)2.010s (+98.7% 🔺)0.009s (-6.4% 🟢)2.021s (+81.1% 🔺)0.511s301.00x
🐘 PostgresExpress1.565s (+148.5% 🔺)2.005s (+99.2% 🔺)0.004s (+1.8%)2.026s (+98.1% 🔺)0.461s301.04x
🐘 PostgresNitro1.571s (+151.7% 🔺)2.037s (+102.4% 🔺)0.004s (-4.9%)2.058s (+101.3% 🔺)0.487s301.04x
💻 LocalExpress1.612s (+112.9% 🔺)2.010s (+95.3% 🔺)0.008s (-15.8% 🟢)2.198s (+111.4% 🔺)0.586s281.07x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.811s (-65.7% 🟢)7.125s (-60.9% 🟢)0.250s (+18.3% 🔺)7.983s (-57.8% 🟢)2.171s81.00x
▲ VercelNitro5.976s (-79.7% 🟢)7.199s (-76.6% 🟢)0.202s (+80.7% 🔺)7.811s (-75.4% 🟢)1.835s81.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.669s (-30.9% 🟢)1.033s (-17.2% 🟢)0.000s (-15.8% 🟢)1.058s (-15.9% 🟢)0.389s571.00x
🐘 PostgresExpress0.686s (-28.6% 🟢)1.051s (-17.8% 🟢)0.000s (+61.4% 🔺)1.060s (-18.9% 🟢)0.374s571.03x
💻 LocalExpress1.149s (-6.2% 🟢)1.981s (-2.0%)0.000s (-51.6% 🟢)1.983s (-2.0%)0.833s311.72x
💻 LocalNitro1.338s (+9.4% 🔺)2.016s (~)0.000s (+33.3% 🔺)2.018s (~)0.680s302.00x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.037s (-60.4% 🟢)5.321s (-53.8% 🟢)0.001s (+Infinity% 🔺)5.851s (-51.4% 🟢)1.814s111.00x
▲ VercelNitro4.253s (+39.4% 🔺)5.600s (+27.5% 🔺)0.000s (+30.0% 🔺)6.027s (+25.3% 🔺)1.774s101.05x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.325s (-26.1% 🟢)2.066s (-3.5%)0.000s (-3.4%)2.085s (-4.1%)0.761s291.00x
🐘 PostgresExpress1.389s (-21.6% 🟢)2.103s (-3.4%)0.000s (+Infinity% 🔺)2.114s (-3.8%)0.725s291.05x
💻 LocalExpress2.590s (-25.3% 🟢)2.974s (-26.3% 🟢)0.001s (-28.6% 🟢)2.979s (-26.2% 🟢)0.389s211.96x
💻 LocalNitro3.100s (-8.5% 🟢)3.967s (-1.6%)0.001s (+5.5% 🔺)3.970s (-1.6%)0.870s162.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.450s (+33.1% 🔺)6.924s (+28.8% 🔺)0.000s (-100.0% 🟢)7.361s (+27.1% 🔺)1.912s91.00x
▲ VercelNext.js (Turbopack)6.618s (+17.8% 🔺)7.864s (+12.6% 🔺)0.000s (-100.0% 🟢)8.355s (+10.8% 🔺)1.737s81.21x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress20/21
🐘 PostgresNitro14/21
▲ VercelNitro15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres12/21
Next.js (Turbopack)▲ Vercel21/21
Nitro🐘 Postgres14/21
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)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production119642191419
✅ 💻 Local Development158702191806
✅ 📦 Local Production158702191806
❌ 🐘 Local Postgres158612191806
✅ 🪟 Windows12900129
✅ 📋 Other7270176903
Total6812510527869

❌ Failed Tests

▲ Vercel Production (4 failed)

astro (1 failed):

  • AbortController abortAnyInStepWorkflow: AbortSignal.any inside a step composes deserialized signals

express (1 failed):

  • AbortController abortDeterministicBranchFromStepWorkflow: branches stay consistent when abort comes from a step

nuxt (1 failed):

  • runClassSerializationWorkflow - Run instances serialize across workflow/step boundaries | wrun_01KRMHFSCJH1N8FQ7XV2Z0EYWG | 🔍 observability

vite (1 failed):

  • fibonacciWorkflow - recursive workflow composition via start() | wrun_01KRMHG8R8XFT3RMXVQ70JM22A | 🔍 observability
🐘 Local Postgres (1 failed)

nextjs-webpack-stable-lazy-discovery-disabled (1 failed):

  • addTenWorkflow | wrun_01KRMH3MTK3F9C2E3XSFN0VC5C

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro102126
✅ example103026
❌ express102126
✅ fastify103026
✅ hono103026
✅ nextjs-turbopack12702
✅ nextjs-webpack12702
✅ nitro103026
❌ nuxt102126
✅ sveltekit12207
❌ vite102126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
❌ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
❌ nextjs-webpack-stable-lazy-discovery-disabled12810
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack12900
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable104025
✅ e2e-local-dev-tanstack-start-104025
✅ e2e-local-postgres-nest-stable104025
✅ e2e-local-postgres-tanstack-start-104025
✅ e2e-local-prod-nest-stable104025
✅ e2e-local-prod-tanstack-start-104025
✅ e2e-vercel-prod-tanstack-start103026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Add a comment please

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.

Done in c0a0ea35f / 107c5cbee: added a block comment explaining the 300s VQS visibility-timeout default, why we pass an explicit retry directive, and the idempotency expectation for close-together retries.

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 updates @workflow/world-vercel queue handling so failed VQS workflow handler invocations request an immediate retry directive instead of relying on the default visibility timeout.

Changes:

  • Adds a retry option to QueueClient.handleCallback.
  • Updates unit coverage for the callback retry option.
  • Adds a patch changeset for @workflow/world-vercel.

Reviewed changes

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

FileDescription
packages/world-vercel/src/queue.tsWires retry options into the VQS callback handler.
packages/world-vercel/src/queue.test.tsAdds/updates assertions for handleCallback retry behavior.
.changeset/retry-vqs-handler-errors-immediately.mdAdds release metadata for the world-vercel patch.

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

Comment thread.changeset/retry-vqs-handler-errors-immediately.md Outdated
Comment on lines +294 to 296
{
retry: () => ({ afterSeconds: 0 }),
}

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.

Updated in 107c5cbee: this no longer forces afterSeconds: 0. Handler failures now use delivery-count backoff starting at 1s and capped at 60s, so retries are quick without burning the delivery budget in a tight loop.

Comment on lines +368 to +373
expect(
options.retry(new Error('workflow server unavailable'), {
messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Updated in 107c5cbee: the test now asserts the bounded retry sequence instead of { afterSeconds: 0 }.

@karthikscale3karthikscale3 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.

Diagnosis is right — confirmed independently from staging Datadog logs that the 300s gap is the @vercel/queue default visibilityTimeoutSeconds. Fix wires the right API surface, but afterSeconds: 0 overcorrects in a few ways. Inline comments cover them. Worth pairing with a workflow-server-side change that maps getaddrinfo EBUSY / transient AWS SDK errors to 503 Retry-After: 1 so the SDK can retry without ever bouncing back to the queue.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

afterSeconds: 0 overrides the configured retryAfterSeconds: 5.

Per the @vercel/queue README: "the message is re-delivered after the configured retry delay (from retryAfterSeconds in vercel.json or the retry callback's afterSeconds)". So returning 0 here bypasses the trigger-config value the SDK already generates.

For the concrete bug that motivated this (DNS EBUSY on a Fluid Compute lambda whose libuv DNS thread pool was wedged for ~9s), a 0s retry will land back on the same wedged container before it recycles. The configured 5s would actually be the right floor.

Suggest: retry: () => ({ afterSeconds: 5 }) to match retryAfterSeconds in the generated trigger config, or read the value from a shared constant so they can't drift apart.

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.

5 seconds seems too long still. where is that floor coming from?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a good point about the interaction between afterSeconds in the retry callback and the retryAfterSeconds: 5 in the trigger config.

However, looking at the handler-side code in packages/core/src/runtime.ts (line 158) and packages/core/src/runtime/step-handler.ts (line 98), runs/steps are bounded at MAX_QUEUE_DELIVERIES = 48 attempts — the handler will gracefully fail the run before unbounded looping occurs. The comment in constants.ts does note the 48-attempt budget was sized assuming ~20 hours of elapsed time with the 5s backoff schedule, so with afterSeconds: 0 those 48 attempts would exhaust much faster.

That said, the main fix here (avoiding the 300s visibility lock) is clearly correct. The question is whether afterSeconds: 0 vs something like afterSeconds: 5 matters in practice — @pranaygp would know best whether VQS applies its own backoff on top of the afterSeconds value from the retry callback or if this truly replaces the entire schedule.

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.

Good catch. I agree that afterSeconds: 0 is more aggressive than needed. The retryAfterSeconds: 5 in the trigger config (also defined in packages/builders/src/constants.ts as WORKFLOW_QUEUE_TRIGGER.retryAfterSeconds) exists for a reason, and the retry callback's afterSeconds overrides it entirely.

The suggestion to use afterSeconds: 5 (or better, import from the shared WORKFLOW_QUEUE_TRIGGER constant) makes sense — it fixes the 300s visibility timeout problem while preserving the backoff floor that MAX_QUEUE_DELIVERIES = 48 was sized around.

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.

Adjusted in 107c5cbee after Pranay’s follow-up: instead of a 5s floor, the retry starts at 1s and then backs off by delivery count. That keeps the first retry quick while avoiding the original 0s hot-loop risk.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

No deliveryCount-aware backoff — poison messages will hot-loop.

This returns 0 for every delivery. For a permanently-broken message (malformed payload, schema mismatch, a workflow-server 500 that isn't transient), VQS will redeliver every ~0s until it hits its max-receive limit / DLQ. That's much hotter than the current 300s behavior.

Standard shape that handles both transient and stuck without classification:

retry: (_err,{ deliveryCount })=>({afterSeconds: Math.min(2**(deliveryCount-1),60),})

Gives 1s → 2s → 4s → 8s … capped at 60s. Fast enough for transient (full recovery within seconds), gentle enough not to thrash on a poison message.

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.

Implemented in 107c5cbee: handler errors now use delivery-count-aware backoff (1s -> 2s -> 4s -> 8s ...) capped at 60s.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Cross-system amplification risk during a workflow-server outage.

The 300s default is bad for happy-path latency but accidentally acts as a circuit-breaker when workflow-server is browning out — each in-flight message is held off-line for 5 min, naturally throttling redrive volume. With afterSeconds: 0, every dispatched VQS message will thrash workflow-server at full speed during exactly the situations we'd want to be gentle on.

The deliveryCount-aware backoff in my other comment addresses this too — once retries pile up, the per-message redrive rate self-throttles via exponential backoff.

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.

Addressed by the same backoff in 107c5cbee: repeated failures self-throttle up to a 60s cap instead of hammering workflow-server with 0s redrives.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Worth a comment here explaining why this retry handler exists.

Future readers will see retry: () => ({ afterSeconds: 0 }) and wonder why we explicitly opt into a non-default. A short block comment naming the 300s visibilityTimeoutSeconds default and the incident that motivated it (or the linked PR / issue) would make this durable. Without it, the next person to touch this is likely to remove it as redundant.

Also worth a one-line note that workflow/step handlers must be idempotent — the event-sourced model already required this for the 300s replay path, but tightening the redrive window makes back-to-back replays much more likely in practice.

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.

Done in c0a0ea35f / 107c5cbee: added the explanatory comment and called out the idempotency requirement.

messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Test asserts the directive shape but not the contract.

This invokes options.retry directly with a stubbed error, which verifies the function we pass in returns the right thing — but it doesn't exercise the path where @vercel/queue actually calls retry on a real handler throw. If handleCallback's contract for retry ever changes (different metadata shape, different return-type, called/not-called timing), this test still passes.

A small integration-style test using a real QueueClient with a throwing handler, then asserting redelivery happened with the expected delay, would catch contract drift. Not blocking — @vercel/queue owns the other side — but worth considering as a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test validates the contract that the production code passes to @vercel/queue — i.e., the retry callback shape and return value. Testing the actual handleCallback integration would require either not mocking @vercel/queue or a more complex integration test, which seems out of scope for a unit test. The mock-based approach here is consistent with how other handleCallback behavior is tested in this file (e.g., the existing mockHandleCallback pattern).

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.

Agree this is fine for now — it verifies the wiring correctly. An integration test with a real QueueClient would be more robust against contract drift but isn't blocking for this change.

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.

Leaving the real @vercel/queue contract test as a follow-up since that side is owned by the queue package. This PR now covers the world-vercel retry directive and the backoff values it returns.

@ctgowriectgowrie 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.

I don't think this will work. The problem is that we claim the message for 5 minutes. So even if we retry immediately, we will fail to claim the message.

Actually, this is a new message. We probably want some sort of backoff here, so we don't hammer the consumer. Lets discuss in slack

Comment threadpackages/world-vercel/src/queue.ts Outdated
Comment on lines +305 to +310
// Without an explicit retry directive, @vercel/queue leaves failed
// handler messages invisible until the default 300s visibility timeout
// expires. Start retrying quickly, then back off by delivery count so
// an outage or poison message cannot hot-loop. Workflow handlers are
// event-sourced and must remain idempotent because queue retries can
// happen close together.

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.

shouldn't VQS fallback to the configured 5s retryAfter configured in the config when nothing is explicitly set, instead of 300s visibility timeout?

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.

Checked against the @vercel/queue callback path in ~/github/vercel/vqs: the handler creates a consumer group with visibilityTimeoutSeconds defaulting to 300, and on handler throw it only calls changeVisibility when the retry callback returns { afterSeconds }. If the retry callback is absent/undefined, the error propagates and the message stays hidden until that visibility timeout expires. So this path does not appear to fall back to the trigger config’s retryAfterSeconds: 5; that matches the observed 300s retry delay and is why this PR keeps an explicit retry directive.

@pranaygp
pranaygp enabled auto-merge (squash) May 15, 2026 00:36
@pranaygp
pranaygp disabled auto-merge May 15, 2026 20:17
@pranaygp
pranaygp merged commit c43e721 into mainMay 15, 2026
113 of 120 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2007.

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.

5 participants

@pranaygp@TooTallNate@ctgowrie@karthikscale3
, '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 failed VQS handlers immediately - #1999

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry
May 15, 2026
Merged

Retry failed VQS handlers immediately#1999
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry

Conversation

@pranaygp

@pranaygppranaygp commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

When the Workflow queue handler throws, ask VQS to make the current message visible immediately instead of waiting for the default 300 second visibility lease to expire.

Root cause: the generated Workflow trigger config uses retryAfterSeconds: 5, but @workflow/world-vercel called QueueClient.handleCallback without a retry option. On handler failure, @vercel/queue propagated the error and the message stayed locked for the client default visibilityTimeoutSeconds: 300.

Changes

  • Pass retry: () => ({ afterSeconds: 0 }) to the VQS callback handler in @workflow/world-vercel.
  • Add a unit test asserting the retry directive is wired into handleCallback.
  • Add a patch changeset for @workflow/world-vercel.

Validation

  • git diff --check -- packages/world-vercel/src/queue.ts packages/world-vercel/src/queue.test.ts .changeset/retry-vqs-handler-errors-immediately.md
  • pnpm install with Node v24.15.0
  • pnpm --filter @workflow/utils build
  • pnpm --filter @workflow/errors build
  • pnpm --filter @workflow/world build
  • pnpm --filter @workflow/world-vercel build
  • pnpm --filter @workflow/world-vercel test -- queue.test.ts (69 tests passed)

CopilotAI review requested due to automatic review settings May 14, 2026 23:19
@pranaygp
pranaygp requested a review from a team as a code ownerMay 14, 2026 23:19
@changeset-bot

changeset-botBot commented May 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 45feb40

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

This PR includes changesets to release 19 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
tarballsPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@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

@vercel

vercelBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.025s (-44.0% 🟢)1.004s (~)0.979s101.00x
💻 LocalNitro0.030s (-29.7% 🟢)1.005s (~)0.975s101.22x
🐘 PostgresNitro0.054s (-43.2% 🟢)1.012s (-2.9%)0.958s102.18x
🐘 PostgresExpress0.063s (+9.3% 🔺)1.022s (+1.1%)0.959s102.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.231s (-43.7% 🟢)1.905s (-24.1% 🟢)1.675s101.00x
▲ VercelNext.js (Turbopack)0.304s (+20.9% 🔺)2.565s (+9.9% 🔺)2.261s101.32x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.056s (-6.2% 🟢)2.005s (~)0.949s101.00x
💻 LocalNitro1.065s (-5.8% 🟢)2.006s (~)0.941s101.01x
🐘 PostgresNitro1.082s (-5.1% 🟢)2.009s (~)0.927s101.02x
🐘 PostgresExpress1.086s (-5.3% 🟢)2.009s (~)0.923s101.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.602s (-21.3% 🟢)3.795s (-0.9%)2.193s101.00x
▲ VercelNitro1.681s (-56.8% 🟢)3.658s (-38.1% 🟢)1.976s101.05x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.327s (-5.4% 🟢)11.020s (~)0.693s31.00x
💻 LocalNitro10.404s (-4.9%)11.023s (~)0.618s31.01x
🐘 PostgresExpress10.417s (-5.0%)11.016s (~)0.599s31.01x
🐘 PostgresNitro10.427s (-4.1%)11.018s (~)0.591s31.01x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro13.713s (-42.2% 🟢)15.652s (-37.7% 🟢)1.939s21.00x
▲ VercelNext.js (Turbopack)13.851s (-20.0% 🟢)16.149s (-16.8% 🟢)2.299s21.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express13.252s (-11.5% 🟢)14.024s (-6.7% 🟢)0.772s51.00x
💻 LocalNitro13.425s (-10.9% 🟢)14.028s (-12.5% 🟢)0.603s51.01x
🐘 PostgresNitro13.454s (-7.8% 🟢)14.017s (-6.7% 🟢)0.563s51.02x
🐘 PostgresExpress13.530s (-7.2% 🟢)14.018s (-6.7% 🟢)0.488s51.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)21.402s (-59.3% 🟢)23.235s (-57.5% 🟢)1.833s31.00x
▲ VercelNitro21.447s (-66.7% 🟢)23.241s (-65.1% 🟢)1.794s31.00x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express11.579s (-30.3% 🟢)12.021s (-29.4% 🟢)0.443s81.00x
💻 LocalNitro11.845s (-29.4% 🟢)12.024s (-29.4% 🟢)0.179s81.02x
🐘 PostgresNitro12.024s (-13.9% 🟢)12.643s (-11.6% 🟢)0.619s81.04x
🐘 PostgresExpress12.057s (-13.9% 🟢)12.516s (-14.2% 🟢)0.459s81.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro35.366s (-91.6% 🟢)37.002s (-91.3% 🟢)1.636s31.00x
▲ VercelNext.js (Turbopack)36.089s (-90.8% 🟢)39.185s (-90.1% 🟢)3.096s31.02x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.135s (-23.7% 🟢)2.005s (~)0.870s151.00x
🐘 PostgresExpress1.136s (-9.8% 🟢)2.008s (~)0.871s151.00x
🐘 PostgresNitro1.145s (-10.2% 🟢)2.007s (~)0.862s151.01x
💻 LocalNitro1.173s (-28.1% 🟢)2.006s (-3.3%)0.833s151.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.552s (-9.4% 🟢)4.180s (-3.3%)1.627s81.00x
▲ VercelNext.js (Turbopack)2.792s (-17.8% 🟢)4.564s (-7.5% 🟢)1.772s71.09x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-48.7% 🟢)2.007s (-33.3% 🟢)0.797s151.00x
🐘 PostgresNitro1.272s (-45.9% 🟢)2.074s (-31.1% 🟢)0.802s151.05x
💻 LocalExpress1.553s (-47.4% 🟢)2.006s (-41.9% 🟢)0.453s151.28x
💻 LocalNitro1.678s (-46.6% 🟢)2.005s (-48.4% 🟢)0.327s151.39x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.458s (-37.2% 🟢)6.227s (-30.1% 🟢)1.769s61.00x
▲ VercelNitro5.689s (+40.4% 🔺)7.790s (+31.6% 🔺)2.101s41.28x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.328s (-61.9% 🟢)2.009s (-49.9% 🟢)0.680s151.00x
🐘 PostgresNitro1.395s (-59.9% 🟢)2.008s (-49.9% 🟢)0.613s151.05x
💻 LocalExpress3.522s (-57.8% 🟢)4.011s (-55.6% 🟢)0.488s82.65x
💻 LocalNitro4.447s (-46.7% 🟢)5.011s (-44.4% 🟢)0.564s63.35x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.432s (+54.1% 🔺)6.911s (+24.9% 🔺)1.479s51.00x
▲ VercelNext.js (Turbopack)5.852s (-34.4% 🟢)7.738s (-29.4% 🟢)1.886s41.08x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.152s (-8.4% 🟢)2.009s (~)0.857s151.00x
🐘 PostgresExpress1.158s (-7.9% 🟢)2.008s (~)0.850s151.01x
💻 LocalExpress1.238s (-34.6% 🟢)2.006s (-15.1% 🟢)0.768s151.07x
💻 LocalNitro1.376s (-26.2% 🟢)2.006s (-14.3% 🟢)0.629s151.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.483s (+1.0%)3.737s (-10.4% 🟢)1.254s91.00x
▲ VercelNext.js (Turbopack)2.575s (-12.2% 🟢)4.082s (-12.1% 🟢)1.507s81.04x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.209s (-48.3% 🟢)2.008s (-33.3% 🟢)0.799s151.00x
🐘 PostgresExpress1.219s (-47.9% 🟢)2.007s (-33.3% 🟢)0.788s151.01x
💻 LocalExpress1.644s (-47.5% 🟢)2.005s (-46.7% 🟢)0.361s151.36x
💻 LocalNitro2.046s (-33.2% 🟢)2.469s (-36.5% 🟢)0.423s131.69x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.040s (+25.0% 🔺)5.730s (+12.9% 🔺)1.690s61.00x
▲ VercelNext.js (Turbopack)4.073s (+29.6% 🔺)5.712s (+26.3% 🔺)1.638s61.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.322s (-62.0% 🟢)2.009s (-49.9% 🟢)0.687s151.00x
🐘 PostgresExpress1.324s (-62.2% 🟢)2.007s (-50.0% 🟢)0.684s151.00x
💻 LocalExpress4.114s (-53.3% 🟢)4.868s (-47.5% 🟢)0.754s73.11x
💻 LocalNitro4.825s (-47.2% 🟢)5.345s (-46.7% 🟢)0.520s63.65x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.443s (+6.9% 🔺)7.984s (+17.1% 🔺)2.541s41.00x
▲ VercelNext.js (Turbopack)6.066s (-10.2% 🟢)8.119s (-5.0%)2.054s41.11x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.443s (-46.0% 🟢)1.007s (~)0.564s601.00x
💻 LocalExpress0.448s (-54.5% 🟢)1.003s (-6.7% 🟢)0.556s601.01x
🐘 PostgresExpress0.467s (-44.3% 🟢)1.007s (-1.6%)0.540s601.05x
💻 LocalNitro0.525s (-46.4% 🟢)1.039s (-5.1% 🟢)0.513s581.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.693s (-78.7% 🟢)6.239s (-74.0% 🟢)1.546s101.00x
▲ VercelNext.js (Turbopack)5.172s (-64.3% 🟢)6.923s (-57.0% 🟢)1.751s91.10x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.075s (-44.2% 🟢)1.964s (-6.5% 🟢)0.889s461.00x
💻 LocalExpress1.093s (-63.7% 🟢)1.702s (-52.5% 🟢)0.609s531.02x
🐘 PostgresExpress1.138s (-42.4% 🟢)2.030s (-10.1% 🟢)0.892s451.06x
💻 LocalNitro1.159s (-61.8% 🟢)2.006s (-46.6% 🟢)0.847s451.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro12.782s (-67.6% 🟢)14.361s (-65.2% 🟢)1.580s71.00x
▲ VercelNext.js (Turbopack)12.891s (-74.1% 🟢)14.919s (-71.2% 🟢)2.027s71.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.211s (-46.1% 🟢)2.865s (-37.8% 🟢)0.654s421.00x
🐘 PostgresExpress2.219s (-44.4% 🟢)3.085s (-29.4% 🟢)0.866s391.00x
💻 LocalExpress2.310s (-74.9% 🟢)3.007s (-70.0% 🟢)0.697s401.04x
💻 LocalNitro2.659s (-71.4% 🟢)3.033s (-69.7% 🟢)0.373s401.20x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro41.221s (-57.5% 🟢)43.002s (-56.3% 🟢)1.781s41.00x
▲ VercelNext.js (Turbopack)41.812s (-61.0% 🟢)43.995s (-59.6% 🟢)2.183s31.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.177s (-37.5% 🟢)1.006s (~)0.829s601.00x
🐘 PostgresExpress0.178s (-37.1% 🟢)1.006s (~)0.829s601.00x
💻 LocalExpress0.376s (-32.9% 🟢)1.003s (~)0.627s602.12x
💻 LocalNitro0.430s (-29.0% 🟢)1.004s (-1.7%)0.574s602.43x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.619s (+57.7% 🔺)4.330s (+29.2% 🔺)1.711s141.00x
▲ VercelNext.js (Turbopack)2.972s (+46.9% 🔺)5.256s (+38.5% 🔺)2.284s121.13x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.307s (-38.1% 🟢)1.007s (~)0.699s901.00x
🐘 PostgresExpress0.311s (-39.0% 🟢)1.014s (+0.7%)0.702s891.01x
💻 LocalExpress1.849s (-26.4% 🟢)2.252s (-25.2% 🟢)0.402s416.02x
💻 LocalNitro2.152s (-15.2% 🟢)2.797s (-7.1% 🟢)0.645s337.00x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.983s (+125.8% 🔺)9.874s (+90.1% 🔺)1.892s101.00x
▲ VercelNitro9.295s (+188.1% 🔺)10.915s (+126.4% 🔺)1.620s91.16x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.621s (-24.1% 🟢)1.006s (-1.1%)0.385s1201.00x
🐘 PostgresNitro0.639s (-19.2% 🟢)1.015s (+0.7%)0.376s1191.03x
💻 LocalExpress8.003s (-28.5% 🟢)8.667s (-27.4% 🟢)0.664s1412.88x
💻 LocalNitro9.963s (-11.0% 🟢)10.363s (-11.2% 🟢)0.400s1216.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.990s (+158.9% 🔺)21.905s (+133.0% 🔺)1.915s61.00x
▲ VercelNext.js (Turbopack)23.747s (+129.9% 🔺)26.134s (+112.7% 🔺)2.387s51.19x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.104s (+454.5% 🔺)2.004s (+99.5% 🔺)0.008s (-32.2% 🟢)2.014s (+97.9% 🔺)0.910s101.00x
💻 LocalNitro1.131s (+429.1% 🔺)2.005s (+99.6% 🔺)0.010s (-18.4% 🟢)2.017s (+98.0% 🔺)0.887s101.02x
🐘 PostgresExpress1.137s (+454.5% 🔺)2.000s (+100.3% 🔺)0.002s (-6.3% 🟢)2.010s (+98.7% 🔺)0.873s101.03x
🐘 PostgresNitro1.145s (+458.7% 🔺)1.999s (+100.0% 🔺)0.001s (-20.0% 🟢)2.010s (+98.7% 🔺)0.864s101.04x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.241s (-41.5% 🟢)3.316s (-37.2% 🟢)2.054s (+176.8% 🔺)5.808s (-10.4% 🟢)3.567s101.00x
▲ VercelNext.js (Turbopack)2.318s (-66.2% 🟢)3.661s (-57.7% 🟢)2.081s (+229.3% 🔺)6.240s (-36.3% 🟢)3.922s101.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.510s (+80.1% 🔺)2.010s (+98.7% 🔺)0.009s (-6.4% 🟢)2.021s (+81.1% 🔺)0.511s301.00x
🐘 PostgresExpress1.565s (+148.5% 🔺)2.005s (+99.2% 🔺)0.004s (+1.8%)2.026s (+98.1% 🔺)0.461s301.04x
🐘 PostgresNitro1.571s (+151.7% 🔺)2.037s (+102.4% 🔺)0.004s (-4.9%)2.058s (+101.3% 🔺)0.487s301.04x
💻 LocalExpress1.612s (+112.9% 🔺)2.010s (+95.3% 🔺)0.008s (-15.8% 🟢)2.198s (+111.4% 🔺)0.586s281.07x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.811s (-65.7% 🟢)7.125s (-60.9% 🟢)0.250s (+18.3% 🔺)7.983s (-57.8% 🟢)2.171s81.00x
▲ VercelNitro5.976s (-79.7% 🟢)7.199s (-76.6% 🟢)0.202s (+80.7% 🔺)7.811s (-75.4% 🟢)1.835s81.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.669s (-30.9% 🟢)1.033s (-17.2% 🟢)0.000s (-15.8% 🟢)1.058s (-15.9% 🟢)0.389s571.00x
🐘 PostgresExpress0.686s (-28.6% 🟢)1.051s (-17.8% 🟢)0.000s (+61.4% 🔺)1.060s (-18.9% 🟢)0.374s571.03x
💻 LocalExpress1.149s (-6.2% 🟢)1.981s (-2.0%)0.000s (-51.6% 🟢)1.983s (-2.0%)0.833s311.72x
💻 LocalNitro1.338s (+9.4% 🔺)2.016s (~)0.000s (+33.3% 🔺)2.018s (~)0.680s302.00x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.037s (-60.4% 🟢)5.321s (-53.8% 🟢)0.001s (+Infinity% 🔺)5.851s (-51.4% 🟢)1.814s111.00x
▲ VercelNitro4.253s (+39.4% 🔺)5.600s (+27.5% 🔺)0.000s (+30.0% 🔺)6.027s (+25.3% 🔺)1.774s101.05x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.325s (-26.1% 🟢)2.066s (-3.5%)0.000s (-3.4%)2.085s (-4.1%)0.761s291.00x
🐘 PostgresExpress1.389s (-21.6% 🟢)2.103s (-3.4%)0.000s (+Infinity% 🔺)2.114s (-3.8%)0.725s291.05x
💻 LocalExpress2.590s (-25.3% 🟢)2.974s (-26.3% 🟢)0.001s (-28.6% 🟢)2.979s (-26.2% 🟢)0.389s211.96x
💻 LocalNitro3.100s (-8.5% 🟢)3.967s (-1.6%)0.001s (+5.5% 🔺)3.970s (-1.6%)0.870s162.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.450s (+33.1% 🔺)6.924s (+28.8% 🔺)0.000s (-100.0% 🟢)7.361s (+27.1% 🔺)1.912s91.00x
▲ VercelNext.js (Turbopack)6.618s (+17.8% 🔺)7.864s (+12.6% 🔺)0.000s (-100.0% 🟢)8.355s (+10.8% 🔺)1.737s81.21x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress20/21
🐘 PostgresNitro14/21
▲ VercelNitro15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres12/21
Next.js (Turbopack)▲ Vercel21/21
Nitro🐘 Postgres14/21
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)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production119642191419
✅ 💻 Local Development158702191806
✅ 📦 Local Production158702191806
❌ 🐘 Local Postgres158612191806
✅ 🪟 Windows12900129
✅ 📋 Other7270176903
Total6812510527869

❌ Failed Tests

▲ Vercel Production (4 failed)

astro (1 failed):

  • AbortController abortAnyInStepWorkflow: AbortSignal.any inside a step composes deserialized signals

express (1 failed):

  • AbortController abortDeterministicBranchFromStepWorkflow: branches stay consistent when abort comes from a step

nuxt (1 failed):

  • runClassSerializationWorkflow - Run instances serialize across workflow/step boundaries | wrun_01KRMHFSCJH1N8FQ7XV2Z0EYWG | 🔍 observability

vite (1 failed):

  • fibonacciWorkflow - recursive workflow composition via start() | wrun_01KRMHG8R8XFT3RMXVQ70JM22A | 🔍 observability
🐘 Local Postgres (1 failed)

nextjs-webpack-stable-lazy-discovery-disabled (1 failed):

  • addTenWorkflow | wrun_01KRMH3MTK3F9C2E3XSFN0VC5C

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro102126
✅ example103026
❌ express102126
✅ fastify103026
✅ hono103026
✅ nextjs-turbopack12702
✅ nextjs-webpack12702
✅ nitro103026
❌ nuxt102126
✅ sveltekit12207
❌ vite102126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
❌ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
❌ nextjs-webpack-stable-lazy-discovery-disabled12810
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack12900
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable104025
✅ e2e-local-dev-tanstack-start-104025
✅ e2e-local-postgres-nest-stable104025
✅ e2e-local-postgres-tanstack-start-104025
✅ e2e-local-prod-nest-stable104025
✅ e2e-local-prod-tanstack-start-104025
✅ e2e-vercel-prod-tanstack-start103026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Add a comment please

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.

Done in c0a0ea35f / 107c5cbee: added a block comment explaining the 300s VQS visibility-timeout default, why we pass an explicit retry directive, and the idempotency expectation for close-together retries.

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 updates @workflow/world-vercel queue handling so failed VQS workflow handler invocations request an immediate retry directive instead of relying on the default visibility timeout.

Changes:

  • Adds a retry option to QueueClient.handleCallback.
  • Updates unit coverage for the callback retry option.
  • Adds a patch changeset for @workflow/world-vercel.

Reviewed changes

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

FileDescription
packages/world-vercel/src/queue.tsWires retry options into the VQS callback handler.
packages/world-vercel/src/queue.test.tsAdds/updates assertions for handleCallback retry behavior.
.changeset/retry-vqs-handler-errors-immediately.mdAdds release metadata for the world-vercel patch.

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

Comment thread.changeset/retry-vqs-handler-errors-immediately.md Outdated
Comment on lines +294 to 296
{
retry: () => ({ afterSeconds: 0 }),
}

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.

Updated in 107c5cbee: this no longer forces afterSeconds: 0. Handler failures now use delivery-count backoff starting at 1s and capped at 60s, so retries are quick without burning the delivery budget in a tight loop.

Comment on lines +368 to +373
expect(
options.retry(new Error('workflow server unavailable'), {
messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Updated in 107c5cbee: the test now asserts the bounded retry sequence instead of { afterSeconds: 0 }.

@karthikscale3karthikscale3 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.

Diagnosis is right — confirmed independently from staging Datadog logs that the 300s gap is the @vercel/queue default visibilityTimeoutSeconds. Fix wires the right API surface, but afterSeconds: 0 overcorrects in a few ways. Inline comments cover them. Worth pairing with a workflow-server-side change that maps getaddrinfo EBUSY / transient AWS SDK errors to 503 Retry-After: 1 so the SDK can retry without ever bouncing back to the queue.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

afterSeconds: 0 overrides the configured retryAfterSeconds: 5.

Per the @vercel/queue README: "the message is re-delivered after the configured retry delay (from retryAfterSeconds in vercel.json or the retry callback's afterSeconds)". So returning 0 here bypasses the trigger-config value the SDK already generates.

For the concrete bug that motivated this (DNS EBUSY on a Fluid Compute lambda whose libuv DNS thread pool was wedged for ~9s), a 0s retry will land back on the same wedged container before it recycles. The configured 5s would actually be the right floor.

Suggest: retry: () => ({ afterSeconds: 5 }) to match retryAfterSeconds in the generated trigger config, or read the value from a shared constant so they can't drift apart.

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.

5 seconds seems too long still. where is that floor coming from?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a good point about the interaction between afterSeconds in the retry callback and the retryAfterSeconds: 5 in the trigger config.

However, looking at the handler-side code in packages/core/src/runtime.ts (line 158) and packages/core/src/runtime/step-handler.ts (line 98), runs/steps are bounded at MAX_QUEUE_DELIVERIES = 48 attempts — the handler will gracefully fail the run before unbounded looping occurs. The comment in constants.ts does note the 48-attempt budget was sized assuming ~20 hours of elapsed time with the 5s backoff schedule, so with afterSeconds: 0 those 48 attempts would exhaust much faster.

That said, the main fix here (avoiding the 300s visibility lock) is clearly correct. The question is whether afterSeconds: 0 vs something like afterSeconds: 5 matters in practice — @pranaygp would know best whether VQS applies its own backoff on top of the afterSeconds value from the retry callback or if this truly replaces the entire schedule.

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.

Good catch. I agree that afterSeconds: 0 is more aggressive than needed. The retryAfterSeconds: 5 in the trigger config (also defined in packages/builders/src/constants.ts as WORKFLOW_QUEUE_TRIGGER.retryAfterSeconds) exists for a reason, and the retry callback's afterSeconds overrides it entirely.

The suggestion to use afterSeconds: 5 (or better, import from the shared WORKFLOW_QUEUE_TRIGGER constant) makes sense — it fixes the 300s visibility timeout problem while preserving the backoff floor that MAX_QUEUE_DELIVERIES = 48 was sized around.

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.

Adjusted in 107c5cbee after Pranay’s follow-up: instead of a 5s floor, the retry starts at 1s and then backs off by delivery count. That keeps the first retry quick while avoiding the original 0s hot-loop risk.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

No deliveryCount-aware backoff — poison messages will hot-loop.

This returns 0 for every delivery. For a permanently-broken message (malformed payload, schema mismatch, a workflow-server 500 that isn't transient), VQS will redeliver every ~0s until it hits its max-receive limit / DLQ. That's much hotter than the current 300s behavior.

Standard shape that handles both transient and stuck without classification:

retry: (_err,{ deliveryCount })=>({afterSeconds: Math.min(2**(deliveryCount-1),60),})

Gives 1s → 2s → 4s → 8s … capped at 60s. Fast enough for transient (full recovery within seconds), gentle enough not to thrash on a poison message.

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.

Implemented in 107c5cbee: handler errors now use delivery-count-aware backoff (1s -> 2s -> 4s -> 8s ...) capped at 60s.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Cross-system amplification risk during a workflow-server outage.

The 300s default is bad for happy-path latency but accidentally acts as a circuit-breaker when workflow-server is browning out — each in-flight message is held off-line for 5 min, naturally throttling redrive volume. With afterSeconds: 0, every dispatched VQS message will thrash workflow-server at full speed during exactly the situations we'd want to be gentle on.

The deliveryCount-aware backoff in my other comment addresses this too — once retries pile up, the per-message redrive rate self-throttles via exponential backoff.

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.

Addressed by the same backoff in 107c5cbee: repeated failures self-throttle up to a 60s cap instead of hammering workflow-server with 0s redrives.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Worth a comment here explaining why this retry handler exists.

Future readers will see retry: () => ({ afterSeconds: 0 }) and wonder why we explicitly opt into a non-default. A short block comment naming the 300s visibilityTimeoutSeconds default and the incident that motivated it (or the linked PR / issue) would make this durable. Without it, the next person to touch this is likely to remove it as redundant.

Also worth a one-line note that workflow/step handlers must be idempotent — the event-sourced model already required this for the 300s replay path, but tightening the redrive window makes back-to-back replays much more likely in practice.

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.

Done in c0a0ea35f / 107c5cbee: added the explanatory comment and called out the idempotency requirement.

messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Test asserts the directive shape but not the contract.

This invokes options.retry directly with a stubbed error, which verifies the function we pass in returns the right thing — but it doesn't exercise the path where @vercel/queue actually calls retry on a real handler throw. If handleCallback's contract for retry ever changes (different metadata shape, different return-type, called/not-called timing), this test still passes.

A small integration-style test using a real QueueClient with a throwing handler, then asserting redelivery happened with the expected delay, would catch contract drift. Not blocking — @vercel/queue owns the other side — but worth considering as a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test validates the contract that the production code passes to @vercel/queue — i.e., the retry callback shape and return value. Testing the actual handleCallback integration would require either not mocking @vercel/queue or a more complex integration test, which seems out of scope for a unit test. The mock-based approach here is consistent with how other handleCallback behavior is tested in this file (e.g., the existing mockHandleCallback pattern).

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.

Agree this is fine for now — it verifies the wiring correctly. An integration test with a real QueueClient would be more robust against contract drift but isn't blocking for this change.

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.

Leaving the real @vercel/queue contract test as a follow-up since that side is owned by the queue package. This PR now covers the world-vercel retry directive and the backoff values it returns.

@ctgowriectgowrie 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.

I don't think this will work. The problem is that we claim the message for 5 minutes. So even if we retry immediately, we will fail to claim the message.

Actually, this is a new message. We probably want some sort of backoff here, so we don't hammer the consumer. Lets discuss in slack

Comment threadpackages/world-vercel/src/queue.ts Outdated
Comment on lines +305 to +310
// Without an explicit retry directive, @vercel/queue leaves failed
// handler messages invisible until the default 300s visibility timeout
// expires. Start retrying quickly, then back off by delivery count so
// an outage or poison message cannot hot-loop. Workflow handlers are
// event-sourced and must remain idempotent because queue retries can
// happen close together.

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.

shouldn't VQS fallback to the configured 5s retryAfter configured in the config when nothing is explicitly set, instead of 300s visibility timeout?

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.

Checked against the @vercel/queue callback path in ~/github/vercel/vqs: the handler creates a consumer group with visibilityTimeoutSeconds defaulting to 300, and on handler throw it only calls changeVisibility when the retry callback returns { afterSeconds }. If the retry callback is absent/undefined, the error propagates and the message stays hidden until that visibility timeout expires. So this path does not appear to fall back to the trigger config’s retryAfterSeconds: 5; that matches the observed 300s retry delay and is why this PR keeps an explicit retry directive.

@pranaygp
pranaygp enabled auto-merge (squash) May 15, 2026 00:36
@pranaygp
pranaygp disabled auto-merge May 15, 2026 20:17
@pranaygp
pranaygp merged commit c43e721 into mainMay 15, 2026
113 of 120 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2007.

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.

5 participants

@pranaygp@TooTallNate@ctgowrie@karthikscale3
, '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 failed VQS handlers immediately - #1999

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry
May 15, 2026
Merged

Retry failed VQS handlers immediately#1999
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry

Conversation

@pranaygp

@pranaygppranaygp commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

When the Workflow queue handler throws, ask VQS to make the current message visible immediately instead of waiting for the default 300 second visibility lease to expire.

Root cause: the generated Workflow trigger config uses retryAfterSeconds: 5, but @workflow/world-vercel called QueueClient.handleCallback without a retry option. On handler failure, @vercel/queue propagated the error and the message stayed locked for the client default visibilityTimeoutSeconds: 300.

Changes

  • Pass retry: () => ({ afterSeconds: 0 }) to the VQS callback handler in @workflow/world-vercel.
  • Add a unit test asserting the retry directive is wired into handleCallback.
  • Add a patch changeset for @workflow/world-vercel.

Validation

  • git diff --check -- packages/world-vercel/src/queue.ts packages/world-vercel/src/queue.test.ts .changeset/retry-vqs-handler-errors-immediately.md
  • pnpm install with Node v24.15.0
  • pnpm --filter @workflow/utils build
  • pnpm --filter @workflow/errors build
  • pnpm --filter @workflow/world build
  • pnpm --filter @workflow/world-vercel build
  • pnpm --filter @workflow/world-vercel test -- queue.test.ts (69 tests passed)

CopilotAI review requested due to automatic review settings May 14, 2026 23:19
@pranaygp
pranaygp requested a review from a team as a code ownerMay 14, 2026 23:19
@changeset-bot

changeset-botBot commented May 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 45feb40

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

This PR includes changesets to release 19 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
tarballsPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@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

@vercel

vercelBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.025s (-44.0% 🟢)1.004s (~)0.979s101.00x
💻 LocalNitro0.030s (-29.7% 🟢)1.005s (~)0.975s101.22x
🐘 PostgresNitro0.054s (-43.2% 🟢)1.012s (-2.9%)0.958s102.18x
🐘 PostgresExpress0.063s (+9.3% 🔺)1.022s (+1.1%)0.959s102.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.231s (-43.7% 🟢)1.905s (-24.1% 🟢)1.675s101.00x
▲ VercelNext.js (Turbopack)0.304s (+20.9% 🔺)2.565s (+9.9% 🔺)2.261s101.32x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.056s (-6.2% 🟢)2.005s (~)0.949s101.00x
💻 LocalNitro1.065s (-5.8% 🟢)2.006s (~)0.941s101.01x
🐘 PostgresNitro1.082s (-5.1% 🟢)2.009s (~)0.927s101.02x
🐘 PostgresExpress1.086s (-5.3% 🟢)2.009s (~)0.923s101.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.602s (-21.3% 🟢)3.795s (-0.9%)2.193s101.00x
▲ VercelNitro1.681s (-56.8% 🟢)3.658s (-38.1% 🟢)1.976s101.05x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.327s (-5.4% 🟢)11.020s (~)0.693s31.00x
💻 LocalNitro10.404s (-4.9%)11.023s (~)0.618s31.01x
🐘 PostgresExpress10.417s (-5.0%)11.016s (~)0.599s31.01x
🐘 PostgresNitro10.427s (-4.1%)11.018s (~)0.591s31.01x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro13.713s (-42.2% 🟢)15.652s (-37.7% 🟢)1.939s21.00x
▲ VercelNext.js (Turbopack)13.851s (-20.0% 🟢)16.149s (-16.8% 🟢)2.299s21.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express13.252s (-11.5% 🟢)14.024s (-6.7% 🟢)0.772s51.00x
💻 LocalNitro13.425s (-10.9% 🟢)14.028s (-12.5% 🟢)0.603s51.01x
🐘 PostgresNitro13.454s (-7.8% 🟢)14.017s (-6.7% 🟢)0.563s51.02x
🐘 PostgresExpress13.530s (-7.2% 🟢)14.018s (-6.7% 🟢)0.488s51.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)21.402s (-59.3% 🟢)23.235s (-57.5% 🟢)1.833s31.00x
▲ VercelNitro21.447s (-66.7% 🟢)23.241s (-65.1% 🟢)1.794s31.00x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express11.579s (-30.3% 🟢)12.021s (-29.4% 🟢)0.443s81.00x
💻 LocalNitro11.845s (-29.4% 🟢)12.024s (-29.4% 🟢)0.179s81.02x
🐘 PostgresNitro12.024s (-13.9% 🟢)12.643s (-11.6% 🟢)0.619s81.04x
🐘 PostgresExpress12.057s (-13.9% 🟢)12.516s (-14.2% 🟢)0.459s81.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro35.366s (-91.6% 🟢)37.002s (-91.3% 🟢)1.636s31.00x
▲ VercelNext.js (Turbopack)36.089s (-90.8% 🟢)39.185s (-90.1% 🟢)3.096s31.02x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.135s (-23.7% 🟢)2.005s (~)0.870s151.00x
🐘 PostgresExpress1.136s (-9.8% 🟢)2.008s (~)0.871s151.00x
🐘 PostgresNitro1.145s (-10.2% 🟢)2.007s (~)0.862s151.01x
💻 LocalNitro1.173s (-28.1% 🟢)2.006s (-3.3%)0.833s151.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.552s (-9.4% 🟢)4.180s (-3.3%)1.627s81.00x
▲ VercelNext.js (Turbopack)2.792s (-17.8% 🟢)4.564s (-7.5% 🟢)1.772s71.09x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-48.7% 🟢)2.007s (-33.3% 🟢)0.797s151.00x
🐘 PostgresNitro1.272s (-45.9% 🟢)2.074s (-31.1% 🟢)0.802s151.05x
💻 LocalExpress1.553s (-47.4% 🟢)2.006s (-41.9% 🟢)0.453s151.28x
💻 LocalNitro1.678s (-46.6% 🟢)2.005s (-48.4% 🟢)0.327s151.39x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.458s (-37.2% 🟢)6.227s (-30.1% 🟢)1.769s61.00x
▲ VercelNitro5.689s (+40.4% 🔺)7.790s (+31.6% 🔺)2.101s41.28x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.328s (-61.9% 🟢)2.009s (-49.9% 🟢)0.680s151.00x
🐘 PostgresNitro1.395s (-59.9% 🟢)2.008s (-49.9% 🟢)0.613s151.05x
💻 LocalExpress3.522s (-57.8% 🟢)4.011s (-55.6% 🟢)0.488s82.65x
💻 LocalNitro4.447s (-46.7% 🟢)5.011s (-44.4% 🟢)0.564s63.35x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.432s (+54.1% 🔺)6.911s (+24.9% 🔺)1.479s51.00x
▲ VercelNext.js (Turbopack)5.852s (-34.4% 🟢)7.738s (-29.4% 🟢)1.886s41.08x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.152s (-8.4% 🟢)2.009s (~)0.857s151.00x
🐘 PostgresExpress1.158s (-7.9% 🟢)2.008s (~)0.850s151.01x
💻 LocalExpress1.238s (-34.6% 🟢)2.006s (-15.1% 🟢)0.768s151.07x
💻 LocalNitro1.376s (-26.2% 🟢)2.006s (-14.3% 🟢)0.629s151.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.483s (+1.0%)3.737s (-10.4% 🟢)1.254s91.00x
▲ VercelNext.js (Turbopack)2.575s (-12.2% 🟢)4.082s (-12.1% 🟢)1.507s81.04x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.209s (-48.3% 🟢)2.008s (-33.3% 🟢)0.799s151.00x
🐘 PostgresExpress1.219s (-47.9% 🟢)2.007s (-33.3% 🟢)0.788s151.01x
💻 LocalExpress1.644s (-47.5% 🟢)2.005s (-46.7% 🟢)0.361s151.36x
💻 LocalNitro2.046s (-33.2% 🟢)2.469s (-36.5% 🟢)0.423s131.69x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.040s (+25.0% 🔺)5.730s (+12.9% 🔺)1.690s61.00x
▲ VercelNext.js (Turbopack)4.073s (+29.6% 🔺)5.712s (+26.3% 🔺)1.638s61.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.322s (-62.0% 🟢)2.009s (-49.9% 🟢)0.687s151.00x
🐘 PostgresExpress1.324s (-62.2% 🟢)2.007s (-50.0% 🟢)0.684s151.00x
💻 LocalExpress4.114s (-53.3% 🟢)4.868s (-47.5% 🟢)0.754s73.11x
💻 LocalNitro4.825s (-47.2% 🟢)5.345s (-46.7% 🟢)0.520s63.65x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.443s (+6.9% 🔺)7.984s (+17.1% 🔺)2.541s41.00x
▲ VercelNext.js (Turbopack)6.066s (-10.2% 🟢)8.119s (-5.0%)2.054s41.11x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.443s (-46.0% 🟢)1.007s (~)0.564s601.00x
💻 LocalExpress0.448s (-54.5% 🟢)1.003s (-6.7% 🟢)0.556s601.01x
🐘 PostgresExpress0.467s (-44.3% 🟢)1.007s (-1.6%)0.540s601.05x
💻 LocalNitro0.525s (-46.4% 🟢)1.039s (-5.1% 🟢)0.513s581.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.693s (-78.7% 🟢)6.239s (-74.0% 🟢)1.546s101.00x
▲ VercelNext.js (Turbopack)5.172s (-64.3% 🟢)6.923s (-57.0% 🟢)1.751s91.10x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.075s (-44.2% 🟢)1.964s (-6.5% 🟢)0.889s461.00x
💻 LocalExpress1.093s (-63.7% 🟢)1.702s (-52.5% 🟢)0.609s531.02x
🐘 PostgresExpress1.138s (-42.4% 🟢)2.030s (-10.1% 🟢)0.892s451.06x
💻 LocalNitro1.159s (-61.8% 🟢)2.006s (-46.6% 🟢)0.847s451.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro12.782s (-67.6% 🟢)14.361s (-65.2% 🟢)1.580s71.00x
▲ VercelNext.js (Turbopack)12.891s (-74.1% 🟢)14.919s (-71.2% 🟢)2.027s71.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.211s (-46.1% 🟢)2.865s (-37.8% 🟢)0.654s421.00x
🐘 PostgresExpress2.219s (-44.4% 🟢)3.085s (-29.4% 🟢)0.866s391.00x
💻 LocalExpress2.310s (-74.9% 🟢)3.007s (-70.0% 🟢)0.697s401.04x
💻 LocalNitro2.659s (-71.4% 🟢)3.033s (-69.7% 🟢)0.373s401.20x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro41.221s (-57.5% 🟢)43.002s (-56.3% 🟢)1.781s41.00x
▲ VercelNext.js (Turbopack)41.812s (-61.0% 🟢)43.995s (-59.6% 🟢)2.183s31.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.177s (-37.5% 🟢)1.006s (~)0.829s601.00x
🐘 PostgresExpress0.178s (-37.1% 🟢)1.006s (~)0.829s601.00x
💻 LocalExpress0.376s (-32.9% 🟢)1.003s (~)0.627s602.12x
💻 LocalNitro0.430s (-29.0% 🟢)1.004s (-1.7%)0.574s602.43x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.619s (+57.7% 🔺)4.330s (+29.2% 🔺)1.711s141.00x
▲ VercelNext.js (Turbopack)2.972s (+46.9% 🔺)5.256s (+38.5% 🔺)2.284s121.13x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.307s (-38.1% 🟢)1.007s (~)0.699s901.00x
🐘 PostgresExpress0.311s (-39.0% 🟢)1.014s (+0.7%)0.702s891.01x
💻 LocalExpress1.849s (-26.4% 🟢)2.252s (-25.2% 🟢)0.402s416.02x
💻 LocalNitro2.152s (-15.2% 🟢)2.797s (-7.1% 🟢)0.645s337.00x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.983s (+125.8% 🔺)9.874s (+90.1% 🔺)1.892s101.00x
▲ VercelNitro9.295s (+188.1% 🔺)10.915s (+126.4% 🔺)1.620s91.16x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.621s (-24.1% 🟢)1.006s (-1.1%)0.385s1201.00x
🐘 PostgresNitro0.639s (-19.2% 🟢)1.015s (+0.7%)0.376s1191.03x
💻 LocalExpress8.003s (-28.5% 🟢)8.667s (-27.4% 🟢)0.664s1412.88x
💻 LocalNitro9.963s (-11.0% 🟢)10.363s (-11.2% 🟢)0.400s1216.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.990s (+158.9% 🔺)21.905s (+133.0% 🔺)1.915s61.00x
▲ VercelNext.js (Turbopack)23.747s (+129.9% 🔺)26.134s (+112.7% 🔺)2.387s51.19x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.104s (+454.5% 🔺)2.004s (+99.5% 🔺)0.008s (-32.2% 🟢)2.014s (+97.9% 🔺)0.910s101.00x
💻 LocalNitro1.131s (+429.1% 🔺)2.005s (+99.6% 🔺)0.010s (-18.4% 🟢)2.017s (+98.0% 🔺)0.887s101.02x
🐘 PostgresExpress1.137s (+454.5% 🔺)2.000s (+100.3% 🔺)0.002s (-6.3% 🟢)2.010s (+98.7% 🔺)0.873s101.03x
🐘 PostgresNitro1.145s (+458.7% 🔺)1.999s (+100.0% 🔺)0.001s (-20.0% 🟢)2.010s (+98.7% 🔺)0.864s101.04x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.241s (-41.5% 🟢)3.316s (-37.2% 🟢)2.054s (+176.8% 🔺)5.808s (-10.4% 🟢)3.567s101.00x
▲ VercelNext.js (Turbopack)2.318s (-66.2% 🟢)3.661s (-57.7% 🟢)2.081s (+229.3% 🔺)6.240s (-36.3% 🟢)3.922s101.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.510s (+80.1% 🔺)2.010s (+98.7% 🔺)0.009s (-6.4% 🟢)2.021s (+81.1% 🔺)0.511s301.00x
🐘 PostgresExpress1.565s (+148.5% 🔺)2.005s (+99.2% 🔺)0.004s (+1.8%)2.026s (+98.1% 🔺)0.461s301.04x
🐘 PostgresNitro1.571s (+151.7% 🔺)2.037s (+102.4% 🔺)0.004s (-4.9%)2.058s (+101.3% 🔺)0.487s301.04x
💻 LocalExpress1.612s (+112.9% 🔺)2.010s (+95.3% 🔺)0.008s (-15.8% 🟢)2.198s (+111.4% 🔺)0.586s281.07x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.811s (-65.7% 🟢)7.125s (-60.9% 🟢)0.250s (+18.3% 🔺)7.983s (-57.8% 🟢)2.171s81.00x
▲ VercelNitro5.976s (-79.7% 🟢)7.199s (-76.6% 🟢)0.202s (+80.7% 🔺)7.811s (-75.4% 🟢)1.835s81.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.669s (-30.9% 🟢)1.033s (-17.2% 🟢)0.000s (-15.8% 🟢)1.058s (-15.9% 🟢)0.389s571.00x
🐘 PostgresExpress0.686s (-28.6% 🟢)1.051s (-17.8% 🟢)0.000s (+61.4% 🔺)1.060s (-18.9% 🟢)0.374s571.03x
💻 LocalExpress1.149s (-6.2% 🟢)1.981s (-2.0%)0.000s (-51.6% 🟢)1.983s (-2.0%)0.833s311.72x
💻 LocalNitro1.338s (+9.4% 🔺)2.016s (~)0.000s (+33.3% 🔺)2.018s (~)0.680s302.00x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.037s (-60.4% 🟢)5.321s (-53.8% 🟢)0.001s (+Infinity% 🔺)5.851s (-51.4% 🟢)1.814s111.00x
▲ VercelNitro4.253s (+39.4% 🔺)5.600s (+27.5% 🔺)0.000s (+30.0% 🔺)6.027s (+25.3% 🔺)1.774s101.05x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.325s (-26.1% 🟢)2.066s (-3.5%)0.000s (-3.4%)2.085s (-4.1%)0.761s291.00x
🐘 PostgresExpress1.389s (-21.6% 🟢)2.103s (-3.4%)0.000s (+Infinity% 🔺)2.114s (-3.8%)0.725s291.05x
💻 LocalExpress2.590s (-25.3% 🟢)2.974s (-26.3% 🟢)0.001s (-28.6% 🟢)2.979s (-26.2% 🟢)0.389s211.96x
💻 LocalNitro3.100s (-8.5% 🟢)3.967s (-1.6%)0.001s (+5.5% 🔺)3.970s (-1.6%)0.870s162.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.450s (+33.1% 🔺)6.924s (+28.8% 🔺)0.000s (-100.0% 🟢)7.361s (+27.1% 🔺)1.912s91.00x
▲ VercelNext.js (Turbopack)6.618s (+17.8% 🔺)7.864s (+12.6% 🔺)0.000s (-100.0% 🟢)8.355s (+10.8% 🔺)1.737s81.21x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress20/21
🐘 PostgresNitro14/21
▲ VercelNitro15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres12/21
Next.js (Turbopack)▲ Vercel21/21
Nitro🐘 Postgres14/21
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)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production119642191419
✅ 💻 Local Development158702191806
✅ 📦 Local Production158702191806
❌ 🐘 Local Postgres158612191806
✅ 🪟 Windows12900129
✅ 📋 Other7270176903
Total6812510527869

❌ Failed Tests

▲ Vercel Production (4 failed)

astro (1 failed):

  • AbortController abortAnyInStepWorkflow: AbortSignal.any inside a step composes deserialized signals

express (1 failed):

  • AbortController abortDeterministicBranchFromStepWorkflow: branches stay consistent when abort comes from a step

nuxt (1 failed):

  • runClassSerializationWorkflow - Run instances serialize across workflow/step boundaries | wrun_01KRMHFSCJH1N8FQ7XV2Z0EYWG | 🔍 observability

vite (1 failed):

  • fibonacciWorkflow - recursive workflow composition via start() | wrun_01KRMHG8R8XFT3RMXVQ70JM22A | 🔍 observability
🐘 Local Postgres (1 failed)

nextjs-webpack-stable-lazy-discovery-disabled (1 failed):

  • addTenWorkflow | wrun_01KRMH3MTK3F9C2E3XSFN0VC5C

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro102126
✅ example103026
❌ express102126
✅ fastify103026
✅ hono103026
✅ nextjs-turbopack12702
✅ nextjs-webpack12702
✅ nitro103026
❌ nuxt102126
✅ sveltekit12207
❌ vite102126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
❌ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
❌ nextjs-webpack-stable-lazy-discovery-disabled12810
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack12900
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable104025
✅ e2e-local-dev-tanstack-start-104025
✅ e2e-local-postgres-nest-stable104025
✅ e2e-local-postgres-tanstack-start-104025
✅ e2e-local-prod-nest-stable104025
✅ e2e-local-prod-tanstack-start-104025
✅ e2e-vercel-prod-tanstack-start103026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Add a comment please

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.

Done in c0a0ea35f / 107c5cbee: added a block comment explaining the 300s VQS visibility-timeout default, why we pass an explicit retry directive, and the idempotency expectation for close-together retries.

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 updates @workflow/world-vercel queue handling so failed VQS workflow handler invocations request an immediate retry directive instead of relying on the default visibility timeout.

Changes:

  • Adds a retry option to QueueClient.handleCallback.
  • Updates unit coverage for the callback retry option.
  • Adds a patch changeset for @workflow/world-vercel.

Reviewed changes

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

FileDescription
packages/world-vercel/src/queue.tsWires retry options into the VQS callback handler.
packages/world-vercel/src/queue.test.tsAdds/updates assertions for handleCallback retry behavior.
.changeset/retry-vqs-handler-errors-immediately.mdAdds release metadata for the world-vercel patch.

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

Comment thread.changeset/retry-vqs-handler-errors-immediately.md Outdated
Comment on lines +294 to 296
{
retry: () => ({ afterSeconds: 0 }),
}

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.

Updated in 107c5cbee: this no longer forces afterSeconds: 0. Handler failures now use delivery-count backoff starting at 1s and capped at 60s, so retries are quick without burning the delivery budget in a tight loop.

Comment on lines +368 to +373
expect(
options.retry(new Error('workflow server unavailable'), {
messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Updated in 107c5cbee: the test now asserts the bounded retry sequence instead of { afterSeconds: 0 }.

@karthikscale3karthikscale3 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.

Diagnosis is right — confirmed independently from staging Datadog logs that the 300s gap is the @vercel/queue default visibilityTimeoutSeconds. Fix wires the right API surface, but afterSeconds: 0 overcorrects in a few ways. Inline comments cover them. Worth pairing with a workflow-server-side change that maps getaddrinfo EBUSY / transient AWS SDK errors to 503 Retry-After: 1 so the SDK can retry without ever bouncing back to the queue.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

afterSeconds: 0 overrides the configured retryAfterSeconds: 5.

Per the @vercel/queue README: "the message is re-delivered after the configured retry delay (from retryAfterSeconds in vercel.json or the retry callback's afterSeconds)". So returning 0 here bypasses the trigger-config value the SDK already generates.

For the concrete bug that motivated this (DNS EBUSY on a Fluid Compute lambda whose libuv DNS thread pool was wedged for ~9s), a 0s retry will land back on the same wedged container before it recycles. The configured 5s would actually be the right floor.

Suggest: retry: () => ({ afterSeconds: 5 }) to match retryAfterSeconds in the generated trigger config, or read the value from a shared constant so they can't drift apart.

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.

5 seconds seems too long still. where is that floor coming from?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a good point about the interaction between afterSeconds in the retry callback and the retryAfterSeconds: 5 in the trigger config.

However, looking at the handler-side code in packages/core/src/runtime.ts (line 158) and packages/core/src/runtime/step-handler.ts (line 98), runs/steps are bounded at MAX_QUEUE_DELIVERIES = 48 attempts — the handler will gracefully fail the run before unbounded looping occurs. The comment in constants.ts does note the 48-attempt budget was sized assuming ~20 hours of elapsed time with the 5s backoff schedule, so with afterSeconds: 0 those 48 attempts would exhaust much faster.

That said, the main fix here (avoiding the 300s visibility lock) is clearly correct. The question is whether afterSeconds: 0 vs something like afterSeconds: 5 matters in practice — @pranaygp would know best whether VQS applies its own backoff on top of the afterSeconds value from the retry callback or if this truly replaces the entire schedule.

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.

Good catch. I agree that afterSeconds: 0 is more aggressive than needed. The retryAfterSeconds: 5 in the trigger config (also defined in packages/builders/src/constants.ts as WORKFLOW_QUEUE_TRIGGER.retryAfterSeconds) exists for a reason, and the retry callback's afterSeconds overrides it entirely.

The suggestion to use afterSeconds: 5 (or better, import from the shared WORKFLOW_QUEUE_TRIGGER constant) makes sense — it fixes the 300s visibility timeout problem while preserving the backoff floor that MAX_QUEUE_DELIVERIES = 48 was sized around.

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.

Adjusted in 107c5cbee after Pranay’s follow-up: instead of a 5s floor, the retry starts at 1s and then backs off by delivery count. That keeps the first retry quick while avoiding the original 0s hot-loop risk.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

No deliveryCount-aware backoff — poison messages will hot-loop.

This returns 0 for every delivery. For a permanently-broken message (malformed payload, schema mismatch, a workflow-server 500 that isn't transient), VQS will redeliver every ~0s until it hits its max-receive limit / DLQ. That's much hotter than the current 300s behavior.

Standard shape that handles both transient and stuck without classification:

retry: (_err,{ deliveryCount })=>({afterSeconds: Math.min(2**(deliveryCount-1),60),})

Gives 1s → 2s → 4s → 8s … capped at 60s. Fast enough for transient (full recovery within seconds), gentle enough not to thrash on a poison message.

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.

Implemented in 107c5cbee: handler errors now use delivery-count-aware backoff (1s -> 2s -> 4s -> 8s ...) capped at 60s.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Cross-system amplification risk during a workflow-server outage.

The 300s default is bad for happy-path latency but accidentally acts as a circuit-breaker when workflow-server is browning out — each in-flight message is held off-line for 5 min, naturally throttling redrive volume. With afterSeconds: 0, every dispatched VQS message will thrash workflow-server at full speed during exactly the situations we'd want to be gentle on.

The deliveryCount-aware backoff in my other comment addresses this too — once retries pile up, the per-message redrive rate self-throttles via exponential backoff.

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.

Addressed by the same backoff in 107c5cbee: repeated failures self-throttle up to a 60s cap instead of hammering workflow-server with 0s redrives.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Worth a comment here explaining why this retry handler exists.

Future readers will see retry: () => ({ afterSeconds: 0 }) and wonder why we explicitly opt into a non-default. A short block comment naming the 300s visibilityTimeoutSeconds default and the incident that motivated it (or the linked PR / issue) would make this durable. Without it, the next person to touch this is likely to remove it as redundant.

Also worth a one-line note that workflow/step handlers must be idempotent — the event-sourced model already required this for the 300s replay path, but tightening the redrive window makes back-to-back replays much more likely in practice.

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.

Done in c0a0ea35f / 107c5cbee: added the explanatory comment and called out the idempotency requirement.

messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Test asserts the directive shape but not the contract.

This invokes options.retry directly with a stubbed error, which verifies the function we pass in returns the right thing — but it doesn't exercise the path where @vercel/queue actually calls retry on a real handler throw. If handleCallback's contract for retry ever changes (different metadata shape, different return-type, called/not-called timing), this test still passes.

A small integration-style test using a real QueueClient with a throwing handler, then asserting redelivery happened with the expected delay, would catch contract drift. Not blocking — @vercel/queue owns the other side — but worth considering as a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test validates the contract that the production code passes to @vercel/queue — i.e., the retry callback shape and return value. Testing the actual handleCallback integration would require either not mocking @vercel/queue or a more complex integration test, which seems out of scope for a unit test. The mock-based approach here is consistent with how other handleCallback behavior is tested in this file (e.g., the existing mockHandleCallback pattern).

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.

Agree this is fine for now — it verifies the wiring correctly. An integration test with a real QueueClient would be more robust against contract drift but isn't blocking for this change.

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.

Leaving the real @vercel/queue contract test as a follow-up since that side is owned by the queue package. This PR now covers the world-vercel retry directive and the backoff values it returns.

@ctgowriectgowrie 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.

I don't think this will work. The problem is that we claim the message for 5 minutes. So even if we retry immediately, we will fail to claim the message.

Actually, this is a new message. We probably want some sort of backoff here, so we don't hammer the consumer. Lets discuss in slack

Comment threadpackages/world-vercel/src/queue.ts Outdated
Comment on lines +305 to +310
// Without an explicit retry directive, @vercel/queue leaves failed
// handler messages invisible until the default 300s visibility timeout
// expires. Start retrying quickly, then back off by delivery count so
// an outage or poison message cannot hot-loop. Workflow handlers are
// event-sourced and must remain idempotent because queue retries can
// happen close together.

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.

shouldn't VQS fallback to the configured 5s retryAfter configured in the config when nothing is explicitly set, instead of 300s visibility timeout?

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.

Checked against the @vercel/queue callback path in ~/github/vercel/vqs: the handler creates a consumer group with visibilityTimeoutSeconds defaulting to 300, and on handler throw it only calls changeVisibility when the retry callback returns { afterSeconds }. If the retry callback is absent/undefined, the error propagates and the message stays hidden until that visibility timeout expires. So this path does not appear to fall back to the trigger config’s retryAfterSeconds: 5; that matches the observed 300s retry delay and is why this PR keeps an explicit retry directive.

@pranaygp
pranaygp enabled auto-merge (squash) May 15, 2026 00:36
@pranaygp
pranaygp disabled auto-merge May 15, 2026 20:17
@pranaygp
pranaygp merged commit c43e721 into mainMay 15, 2026
113 of 120 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2007.

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.

5 participants

@pranaygp@TooTallNate@ctgowrie@karthikscale3
, '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 failed VQS handlers immediately - #1999

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry
May 15, 2026
Merged

Retry failed VQS handlers immediately#1999
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry

Conversation

@pranaygp

@pranaygppranaygp commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

When the Workflow queue handler throws, ask VQS to make the current message visible immediately instead of waiting for the default 300 second visibility lease to expire.

Root cause: the generated Workflow trigger config uses retryAfterSeconds: 5, but @workflow/world-vercel called QueueClient.handleCallback without a retry option. On handler failure, @vercel/queue propagated the error and the message stayed locked for the client default visibilityTimeoutSeconds: 300.

Changes

  • Pass retry: () => ({ afterSeconds: 0 }) to the VQS callback handler in @workflow/world-vercel.
  • Add a unit test asserting the retry directive is wired into handleCallback.
  • Add a patch changeset for @workflow/world-vercel.

Validation

  • git diff --check -- packages/world-vercel/src/queue.ts packages/world-vercel/src/queue.test.ts .changeset/retry-vqs-handler-errors-immediately.md
  • pnpm install with Node v24.15.0
  • pnpm --filter @workflow/utils build
  • pnpm --filter @workflow/errors build
  • pnpm --filter @workflow/world build
  • pnpm --filter @workflow/world-vercel build
  • pnpm --filter @workflow/world-vercel test -- queue.test.ts (69 tests passed)

CopilotAI review requested due to automatic review settings May 14, 2026 23:19
@pranaygp
pranaygp requested a review from a team as a code ownerMay 14, 2026 23:19
@changeset-bot

changeset-botBot commented May 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 45feb40

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

This PR includes changesets to release 19 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
tarballsPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@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

@vercel

vercelBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.025s (-44.0% 🟢)1.004s (~)0.979s101.00x
💻 LocalNitro0.030s (-29.7% 🟢)1.005s (~)0.975s101.22x
🐘 PostgresNitro0.054s (-43.2% 🟢)1.012s (-2.9%)0.958s102.18x
🐘 PostgresExpress0.063s (+9.3% 🔺)1.022s (+1.1%)0.959s102.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.231s (-43.7% 🟢)1.905s (-24.1% 🟢)1.675s101.00x
▲ VercelNext.js (Turbopack)0.304s (+20.9% 🔺)2.565s (+9.9% 🔺)2.261s101.32x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.056s (-6.2% 🟢)2.005s (~)0.949s101.00x
💻 LocalNitro1.065s (-5.8% 🟢)2.006s (~)0.941s101.01x
🐘 PostgresNitro1.082s (-5.1% 🟢)2.009s (~)0.927s101.02x
🐘 PostgresExpress1.086s (-5.3% 🟢)2.009s (~)0.923s101.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.602s (-21.3% 🟢)3.795s (-0.9%)2.193s101.00x
▲ VercelNitro1.681s (-56.8% 🟢)3.658s (-38.1% 🟢)1.976s101.05x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.327s (-5.4% 🟢)11.020s (~)0.693s31.00x
💻 LocalNitro10.404s (-4.9%)11.023s (~)0.618s31.01x
🐘 PostgresExpress10.417s (-5.0%)11.016s (~)0.599s31.01x
🐘 PostgresNitro10.427s (-4.1%)11.018s (~)0.591s31.01x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro13.713s (-42.2% 🟢)15.652s (-37.7% 🟢)1.939s21.00x
▲ VercelNext.js (Turbopack)13.851s (-20.0% 🟢)16.149s (-16.8% 🟢)2.299s21.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express13.252s (-11.5% 🟢)14.024s (-6.7% 🟢)0.772s51.00x
💻 LocalNitro13.425s (-10.9% 🟢)14.028s (-12.5% 🟢)0.603s51.01x
🐘 PostgresNitro13.454s (-7.8% 🟢)14.017s (-6.7% 🟢)0.563s51.02x
🐘 PostgresExpress13.530s (-7.2% 🟢)14.018s (-6.7% 🟢)0.488s51.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)21.402s (-59.3% 🟢)23.235s (-57.5% 🟢)1.833s31.00x
▲ VercelNitro21.447s (-66.7% 🟢)23.241s (-65.1% 🟢)1.794s31.00x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express11.579s (-30.3% 🟢)12.021s (-29.4% 🟢)0.443s81.00x
💻 LocalNitro11.845s (-29.4% 🟢)12.024s (-29.4% 🟢)0.179s81.02x
🐘 PostgresNitro12.024s (-13.9% 🟢)12.643s (-11.6% 🟢)0.619s81.04x
🐘 PostgresExpress12.057s (-13.9% 🟢)12.516s (-14.2% 🟢)0.459s81.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro35.366s (-91.6% 🟢)37.002s (-91.3% 🟢)1.636s31.00x
▲ VercelNext.js (Turbopack)36.089s (-90.8% 🟢)39.185s (-90.1% 🟢)3.096s31.02x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.135s (-23.7% 🟢)2.005s (~)0.870s151.00x
🐘 PostgresExpress1.136s (-9.8% 🟢)2.008s (~)0.871s151.00x
🐘 PostgresNitro1.145s (-10.2% 🟢)2.007s (~)0.862s151.01x
💻 LocalNitro1.173s (-28.1% 🟢)2.006s (-3.3%)0.833s151.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.552s (-9.4% 🟢)4.180s (-3.3%)1.627s81.00x
▲ VercelNext.js (Turbopack)2.792s (-17.8% 🟢)4.564s (-7.5% 🟢)1.772s71.09x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-48.7% 🟢)2.007s (-33.3% 🟢)0.797s151.00x
🐘 PostgresNitro1.272s (-45.9% 🟢)2.074s (-31.1% 🟢)0.802s151.05x
💻 LocalExpress1.553s (-47.4% 🟢)2.006s (-41.9% 🟢)0.453s151.28x
💻 LocalNitro1.678s (-46.6% 🟢)2.005s (-48.4% 🟢)0.327s151.39x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.458s (-37.2% 🟢)6.227s (-30.1% 🟢)1.769s61.00x
▲ VercelNitro5.689s (+40.4% 🔺)7.790s (+31.6% 🔺)2.101s41.28x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.328s (-61.9% 🟢)2.009s (-49.9% 🟢)0.680s151.00x
🐘 PostgresNitro1.395s (-59.9% 🟢)2.008s (-49.9% 🟢)0.613s151.05x
💻 LocalExpress3.522s (-57.8% 🟢)4.011s (-55.6% 🟢)0.488s82.65x
💻 LocalNitro4.447s (-46.7% 🟢)5.011s (-44.4% 🟢)0.564s63.35x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.432s (+54.1% 🔺)6.911s (+24.9% 🔺)1.479s51.00x
▲ VercelNext.js (Turbopack)5.852s (-34.4% 🟢)7.738s (-29.4% 🟢)1.886s41.08x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.152s (-8.4% 🟢)2.009s (~)0.857s151.00x
🐘 PostgresExpress1.158s (-7.9% 🟢)2.008s (~)0.850s151.01x
💻 LocalExpress1.238s (-34.6% 🟢)2.006s (-15.1% 🟢)0.768s151.07x
💻 LocalNitro1.376s (-26.2% 🟢)2.006s (-14.3% 🟢)0.629s151.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.483s (+1.0%)3.737s (-10.4% 🟢)1.254s91.00x
▲ VercelNext.js (Turbopack)2.575s (-12.2% 🟢)4.082s (-12.1% 🟢)1.507s81.04x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.209s (-48.3% 🟢)2.008s (-33.3% 🟢)0.799s151.00x
🐘 PostgresExpress1.219s (-47.9% 🟢)2.007s (-33.3% 🟢)0.788s151.01x
💻 LocalExpress1.644s (-47.5% 🟢)2.005s (-46.7% 🟢)0.361s151.36x
💻 LocalNitro2.046s (-33.2% 🟢)2.469s (-36.5% 🟢)0.423s131.69x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.040s (+25.0% 🔺)5.730s (+12.9% 🔺)1.690s61.00x
▲ VercelNext.js (Turbopack)4.073s (+29.6% 🔺)5.712s (+26.3% 🔺)1.638s61.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.322s (-62.0% 🟢)2.009s (-49.9% 🟢)0.687s151.00x
🐘 PostgresExpress1.324s (-62.2% 🟢)2.007s (-50.0% 🟢)0.684s151.00x
💻 LocalExpress4.114s (-53.3% 🟢)4.868s (-47.5% 🟢)0.754s73.11x
💻 LocalNitro4.825s (-47.2% 🟢)5.345s (-46.7% 🟢)0.520s63.65x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.443s (+6.9% 🔺)7.984s (+17.1% 🔺)2.541s41.00x
▲ VercelNext.js (Turbopack)6.066s (-10.2% 🟢)8.119s (-5.0%)2.054s41.11x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.443s (-46.0% 🟢)1.007s (~)0.564s601.00x
💻 LocalExpress0.448s (-54.5% 🟢)1.003s (-6.7% 🟢)0.556s601.01x
🐘 PostgresExpress0.467s (-44.3% 🟢)1.007s (-1.6%)0.540s601.05x
💻 LocalNitro0.525s (-46.4% 🟢)1.039s (-5.1% 🟢)0.513s581.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.693s (-78.7% 🟢)6.239s (-74.0% 🟢)1.546s101.00x
▲ VercelNext.js (Turbopack)5.172s (-64.3% 🟢)6.923s (-57.0% 🟢)1.751s91.10x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.075s (-44.2% 🟢)1.964s (-6.5% 🟢)0.889s461.00x
💻 LocalExpress1.093s (-63.7% 🟢)1.702s (-52.5% 🟢)0.609s531.02x
🐘 PostgresExpress1.138s (-42.4% 🟢)2.030s (-10.1% 🟢)0.892s451.06x
💻 LocalNitro1.159s (-61.8% 🟢)2.006s (-46.6% 🟢)0.847s451.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro12.782s (-67.6% 🟢)14.361s (-65.2% 🟢)1.580s71.00x
▲ VercelNext.js (Turbopack)12.891s (-74.1% 🟢)14.919s (-71.2% 🟢)2.027s71.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.211s (-46.1% 🟢)2.865s (-37.8% 🟢)0.654s421.00x
🐘 PostgresExpress2.219s (-44.4% 🟢)3.085s (-29.4% 🟢)0.866s391.00x
💻 LocalExpress2.310s (-74.9% 🟢)3.007s (-70.0% 🟢)0.697s401.04x
💻 LocalNitro2.659s (-71.4% 🟢)3.033s (-69.7% 🟢)0.373s401.20x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro41.221s (-57.5% 🟢)43.002s (-56.3% 🟢)1.781s41.00x
▲ VercelNext.js (Turbopack)41.812s (-61.0% 🟢)43.995s (-59.6% 🟢)2.183s31.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.177s (-37.5% 🟢)1.006s (~)0.829s601.00x
🐘 PostgresExpress0.178s (-37.1% 🟢)1.006s (~)0.829s601.00x
💻 LocalExpress0.376s (-32.9% 🟢)1.003s (~)0.627s602.12x
💻 LocalNitro0.430s (-29.0% 🟢)1.004s (-1.7%)0.574s602.43x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.619s (+57.7% 🔺)4.330s (+29.2% 🔺)1.711s141.00x
▲ VercelNext.js (Turbopack)2.972s (+46.9% 🔺)5.256s (+38.5% 🔺)2.284s121.13x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.307s (-38.1% 🟢)1.007s (~)0.699s901.00x
🐘 PostgresExpress0.311s (-39.0% 🟢)1.014s (+0.7%)0.702s891.01x
💻 LocalExpress1.849s (-26.4% 🟢)2.252s (-25.2% 🟢)0.402s416.02x
💻 LocalNitro2.152s (-15.2% 🟢)2.797s (-7.1% 🟢)0.645s337.00x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.983s (+125.8% 🔺)9.874s (+90.1% 🔺)1.892s101.00x
▲ VercelNitro9.295s (+188.1% 🔺)10.915s (+126.4% 🔺)1.620s91.16x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.621s (-24.1% 🟢)1.006s (-1.1%)0.385s1201.00x
🐘 PostgresNitro0.639s (-19.2% 🟢)1.015s (+0.7%)0.376s1191.03x
💻 LocalExpress8.003s (-28.5% 🟢)8.667s (-27.4% 🟢)0.664s1412.88x
💻 LocalNitro9.963s (-11.0% 🟢)10.363s (-11.2% 🟢)0.400s1216.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.990s (+158.9% 🔺)21.905s (+133.0% 🔺)1.915s61.00x
▲ VercelNext.js (Turbopack)23.747s (+129.9% 🔺)26.134s (+112.7% 🔺)2.387s51.19x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.104s (+454.5% 🔺)2.004s (+99.5% 🔺)0.008s (-32.2% 🟢)2.014s (+97.9% 🔺)0.910s101.00x
💻 LocalNitro1.131s (+429.1% 🔺)2.005s (+99.6% 🔺)0.010s (-18.4% 🟢)2.017s (+98.0% 🔺)0.887s101.02x
🐘 PostgresExpress1.137s (+454.5% 🔺)2.000s (+100.3% 🔺)0.002s (-6.3% 🟢)2.010s (+98.7% 🔺)0.873s101.03x
🐘 PostgresNitro1.145s (+458.7% 🔺)1.999s (+100.0% 🔺)0.001s (-20.0% 🟢)2.010s (+98.7% 🔺)0.864s101.04x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.241s (-41.5% 🟢)3.316s (-37.2% 🟢)2.054s (+176.8% 🔺)5.808s (-10.4% 🟢)3.567s101.00x
▲ VercelNext.js (Turbopack)2.318s (-66.2% 🟢)3.661s (-57.7% 🟢)2.081s (+229.3% 🔺)6.240s (-36.3% 🟢)3.922s101.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.510s (+80.1% 🔺)2.010s (+98.7% 🔺)0.009s (-6.4% 🟢)2.021s (+81.1% 🔺)0.511s301.00x
🐘 PostgresExpress1.565s (+148.5% 🔺)2.005s (+99.2% 🔺)0.004s (+1.8%)2.026s (+98.1% 🔺)0.461s301.04x
🐘 PostgresNitro1.571s (+151.7% 🔺)2.037s (+102.4% 🔺)0.004s (-4.9%)2.058s (+101.3% 🔺)0.487s301.04x
💻 LocalExpress1.612s (+112.9% 🔺)2.010s (+95.3% 🔺)0.008s (-15.8% 🟢)2.198s (+111.4% 🔺)0.586s281.07x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.811s (-65.7% 🟢)7.125s (-60.9% 🟢)0.250s (+18.3% 🔺)7.983s (-57.8% 🟢)2.171s81.00x
▲ VercelNitro5.976s (-79.7% 🟢)7.199s (-76.6% 🟢)0.202s (+80.7% 🔺)7.811s (-75.4% 🟢)1.835s81.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.669s (-30.9% 🟢)1.033s (-17.2% 🟢)0.000s (-15.8% 🟢)1.058s (-15.9% 🟢)0.389s571.00x
🐘 PostgresExpress0.686s (-28.6% 🟢)1.051s (-17.8% 🟢)0.000s (+61.4% 🔺)1.060s (-18.9% 🟢)0.374s571.03x
💻 LocalExpress1.149s (-6.2% 🟢)1.981s (-2.0%)0.000s (-51.6% 🟢)1.983s (-2.0%)0.833s311.72x
💻 LocalNitro1.338s (+9.4% 🔺)2.016s (~)0.000s (+33.3% 🔺)2.018s (~)0.680s302.00x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.037s (-60.4% 🟢)5.321s (-53.8% 🟢)0.001s (+Infinity% 🔺)5.851s (-51.4% 🟢)1.814s111.00x
▲ VercelNitro4.253s (+39.4% 🔺)5.600s (+27.5% 🔺)0.000s (+30.0% 🔺)6.027s (+25.3% 🔺)1.774s101.05x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.325s (-26.1% 🟢)2.066s (-3.5%)0.000s (-3.4%)2.085s (-4.1%)0.761s291.00x
🐘 PostgresExpress1.389s (-21.6% 🟢)2.103s (-3.4%)0.000s (+Infinity% 🔺)2.114s (-3.8%)0.725s291.05x
💻 LocalExpress2.590s (-25.3% 🟢)2.974s (-26.3% 🟢)0.001s (-28.6% 🟢)2.979s (-26.2% 🟢)0.389s211.96x
💻 LocalNitro3.100s (-8.5% 🟢)3.967s (-1.6%)0.001s (+5.5% 🔺)3.970s (-1.6%)0.870s162.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.450s (+33.1% 🔺)6.924s (+28.8% 🔺)0.000s (-100.0% 🟢)7.361s (+27.1% 🔺)1.912s91.00x
▲ VercelNext.js (Turbopack)6.618s (+17.8% 🔺)7.864s (+12.6% 🔺)0.000s (-100.0% 🟢)8.355s (+10.8% 🔺)1.737s81.21x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress20/21
🐘 PostgresNitro14/21
▲ VercelNitro15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres12/21
Next.js (Turbopack)▲ Vercel21/21
Nitro🐘 Postgres14/21
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)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production119642191419
✅ 💻 Local Development158702191806
✅ 📦 Local Production158702191806
❌ 🐘 Local Postgres158612191806
✅ 🪟 Windows12900129
✅ 📋 Other7270176903
Total6812510527869

❌ Failed Tests

▲ Vercel Production (4 failed)

astro (1 failed):

  • AbortController abortAnyInStepWorkflow: AbortSignal.any inside a step composes deserialized signals

express (1 failed):

  • AbortController abortDeterministicBranchFromStepWorkflow: branches stay consistent when abort comes from a step

nuxt (1 failed):

  • runClassSerializationWorkflow - Run instances serialize across workflow/step boundaries | wrun_01KRMHFSCJH1N8FQ7XV2Z0EYWG | 🔍 observability

vite (1 failed):

  • fibonacciWorkflow - recursive workflow composition via start() | wrun_01KRMHG8R8XFT3RMXVQ70JM22A | 🔍 observability
🐘 Local Postgres (1 failed)

nextjs-webpack-stable-lazy-discovery-disabled (1 failed):

  • addTenWorkflow | wrun_01KRMH3MTK3F9C2E3XSFN0VC5C

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro102126
✅ example103026
❌ express102126
✅ fastify103026
✅ hono103026
✅ nextjs-turbopack12702
✅ nextjs-webpack12702
✅ nitro103026
❌ nuxt102126
✅ sveltekit12207
❌ vite102126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
❌ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
❌ nextjs-webpack-stable-lazy-discovery-disabled12810
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack12900
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable104025
✅ e2e-local-dev-tanstack-start-104025
✅ e2e-local-postgres-nest-stable104025
✅ e2e-local-postgres-tanstack-start-104025
✅ e2e-local-prod-nest-stable104025
✅ e2e-local-prod-tanstack-start-104025
✅ e2e-vercel-prod-tanstack-start103026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Add a comment please

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.

Done in c0a0ea35f / 107c5cbee: added a block comment explaining the 300s VQS visibility-timeout default, why we pass an explicit retry directive, and the idempotency expectation for close-together retries.

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 updates @workflow/world-vercel queue handling so failed VQS workflow handler invocations request an immediate retry directive instead of relying on the default visibility timeout.

Changes:

  • Adds a retry option to QueueClient.handleCallback.
  • Updates unit coverage for the callback retry option.
  • Adds a patch changeset for @workflow/world-vercel.

Reviewed changes

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

FileDescription
packages/world-vercel/src/queue.tsWires retry options into the VQS callback handler.
packages/world-vercel/src/queue.test.tsAdds/updates assertions for handleCallback retry behavior.
.changeset/retry-vqs-handler-errors-immediately.mdAdds release metadata for the world-vercel patch.

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

Comment thread.changeset/retry-vqs-handler-errors-immediately.md Outdated
Comment on lines +294 to 296
{
retry: () => ({ afterSeconds: 0 }),
}

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.

Updated in 107c5cbee: this no longer forces afterSeconds: 0. Handler failures now use delivery-count backoff starting at 1s and capped at 60s, so retries are quick without burning the delivery budget in a tight loop.

Comment on lines +368 to +373
expect(
options.retry(new Error('workflow server unavailable'), {
messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Updated in 107c5cbee: the test now asserts the bounded retry sequence instead of { afterSeconds: 0 }.

@karthikscale3karthikscale3 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.

Diagnosis is right — confirmed independently from staging Datadog logs that the 300s gap is the @vercel/queue default visibilityTimeoutSeconds. Fix wires the right API surface, but afterSeconds: 0 overcorrects in a few ways. Inline comments cover them. Worth pairing with a workflow-server-side change that maps getaddrinfo EBUSY / transient AWS SDK errors to 503 Retry-After: 1 so the SDK can retry without ever bouncing back to the queue.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

afterSeconds: 0 overrides the configured retryAfterSeconds: 5.

Per the @vercel/queue README: "the message is re-delivered after the configured retry delay (from retryAfterSeconds in vercel.json or the retry callback's afterSeconds)". So returning 0 here bypasses the trigger-config value the SDK already generates.

For the concrete bug that motivated this (DNS EBUSY on a Fluid Compute lambda whose libuv DNS thread pool was wedged for ~9s), a 0s retry will land back on the same wedged container before it recycles. The configured 5s would actually be the right floor.

Suggest: retry: () => ({ afterSeconds: 5 }) to match retryAfterSeconds in the generated trigger config, or read the value from a shared constant so they can't drift apart.

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.

5 seconds seems too long still. where is that floor coming from?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a good point about the interaction between afterSeconds in the retry callback and the retryAfterSeconds: 5 in the trigger config.

However, looking at the handler-side code in packages/core/src/runtime.ts (line 158) and packages/core/src/runtime/step-handler.ts (line 98), runs/steps are bounded at MAX_QUEUE_DELIVERIES = 48 attempts — the handler will gracefully fail the run before unbounded looping occurs. The comment in constants.ts does note the 48-attempt budget was sized assuming ~20 hours of elapsed time with the 5s backoff schedule, so with afterSeconds: 0 those 48 attempts would exhaust much faster.

That said, the main fix here (avoiding the 300s visibility lock) is clearly correct. The question is whether afterSeconds: 0 vs something like afterSeconds: 5 matters in practice — @pranaygp would know best whether VQS applies its own backoff on top of the afterSeconds value from the retry callback or if this truly replaces the entire schedule.

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.

Good catch. I agree that afterSeconds: 0 is more aggressive than needed. The retryAfterSeconds: 5 in the trigger config (also defined in packages/builders/src/constants.ts as WORKFLOW_QUEUE_TRIGGER.retryAfterSeconds) exists for a reason, and the retry callback's afterSeconds overrides it entirely.

The suggestion to use afterSeconds: 5 (or better, import from the shared WORKFLOW_QUEUE_TRIGGER constant) makes sense — it fixes the 300s visibility timeout problem while preserving the backoff floor that MAX_QUEUE_DELIVERIES = 48 was sized around.

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.

Adjusted in 107c5cbee after Pranay’s follow-up: instead of a 5s floor, the retry starts at 1s and then backs off by delivery count. That keeps the first retry quick while avoiding the original 0s hot-loop risk.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

No deliveryCount-aware backoff — poison messages will hot-loop.

This returns 0 for every delivery. For a permanently-broken message (malformed payload, schema mismatch, a workflow-server 500 that isn't transient), VQS will redeliver every ~0s until it hits its max-receive limit / DLQ. That's much hotter than the current 300s behavior.

Standard shape that handles both transient and stuck without classification:

retry: (_err,{ deliveryCount })=>({afterSeconds: Math.min(2**(deliveryCount-1),60),})

Gives 1s → 2s → 4s → 8s … capped at 60s. Fast enough for transient (full recovery within seconds), gentle enough not to thrash on a poison message.

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.

Implemented in 107c5cbee: handler errors now use delivery-count-aware backoff (1s -> 2s -> 4s -> 8s ...) capped at 60s.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Cross-system amplification risk during a workflow-server outage.

The 300s default is bad for happy-path latency but accidentally acts as a circuit-breaker when workflow-server is browning out — each in-flight message is held off-line for 5 min, naturally throttling redrive volume. With afterSeconds: 0, every dispatched VQS message will thrash workflow-server at full speed during exactly the situations we'd want to be gentle on.

The deliveryCount-aware backoff in my other comment addresses this too — once retries pile up, the per-message redrive rate self-throttles via exponential backoff.

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.

Addressed by the same backoff in 107c5cbee: repeated failures self-throttle up to a 60s cap instead of hammering workflow-server with 0s redrives.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Worth a comment here explaining why this retry handler exists.

Future readers will see retry: () => ({ afterSeconds: 0 }) and wonder why we explicitly opt into a non-default. A short block comment naming the 300s visibilityTimeoutSeconds default and the incident that motivated it (or the linked PR / issue) would make this durable. Without it, the next person to touch this is likely to remove it as redundant.

Also worth a one-line note that workflow/step handlers must be idempotent — the event-sourced model already required this for the 300s replay path, but tightening the redrive window makes back-to-back replays much more likely in practice.

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.

Done in c0a0ea35f / 107c5cbee: added the explanatory comment and called out the idempotency requirement.

messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Test asserts the directive shape but not the contract.

This invokes options.retry directly with a stubbed error, which verifies the function we pass in returns the right thing — but it doesn't exercise the path where @vercel/queue actually calls retry on a real handler throw. If handleCallback's contract for retry ever changes (different metadata shape, different return-type, called/not-called timing), this test still passes.

A small integration-style test using a real QueueClient with a throwing handler, then asserting redelivery happened with the expected delay, would catch contract drift. Not blocking — @vercel/queue owns the other side — but worth considering as a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test validates the contract that the production code passes to @vercel/queue — i.e., the retry callback shape and return value. Testing the actual handleCallback integration would require either not mocking @vercel/queue or a more complex integration test, which seems out of scope for a unit test. The mock-based approach here is consistent with how other handleCallback behavior is tested in this file (e.g., the existing mockHandleCallback pattern).

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.

Agree this is fine for now — it verifies the wiring correctly. An integration test with a real QueueClient would be more robust against contract drift but isn't blocking for this change.

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.

Leaving the real @vercel/queue contract test as a follow-up since that side is owned by the queue package. This PR now covers the world-vercel retry directive and the backoff values it returns.

@ctgowriectgowrie 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.

I don't think this will work. The problem is that we claim the message for 5 minutes. So even if we retry immediately, we will fail to claim the message.

Actually, this is a new message. We probably want some sort of backoff here, so we don't hammer the consumer. Lets discuss in slack

Comment threadpackages/world-vercel/src/queue.ts Outdated
Comment on lines +305 to +310
// Without an explicit retry directive, @vercel/queue leaves failed
// handler messages invisible until the default 300s visibility timeout
// expires. Start retrying quickly, then back off by delivery count so
// an outage or poison message cannot hot-loop. Workflow handlers are
// event-sourced and must remain idempotent because queue retries can
// happen close together.

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.

shouldn't VQS fallback to the configured 5s retryAfter configured in the config when nothing is explicitly set, instead of 300s visibility timeout?

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.

Checked against the @vercel/queue callback path in ~/github/vercel/vqs: the handler creates a consumer group with visibilityTimeoutSeconds defaulting to 300, and on handler throw it only calls changeVisibility when the retry callback returns { afterSeconds }. If the retry callback is absent/undefined, the error propagates and the message stays hidden until that visibility timeout expires. So this path does not appear to fall back to the trigger config’s retryAfterSeconds: 5; that matches the observed 300s retry delay and is why this PR keeps an explicit retry directive.

@pranaygp
pranaygp enabled auto-merge (squash) May 15, 2026 00:36
@pranaygp
pranaygp disabled auto-merge May 15, 2026 20:17
@pranaygp
pranaygp merged commit c43e721 into mainMay 15, 2026
113 of 120 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2007.

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.

5 participants

@pranaygp@TooTallNate@ctgowrie@karthikscale3
, '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 failed VQS handlers immediately - #1999

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry
May 15, 2026
Merged

Retry failed VQS handlers immediately#1999
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry

Conversation

@pranaygp

@pranaygppranaygp commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

When the Workflow queue handler throws, ask VQS to make the current message visible immediately instead of waiting for the default 300 second visibility lease to expire.

Root cause: the generated Workflow trigger config uses retryAfterSeconds: 5, but @workflow/world-vercel called QueueClient.handleCallback without a retry option. On handler failure, @vercel/queue propagated the error and the message stayed locked for the client default visibilityTimeoutSeconds: 300.

Changes

  • Pass retry: () => ({ afterSeconds: 0 }) to the VQS callback handler in @workflow/world-vercel.
  • Add a unit test asserting the retry directive is wired into handleCallback.
  • Add a patch changeset for @workflow/world-vercel.

Validation

  • git diff --check -- packages/world-vercel/src/queue.ts packages/world-vercel/src/queue.test.ts .changeset/retry-vqs-handler-errors-immediately.md
  • pnpm install with Node v24.15.0
  • pnpm --filter @workflow/utils build
  • pnpm --filter @workflow/errors build
  • pnpm --filter @workflow/world build
  • pnpm --filter @workflow/world-vercel build
  • pnpm --filter @workflow/world-vercel test -- queue.test.ts (69 tests passed)

CopilotAI review requested due to automatic review settings May 14, 2026 23:19
@pranaygp
pranaygp requested a review from a team as a code ownerMay 14, 2026 23:19
@changeset-bot

changeset-botBot commented May 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 45feb40

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

This PR includes changesets to release 19 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
tarballsPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/aiPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@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

@vercel

vercelBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express0.025s (-44.0% 🟢)1.004s (~)0.979s101.00x
💻 LocalNitro0.030s (-29.7% 🟢)1.005s (~)0.975s101.22x
🐘 PostgresNitro0.054s (-43.2% 🟢)1.012s (-2.9%)0.958s102.18x
🐘 PostgresExpress0.063s (+9.3% 🔺)1.022s (+1.1%)0.959s102.56x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.231s (-43.7% 🟢)1.905s (-24.1% 🟢)1.675s101.00x
▲ VercelNext.js (Turbopack)0.304s (+20.9% 🔺)2.565s (+9.9% 🔺)2.261s101.32x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.056s (-6.2% 🟢)2.005s (~)0.949s101.00x
💻 LocalNitro1.065s (-5.8% 🟢)2.006s (~)0.941s101.01x
🐘 PostgresNitro1.082s (-5.1% 🟢)2.009s (~)0.927s101.02x
🐘 PostgresExpress1.086s (-5.3% 🟢)2.009s (~)0.923s101.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.602s (-21.3% 🟢)3.795s (-0.9%)2.193s101.00x
▲ VercelNitro1.681s (-56.8% 🟢)3.658s (-38.1% 🟢)1.976s101.05x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express10.327s (-5.4% 🟢)11.020s (~)0.693s31.00x
💻 LocalNitro10.404s (-4.9%)11.023s (~)0.618s31.01x
🐘 PostgresExpress10.417s (-5.0%)11.016s (~)0.599s31.01x
🐘 PostgresNitro10.427s (-4.1%)11.018s (~)0.591s31.01x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro13.713s (-42.2% 🟢)15.652s (-37.7% 🟢)1.939s21.00x
▲ VercelNext.js (Turbopack)13.851s (-20.0% 🟢)16.149s (-16.8% 🟢)2.299s21.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express13.252s (-11.5% 🟢)14.024s (-6.7% 🟢)0.772s51.00x
💻 LocalNitro13.425s (-10.9% 🟢)14.028s (-12.5% 🟢)0.603s51.01x
🐘 PostgresNitro13.454s (-7.8% 🟢)14.017s (-6.7% 🟢)0.563s51.02x
🐘 PostgresExpress13.530s (-7.2% 🟢)14.018s (-6.7% 🟢)0.488s51.02x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)21.402s (-59.3% 🟢)23.235s (-57.5% 🟢)1.833s31.00x
▲ VercelNitro21.447s (-66.7% 🟢)23.241s (-65.1% 🟢)1.794s31.00x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express11.579s (-30.3% 🟢)12.021s (-29.4% 🟢)0.443s81.00x
💻 LocalNitro11.845s (-29.4% 🟢)12.024s (-29.4% 🟢)0.179s81.02x
🐘 PostgresNitro12.024s (-13.9% 🟢)12.643s (-11.6% 🟢)0.619s81.04x
🐘 PostgresExpress12.057s (-13.9% 🟢)12.516s (-14.2% 🟢)0.459s81.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro35.366s (-91.6% 🟢)37.002s (-91.3% 🟢)1.636s31.00x
▲ VercelNext.js (Turbopack)36.089s (-90.8% 🟢)39.185s (-90.1% 🟢)3.096s31.02x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.135s (-23.7% 🟢)2.005s (~)0.870s151.00x
🐘 PostgresExpress1.136s (-9.8% 🟢)2.008s (~)0.871s151.00x
🐘 PostgresNitro1.145s (-10.2% 🟢)2.007s (~)0.862s151.01x
💻 LocalNitro1.173s (-28.1% 🟢)2.006s (-3.3%)0.833s151.03x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.552s (-9.4% 🟢)4.180s (-3.3%)1.627s81.00x
▲ VercelNext.js (Turbopack)2.792s (-17.8% 🟢)4.564s (-7.5% 🟢)1.772s71.09x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.211s (-48.7% 🟢)2.007s (-33.3% 🟢)0.797s151.00x
🐘 PostgresNitro1.272s (-45.9% 🟢)2.074s (-31.1% 🟢)0.802s151.05x
💻 LocalExpress1.553s (-47.4% 🟢)2.006s (-41.9% 🟢)0.453s151.28x
💻 LocalNitro1.678s (-46.6% 🟢)2.005s (-48.4% 🟢)0.327s151.39x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.458s (-37.2% 🟢)6.227s (-30.1% 🟢)1.769s61.00x
▲ VercelNitro5.689s (+40.4% 🔺)7.790s (+31.6% 🔺)2.101s41.28x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.328s (-61.9% 🟢)2.009s (-49.9% 🟢)0.680s151.00x
🐘 PostgresNitro1.395s (-59.9% 🟢)2.008s (-49.9% 🟢)0.613s151.05x
💻 LocalExpress3.522s (-57.8% 🟢)4.011s (-55.6% 🟢)0.488s82.65x
💻 LocalNitro4.447s (-46.7% 🟢)5.011s (-44.4% 🟢)0.564s63.35x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.432s (+54.1% 🔺)6.911s (+24.9% 🔺)1.479s51.00x
▲ VercelNext.js (Turbopack)5.852s (-34.4% 🟢)7.738s (-29.4% 🟢)1.886s41.08x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.152s (-8.4% 🟢)2.009s (~)0.857s151.00x
🐘 PostgresExpress1.158s (-7.9% 🟢)2.008s (~)0.850s151.01x
💻 LocalExpress1.238s (-34.6% 🟢)2.006s (-15.1% 🟢)0.768s151.07x
💻 LocalNitro1.376s (-26.2% 🟢)2.006s (-14.3% 🟢)0.629s151.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.483s (+1.0%)3.737s (-10.4% 🟢)1.254s91.00x
▲ VercelNext.js (Turbopack)2.575s (-12.2% 🟢)4.082s (-12.1% 🟢)1.507s81.04x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.209s (-48.3% 🟢)2.008s (-33.3% 🟢)0.799s151.00x
🐘 PostgresExpress1.219s (-47.9% 🟢)2.007s (-33.3% 🟢)0.788s151.01x
💻 LocalExpress1.644s (-47.5% 🟢)2.005s (-46.7% 🟢)0.361s151.36x
💻 LocalNitro2.046s (-33.2% 🟢)2.469s (-36.5% 🟢)0.423s131.69x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.040s (+25.0% 🔺)5.730s (+12.9% 🔺)1.690s61.00x
▲ VercelNext.js (Turbopack)4.073s (+29.6% 🔺)5.712s (+26.3% 🔺)1.638s61.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.322s (-62.0% 🟢)2.009s (-49.9% 🟢)0.687s151.00x
🐘 PostgresExpress1.324s (-62.2% 🟢)2.007s (-50.0% 🟢)0.684s151.00x
💻 LocalExpress4.114s (-53.3% 🟢)4.868s (-47.5% 🟢)0.754s73.11x
💻 LocalNitro4.825s (-47.2% 🟢)5.345s (-46.7% 🟢)0.520s63.65x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.443s (+6.9% 🔺)7.984s (+17.1% 🔺)2.541s41.00x
▲ VercelNext.js (Turbopack)6.066s (-10.2% 🟢)8.119s (-5.0%)2.054s41.11x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.443s (-46.0% 🟢)1.007s (~)0.564s601.00x
💻 LocalExpress0.448s (-54.5% 🟢)1.003s (-6.7% 🟢)0.556s601.01x
🐘 PostgresExpress0.467s (-44.3% 🟢)1.007s (-1.6%)0.540s601.05x
💻 LocalNitro0.525s (-46.4% 🟢)1.039s (-5.1% 🟢)0.513s581.19x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.693s (-78.7% 🟢)6.239s (-74.0% 🟢)1.546s101.00x
▲ VercelNext.js (Turbopack)5.172s (-64.3% 🟢)6.923s (-57.0% 🟢)1.751s91.10x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.075s (-44.2% 🟢)1.964s (-6.5% 🟢)0.889s461.00x
💻 LocalExpress1.093s (-63.7% 🟢)1.702s (-52.5% 🟢)0.609s531.02x
🐘 PostgresExpress1.138s (-42.4% 🟢)2.030s (-10.1% 🟢)0.892s451.06x
💻 LocalNitro1.159s (-61.8% 🟢)2.006s (-46.6% 🟢)0.847s451.08x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro12.782s (-67.6% 🟢)14.361s (-65.2% 🟢)1.580s71.00x
▲ VercelNext.js (Turbopack)12.891s (-74.1% 🟢)14.919s (-71.2% 🟢)2.027s71.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.211s (-46.1% 🟢)2.865s (-37.8% 🟢)0.654s421.00x
🐘 PostgresExpress2.219s (-44.4% 🟢)3.085s (-29.4% 🟢)0.866s391.00x
💻 LocalExpress2.310s (-74.9% 🟢)3.007s (-70.0% 🟢)0.697s401.04x
💻 LocalNitro2.659s (-71.4% 🟢)3.033s (-69.7% 🟢)0.373s401.20x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro41.221s (-57.5% 🟢)43.002s (-56.3% 🟢)1.781s41.00x
▲ VercelNext.js (Turbopack)41.812s (-61.0% 🟢)43.995s (-59.6% 🟢)2.183s31.01x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.177s (-37.5% 🟢)1.006s (~)0.829s601.00x
🐘 PostgresExpress0.178s (-37.1% 🟢)1.006s (~)0.829s601.00x
💻 LocalExpress0.376s (-32.9% 🟢)1.003s (~)0.627s602.12x
💻 LocalNitro0.430s (-29.0% 🟢)1.004s (-1.7%)0.574s602.43x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.619s (+57.7% 🔺)4.330s (+29.2% 🔺)1.711s141.00x
▲ VercelNext.js (Turbopack)2.972s (+46.9% 🔺)5.256s (+38.5% 🔺)2.284s121.13x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.307s (-38.1% 🟢)1.007s (~)0.699s901.00x
🐘 PostgresExpress0.311s (-39.0% 🟢)1.014s (+0.7%)0.702s891.01x
💻 LocalExpress1.849s (-26.4% 🟢)2.252s (-25.2% 🟢)0.402s416.02x
💻 LocalNitro2.152s (-15.2% 🟢)2.797s (-7.1% 🟢)0.645s337.00x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.983s (+125.8% 🔺)9.874s (+90.1% 🔺)1.892s101.00x
▲ VercelNitro9.295s (+188.1% 🔺)10.915s (+126.4% 🔺)1.620s91.16x
▲ VercelExpress⚠️missing----

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express0.621s (-24.1% 🟢)1.006s (-1.1%)0.385s1201.00x
🐘 PostgresNitro0.639s (-19.2% 🟢)1.015s (+0.7%)0.376s1191.03x
💻 LocalExpress8.003s (-28.5% 🟢)8.667s (-27.4% 🟢)0.664s1412.88x
💻 LocalNitro9.963s (-11.0% 🟢)10.363s (-11.2% 🟢)0.400s1216.04x
💻 LocalNext.js (Turbopack)⚠️missing----
🐘 PostgresNext.js (Turbopack)⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro19.990s (+158.9% 🔺)21.905s (+133.0% 🔺)1.915s61.00x
▲ VercelNext.js (Turbopack)23.747s (+129.9% 🔺)26.134s (+112.7% 🔺)2.387s51.19x
▲ VercelExpress⚠️missing----

🔍 Observability: Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.104s (+454.5% 🔺)2.004s (+99.5% 🔺)0.008s (-32.2% 🟢)2.014s (+97.9% 🔺)0.910s101.00x
💻 LocalNitro1.131s (+429.1% 🔺)2.005s (+99.6% 🔺)0.010s (-18.4% 🟢)2.017s (+98.0% 🔺)0.887s101.02x
🐘 PostgresExpress1.137s (+454.5% 🔺)2.000s (+100.3% 🔺)0.002s (-6.3% 🟢)2.010s (+98.7% 🔺)0.873s101.03x
🐘 PostgresNitro1.145s (+458.7% 🔺)1.999s (+100.0% 🔺)0.001s (-20.0% 🟢)2.010s (+98.7% 🔺)0.864s101.04x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.241s (-41.5% 🟢)3.316s (-37.2% 🟢)2.054s (+176.8% 🔺)5.808s (-10.4% 🟢)3.567s101.00x
▲ VercelNext.js (Turbopack)2.318s (-66.2% 🟢)3.661s (-57.7% 🟢)2.081s (+229.3% 🔺)6.240s (-36.3% 🟢)3.922s101.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.510s (+80.1% 🔺)2.010s (+98.7% 🔺)0.009s (-6.4% 🟢)2.021s (+81.1% 🔺)0.511s301.00x
🐘 PostgresExpress1.565s (+148.5% 🔺)2.005s (+99.2% 🔺)0.004s (+1.8%)2.026s (+98.1% 🔺)0.461s301.04x
🐘 PostgresNitro1.571s (+151.7% 🔺)2.037s (+102.4% 🔺)0.004s (-4.9%)2.058s (+101.3% 🔺)0.487s301.04x
💻 LocalExpress1.612s (+112.9% 🔺)2.010s (+95.3% 🔺)0.008s (-15.8% 🟢)2.198s (+111.4% 🔺)0.586s281.07x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)5.811s (-65.7% 🟢)7.125s (-60.9% 🟢)0.250s (+18.3% 🔺)7.983s (-57.8% 🟢)2.171s81.00x
▲ VercelNitro5.976s (-79.7% 🟢)7.199s (-76.6% 🟢)0.202s (+80.7% 🔺)7.811s (-75.4% 🟢)1.835s81.03x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.669s (-30.9% 🟢)1.033s (-17.2% 🟢)0.000s (-15.8% 🟢)1.058s (-15.9% 🟢)0.389s571.00x
🐘 PostgresExpress0.686s (-28.6% 🟢)1.051s (-17.8% 🟢)0.000s (+61.4% 🔺)1.060s (-18.9% 🟢)0.374s571.03x
💻 LocalExpress1.149s (-6.2% 🟢)1.981s (-2.0%)0.000s (-51.6% 🟢)1.983s (-2.0%)0.833s311.72x
💻 LocalNitro1.338s (+9.4% 🔺)2.016s (~)0.000s (+33.3% 🔺)2.018s (~)0.680s302.00x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)4.037s (-60.4% 🟢)5.321s (-53.8% 🟢)0.001s (+Infinity% 🔺)5.851s (-51.4% 🟢)1.814s111.00x
▲ VercelNitro4.253s (+39.4% 🔺)5.600s (+27.5% 🔺)0.000s (+30.0% 🔺)6.027s (+25.3% 🔺)1.774s101.05x
▲ VercelExpress⚠️missing-----

🔍 Observability: Next.js (Turbopack) | Nitro

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.325s (-26.1% 🟢)2.066s (-3.5%)0.000s (-3.4%)2.085s (-4.1%)0.761s291.00x
🐘 PostgresExpress1.389s (-21.6% 🟢)2.103s (-3.4%)0.000s (+Infinity% 🔺)2.114s (-3.8%)0.725s291.05x
💻 LocalExpress2.590s (-25.3% 🟢)2.974s (-26.3% 🟢)0.001s (-28.6% 🟢)2.979s (-26.2% 🟢)0.389s211.96x
💻 LocalNitro3.100s (-8.5% 🟢)3.967s (-1.6%)0.001s (+5.5% 🔺)3.970s (-1.6%)0.870s162.34x
💻 LocalNext.js (Turbopack)⚠️missing-----
🐘 PostgresNext.js (Turbopack)⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro5.450s (+33.1% 🔺)6.924s (+28.8% 🔺)0.000s (-100.0% 🟢)7.361s (+27.1% 🔺)1.912s91.00x
▲ VercelNext.js (Turbopack)6.618s (+17.8% 🔺)7.864s (+12.6% 🔺)0.000s (-100.0% 🟢)8.355s (+10.8% 🔺)1.737s81.21x
▲ VercelExpress⚠️missing-----

🔍 Observability: Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress20/21
🐘 PostgresNitro14/21
▲ VercelNitro15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres12/21
Next.js (Turbopack)▲ Vercel21/21
Nitro🐘 Postgres14/21
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)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production119642191419
✅ 💻 Local Development158702191806
✅ 📦 Local Production158702191806
❌ 🐘 Local Postgres158612191806
✅ 🪟 Windows12900129
✅ 📋 Other7270176903
Total6812510527869

❌ Failed Tests

▲ Vercel Production (4 failed)

astro (1 failed):

  • AbortController abortAnyInStepWorkflow: AbortSignal.any inside a step composes deserialized signals

express (1 failed):

  • AbortController abortDeterministicBranchFromStepWorkflow: branches stay consistent when abort comes from a step

nuxt (1 failed):

  • runClassSerializationWorkflow - Run instances serialize across workflow/step boundaries | wrun_01KRMHFSCJH1N8FQ7XV2Z0EYWG | 🔍 observability

vite (1 failed):

  • fibonacciWorkflow - recursive workflow composition via start() | wrun_01KRMHG8R8XFT3RMXVQ70JM22A | 🔍 observability
🐘 Local Postgres (1 failed)

nextjs-webpack-stable-lazy-discovery-disabled (1 failed):

  • addTenWorkflow | wrun_01KRMH3MTK3F9C2E3XSFN0VC5C

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
❌ astro102126
✅ example103026
❌ express102126
✅ fastify103026
✅ hono103026
✅ nextjs-turbopack12702
✅ nextjs-webpack12702
✅ nitro103026
❌ nuxt102126
✅ sveltekit12207
❌ vite102126
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
✅ nextjs-webpack-stable-lazy-discovery-disabled12900
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
❌ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable104025
✅ express-stable104025
✅ fastify-stable104025
✅ hono-stable104025
✅ nextjs-turbopack-canary110019
✅ nextjs-turbopack-stable-lazy-discovery-disabled12900
✅ nextjs-turbopack-stable-lazy-discovery-enabled12900
✅ nextjs-webpack-canary110019
❌ nextjs-webpack-stable-lazy-discovery-disabled12810
✅ nextjs-webpack-stable-lazy-discovery-enabled12900
✅ nitro-stable104025
✅ nuxt-stable104025
✅ sveltekit-stable12306
✅ vite-stable104025
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack12900
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable104025
✅ e2e-local-dev-tanstack-start-104025
✅ e2e-local-postgres-nest-stable104025
✅ e2e-local-postgres-tanstack-start-104025
✅ e2e-local-prod-nest-stable104025
✅ e2e-local-prod-tanstack-start-104025
✅ e2e-vercel-prod-tanstack-start103026

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Add a comment please

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.

Done in c0a0ea35f / 107c5cbee: added a block comment explaining the 300s VQS visibility-timeout default, why we pass an explicit retry directive, and the idempotency expectation for close-together retries.

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 updates @workflow/world-vercel queue handling so failed VQS workflow handler invocations request an immediate retry directive instead of relying on the default visibility timeout.

Changes:

  • Adds a retry option to QueueClient.handleCallback.
  • Updates unit coverage for the callback retry option.
  • Adds a patch changeset for @workflow/world-vercel.

Reviewed changes

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

FileDescription
packages/world-vercel/src/queue.tsWires retry options into the VQS callback handler.
packages/world-vercel/src/queue.test.tsAdds/updates assertions for handleCallback retry behavior.
.changeset/retry-vqs-handler-errors-immediately.mdAdds release metadata for the world-vercel patch.

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

Comment thread.changeset/retry-vqs-handler-errors-immediately.md Outdated
Comment on lines +294 to 296
{
retry: () => ({ afterSeconds: 0 }),
}

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.

Updated in 107c5cbee: this no longer forces afterSeconds: 0. Handler failures now use delivery-count backoff starting at 1s and capped at 60s, so retries are quick without burning the delivery budget in a tight loop.

Comment on lines +368 to +373
expect(
options.retry(new Error('workflow server unavailable'), {
messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Updated in 107c5cbee: the test now asserts the bounded retry sequence instead of { afterSeconds: 0 }.

@karthikscale3karthikscale3 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.

Diagnosis is right — confirmed independently from staging Datadog logs that the 300s gap is the @vercel/queue default visibilityTimeoutSeconds. Fix wires the right API surface, but afterSeconds: 0 overcorrects in a few ways. Inline comments cover them. Worth pairing with a workflow-server-side change that maps getaddrinfo EBUSY / transient AWS SDK errors to 503 Retry-After: 1 so the SDK can retry without ever bouncing back to the queue.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

afterSeconds: 0 overrides the configured retryAfterSeconds: 5.

Per the @vercel/queue README: "the message is re-delivered after the configured retry delay (from retryAfterSeconds in vercel.json or the retry callback's afterSeconds)". So returning 0 here bypasses the trigger-config value the SDK already generates.

For the concrete bug that motivated this (DNS EBUSY on a Fluid Compute lambda whose libuv DNS thread pool was wedged for ~9s), a 0s retry will land back on the same wedged container before it recycles. The configured 5s would actually be the right floor.

Suggest: retry: () => ({ afterSeconds: 5 }) to match retryAfterSeconds in the generated trigger config, or read the value from a shared constant so they can't drift apart.

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.

5 seconds seems too long still. where is that floor coming from?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a good point about the interaction between afterSeconds in the retry callback and the retryAfterSeconds: 5 in the trigger config.

However, looking at the handler-side code in packages/core/src/runtime.ts (line 158) and packages/core/src/runtime/step-handler.ts (line 98), runs/steps are bounded at MAX_QUEUE_DELIVERIES = 48 attempts — the handler will gracefully fail the run before unbounded looping occurs. The comment in constants.ts does note the 48-attempt budget was sized assuming ~20 hours of elapsed time with the 5s backoff schedule, so with afterSeconds: 0 those 48 attempts would exhaust much faster.

That said, the main fix here (avoiding the 300s visibility lock) is clearly correct. The question is whether afterSeconds: 0 vs something like afterSeconds: 5 matters in practice — @pranaygp would know best whether VQS applies its own backoff on top of the afterSeconds value from the retry callback or if this truly replaces the entire schedule.

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.

Good catch. I agree that afterSeconds: 0 is more aggressive than needed. The retryAfterSeconds: 5 in the trigger config (also defined in packages/builders/src/constants.ts as WORKFLOW_QUEUE_TRIGGER.retryAfterSeconds) exists for a reason, and the retry callback's afterSeconds overrides it entirely.

The suggestion to use afterSeconds: 5 (or better, import from the shared WORKFLOW_QUEUE_TRIGGER constant) makes sense — it fixes the 300s visibility timeout problem while preserving the backoff floor that MAX_QUEUE_DELIVERIES = 48 was sized around.

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.

Adjusted in 107c5cbee after Pranay’s follow-up: instead of a 5s floor, the retry starts at 1s and then backs off by delivery count. That keeps the first retry quick while avoiding the original 0s hot-loop risk.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

No deliveryCount-aware backoff — poison messages will hot-loop.

This returns 0 for every delivery. For a permanently-broken message (malformed payload, schema mismatch, a workflow-server 500 that isn't transient), VQS will redeliver every ~0s until it hits its max-receive limit / DLQ. That's much hotter than the current 300s behavior.

Standard shape that handles both transient and stuck without classification:

retry: (_err,{ deliveryCount })=>({afterSeconds: Math.min(2**(deliveryCount-1),60),})

Gives 1s → 2s → 4s → 8s … capped at 60s. Fast enough for transient (full recovery within seconds), gentle enough not to thrash on a poison message.

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.

Implemented in 107c5cbee: handler errors now use delivery-count-aware backoff (1s -> 2s -> 4s -> 8s ...) capped at 60s.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Cross-system amplification risk during a workflow-server outage.

The 300s default is bad for happy-path latency but accidentally acts as a circuit-breaker when workflow-server is browning out — each in-flight message is held off-line for 5 min, naturally throttling redrive volume. With afterSeconds: 0, every dispatched VQS message will thrash workflow-server at full speed during exactly the situations we'd want to be gentle on.

The deliveryCount-aware backoff in my other comment addresses this too — once retries pile up, the per-message redrive rate self-throttles via exponential backoff.

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.

Addressed by the same backoff in 107c5cbee: repeated failures self-throttle up to a 60s cap instead of hammering workflow-server with 0s redrives.

Comment threadpackages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),

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.

Worth a comment here explaining why this retry handler exists.

Future readers will see retry: () => ({ afterSeconds: 0 }) and wonder why we explicitly opt into a non-default. A short block comment naming the 300s visibilityTimeoutSeconds default and the incident that motivated it (or the linked PR / issue) would make this durable. Without it, the next person to touch this is likely to remove it as redundant.

Also worth a one-line note that workflow/step handlers must be idempotent — the event-sourced model already required this for the 300s replay path, but tightening the redrive window makes back-to-back replays much more likely in practice.

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.

Done in c0a0ea35f / 107c5cbee: added the explanatory comment and called out the idempotency requirement.

messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });

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.

Test asserts the directive shape but not the contract.

This invokes options.retry directly with a stubbed error, which verifies the function we pass in returns the right thing — but it doesn't exercise the path where @vercel/queue actually calls retry on a real handler throw. If handleCallback's contract for retry ever changes (different metadata shape, different return-type, called/not-called timing), this test still passes.

A small integration-style test using a real QueueClient with a throwing handler, then asserting redelivery happened with the expected delay, would catch contract drift. Not blocking — @vercel/queue owns the other side — but worth considering as a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test validates the contract that the production code passes to @vercel/queue — i.e., the retry callback shape and return value. Testing the actual handleCallback integration would require either not mocking @vercel/queue or a more complex integration test, which seems out of scope for a unit test. The mock-based approach here is consistent with how other handleCallback behavior is tested in this file (e.g., the existing mockHandleCallback pattern).

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.

Agree this is fine for now — it verifies the wiring correctly. An integration test with a real QueueClient would be more robust against contract drift but isn't blocking for this change.

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.

Leaving the real @vercel/queue contract test as a follow-up since that side is owned by the queue package. This PR now covers the world-vercel retry directive and the backoff values it returns.

@ctgowriectgowrie 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.

I don't think this will work. The problem is that we claim the message for 5 minutes. So even if we retry immediately, we will fail to claim the message.

Actually, this is a new message. We probably want some sort of backoff here, so we don't hammer the consumer. Lets discuss in slack

Comment threadpackages/world-vercel/src/queue.ts Outdated
Comment on lines +305 to +310
// Without an explicit retry directive, @vercel/queue leaves failed
// handler messages invisible until the default 300s visibility timeout
// expires. Start retrying quickly, then back off by delivery count so
// an outage or poison message cannot hot-loop. Workflow handlers are
// event-sourced and must remain idempotent because queue retries can
// happen close together.

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.

shouldn't VQS fallback to the configured 5s retryAfter configured in the config when nothing is explicitly set, instead of 300s visibility timeout?

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.

Checked against the @vercel/queue callback path in ~/github/vercel/vqs: the handler creates a consumer group with visibilityTimeoutSeconds defaulting to 300, and on handler throw it only calls changeVisibility when the retry callback returns { afterSeconds }. If the retry callback is absent/undefined, the error propagates and the message stays hidden until that visibility timeout expires. So this path does not appear to fall back to the trigger config’s retryAfterSeconds: 5; that matches the observed 300s retry delay and is why this PR keeps an explicit retry directive.

@pranaygp
pranaygp enabled auto-merge (squash) May 15, 2026 00:36
@pranaygp
pranaygp disabled auto-merge May 15, 2026 20:17
@pranaygp
pranaygp merged commit c43e721 into mainMay 15, 2026
113 of 120 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2007.

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.

5 participants

@pranaygp@TooTallNate@ctgowrie@karthikscale3