Skip to content

Handle 409 errors gracefully for step_completed/failed/retrying#1120

Merged
VaguelySerious merged 3 commits into
mainfrom
pnoll/handle-step-409-gracefully
Feb 20, 2026
Merged

Handle 409 errors gracefully for step_completed/failed/retrying#1120
VaguelySerious merged 3 commits into
mainfrom
pnoll/handle-step-409-gracefully

Conversation

@VaguelySerious
Copy link
Copy Markdown
Member

When multiple step invocations race to complete/fail/retry a step, the server returns a 409 Conflict. Previously this would bubble up as an unhandled error. Now these are caught and logged as warnings, matching the pattern established for run_completed/run_failed in #1118.

…p_retrying events

When multiple step invocations race to complete/fail/retry a step, the
server returns a 409 Conflict. Previously this would bubble up as an
unhandled error. Now these are caught and logged as warnings, matching
the pattern established for run_completed/run_failed in #1118.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 19, 2026

🦋 Changeset detected

Latest commit: c59a690

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

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

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

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

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 19, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 19, 2026

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.029s (-14.6% 🟢) 1.004s (~) 0.976s 10 1.00x
💻 Local Nitro 0.032s (-4.5%) 1.004s (~) 0.972s 10 1.12x
💻 Local Next.js (Turbopack) 0.048s 1.005s 0.957s 10 1.66x
🌐 Redis Next.js (Turbopack) 0.049s 1.005s 0.956s 10 1.70x
🌐 MongoDB Next.js (Turbopack) 0.092s 1.007s 0.915s 10 3.20x
🐘 Postgres Nitro 0.126s (-70.4% 🟢) 1.009s (~) 0.883s 10 4.39x
🐘 Postgres Express 0.213s (+116.0% 🔺) 1.010s (~) 0.797s 10 7.42x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 0.476s (-16.9% 🟢) 2.049s (+20.8% 🔺) 1.573s 10 1.00x
▲ Vercel Next.js (Turbopack) 0.502s (-26.5% 🟢) 1.969s (-9.1% 🟢) 1.467s 10 1.05x
▲ Vercel Express 0.543s (+4.5%) 1.939s (-2.3%) 1.396s 10 1.14x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 1.099s (-0.8%) 2.005s (~) 0.907s 10 1.00x
🌐 Redis Next.js (Turbopack) 1.104s 2.006s 0.902s 10 1.01x
💻 Local Nitro 1.107s (~) 2.005s (~) 0.898s 10 1.01x
💻 Local Next.js (Turbopack) 1.107s 2.005s 0.898s 10 1.01x
🌐 MongoDB Next.js (Turbopack) 1.299s 2.008s 0.709s 10 1.18x
🐘 Postgres Express 2.437s (-1.5%) 3.014s (~) 0.577s 10 2.22x
🐘 Postgres Nitro 2.465s (+20.8% 🔺) 3.013s (+19.9% 🔺) 0.548s 10 2.24x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 1.994s (-3.5%) 3.274s (-4.3%) 1.280s 10 1.00x
▲ Vercel Express 2.038s (-1.3%) 3.486s (+1.3%) 1.448s 10 1.02x
▲ Vercel Next.js (Turbopack) 2.145s (+4.4%) 3.314s (~) 1.169s 10 1.08x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 10.705s 11.022s 0.317s 3 1.00x
💻 Local Express 10.779s (-0.6%) 11.022s (~) 0.243s 3 1.01x
💻 Local Next.js (Turbopack) 10.799s 11.023s 0.224s 3 1.01x
💻 Local Nitro 10.846s (~) 11.022s (~) 0.176s 3 1.01x
🌐 MongoDB Next.js (Turbopack) 12.183s 13.024s 0.841s 3 1.14x
🐘 Postgres Express 20.312s (~) 21.057s (~) 0.745s 2 1.90x
🐘 Postgres Nitro 20.339s (+34.1% 🔺) 21.054s (+31.2% 🔺) 0.715s 2 1.90x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 15.349s (-0.5%) 16.576s (-3.6%) 1.227s 2 1.00x
▲ Vercel Nitro 15.845s (+1.3%) 16.953s (-1.0%) 1.108s 2 1.03x
▲ Vercel Next.js (Turbopack) 16.241s (+1.3%) 17.819s (+1.3%) 1.578s 2 1.06x

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

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 26.885s 27.050s 0.165s 3 1.00x
💻 Local Express 27.299s (-0.7%) 28.050s (~) 0.751s 3 1.02x
💻 Local Next.js (Turbopack) 27.322s 28.054s 0.733s 3 1.02x
💻 Local Nitro 27.507s (~) 28.052s (~) 0.545s 3 1.02x
🌐 MongoDB Next.js (Turbopack) 29.817s 30.045s 0.228s 2 1.11x
🐘 Postgres Express 50.346s (~) 51.131s (~) 0.785s 2 1.87x
🐘 Postgres Nitro 50.358s (+24.3% 🔺) 51.125s (+25.9% 🔺) 0.766s 2 1.87x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 38.971s (-0.7%) 40.623s (+0.6%) 1.652s 2 1.00x
▲ Vercel Next.js (Turbopack) 41.327s (+2.2%) 42.956s (+2.9%) 1.630s 2 1.06x
▲ Vercel Nitro 44.955s (+15.8% 🔺) 46.160s (+15.0% 🔺) 1.205s 2 1.15x

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

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 54.449s 55.103s 0.655s 2 1.00x
💻 Local Express 56.746s (-0.8%) 57.102s (-1.7%) 0.356s 2 1.04x
💻 Local Next.js (Turbopack) 56.807s 57.112s 0.304s 2 1.04x
💻 Local Nitro 57.055s (~) 57.102s (-1.7%) 0.047s 2 1.05x
🌐 MongoDB Next.js (Turbopack) 60.849s 61.077s 0.228s 2 1.12x
🐘 Postgres Nitro 100.245s (+22.8% 🔺) 101.242s (+23.2% 🔺) 0.997s 1 1.84x
🐘 Postgres Express 100.282s (~) 101.243s (~) 0.961s 1 1.84x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 84.271s (+1.0%) 86.342s (+2.0%) 2.071s 2 1.00x
▲ Vercel Nitro 84.672s (-10.9% 🟢) 85.916s (-11.1% 🟢) 1.244s 2 1.00x
▲ Vercel Next.js (Turbopack) 87.110s (-7.4% 🟢) 88.516s (-7.3% 🟢) 1.406s 2 1.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.258s 2.006s 0.748s 15 1.00x
💻 Local Express 1.380s (-1.4%) 2.006s (~) 0.626s 15 1.10x
💻 Local Next.js (Turbopack) 1.395s 2.005s 0.609s 15 1.11x
💻 Local Nitro 1.412s (+2.0%) 2.005s (~) 0.593s 15 1.12x
🌐 MongoDB Next.js (Turbopack) 2.153s 3.008s 0.855s 10 1.71x
🐘 Postgres Nitro 2.272s (+6.0% 🔺) 3.013s (+2.9%) 0.741s 10 1.81x
🐘 Postgres Express 2.293s (+0.7%) 3.013s (~) 0.721s 10 1.82x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.202s (~) 3.503s (-4.5%) 1.301s 9 1.00x
▲ Vercel Next.js (Turbopack) 2.732s (-6.3% 🟢) 3.969s (-11.0% 🟢) 1.237s 9 1.24x
▲ Vercel Express 3.581s (+51.1% 🔺) 5.072s (+40.7% 🔺) 1.491s 6 1.63x

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

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 2.421s (-4.6%) 3.008s (~) 0.587s 10 1.00x
💻 Local Nitro 2.481s (+1.7%) 3.008s (~) 0.527s 10 1.02x
💻 Local Next.js (Turbopack) 2.482s 3.007s 0.525s 10 1.03x
🌐 Redis Next.js (Turbopack) 2.487s 3.008s 0.520s 10 1.03x
🌐 MongoDB Next.js (Turbopack) 4.694s 5.178s 0.484s 6 1.94x
🐘 Postgres Nitro 7.940s (-29.8% 🟢) 8.531s (-27.1% 🟢) 0.591s 4 3.28x
🐘 Postgres Express 8.460s (-1.3%) 9.033s (-2.8%) 0.573s 4 3.49x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.602s (+3.0%) 3.778s (-0.9%) 1.176s 8 1.00x
▲ Vercel Next.js (Turbopack) 2.868s (+9.8% 🔺) 3.810s (-0.5%) 0.943s 8 1.10x
▲ Vercel Express 3.979s (+64.3% 🔺) 5.202s (+37.4% 🔺) 1.223s 6 1.53x

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

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 4.037s 4.438s 0.401s 7 1.00x
💻 Local Next.js (Turbopack) 6.760s 7.214s 0.454s 5 1.67x
💻 Local Express 6.827s (-7.3% 🟢) 7.218s (-10.0% 🟢) 0.391s 5 1.69x
💻 Local Nitro 6.853s (+2.1%) 7.021s (~) 0.168s 5 1.70x
🌐 MongoDB Next.js (Turbopack) 9.896s 10.350s 0.454s 3 2.45x
🐘 Postgres Nitro 48.813s (+2.2%) 49.157s (+2.1%) 0.344s 1 12.09x
🐘 Postgres Express 50.880s (+2.0%) 51.183s (+2.1%) 0.303s 1 12.60x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.995s (-15.8% 🟢) 4.028s (-14.8% 🟢) 1.032s 8 1.00x
▲ Vercel Express 3.408s (+8.6% 🔺) 4.629s (+12.4% 🔺) 1.221s 7 1.14x
▲ Vercel Next.js (Turbopack) 3.614s (+4.3%) 4.598s (+1.7%) 0.984s 7 1.21x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 1.267s 2.006s 0.739s 15 1.00x
💻 Local Express 1.412s (-1.1%) 2.006s (~) 0.594s 15 1.11x
💻 Local Nitro 1.427s (+1.2%) 2.006s (~) 0.579s 15 1.13x
💻 Local Next.js (Turbopack) 1.458s 2.006s 0.547s 15 1.15x
🌐 MongoDB Next.js (Turbopack) 2.128s 3.008s 0.880s 10 1.68x
🐘 Postgres Nitro 2.186s (+2.8%) 2.679s (~) 0.493s 12 1.73x
🐘 Postgres Express 2.218s (~) 2.740s (+5.6% 🔺) 0.523s 11 1.75x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.060s (-20.6% 🟢) 3.356s (-13.1% 🟢) 1.296s 9 1.00x
▲ Vercel Express 2.147s (~) 3.433s (~) 1.286s 9 1.04x
▲ Vercel Next.js (Turbopack) 2.351s (+2.9%) 3.625s (~) 1.274s 9 1.14x

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

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 2.479s 3.007s 0.528s 10 1.00x
💻 Local Nitro 2.588s (-1.1%) 3.009s (~) 0.421s 10 1.04x
💻 Local Express 2.646s (-1.7%) 3.007s (~) 0.362s 10 1.07x
💻 Local Next.js (Turbopack) 2.693s 3.010s 0.316s 10 1.09x
🌐 MongoDB Next.js (Turbopack) 4.679s 5.177s 0.499s 6 1.89x
🐘 Postgres Nitro 10.280s (-2.8%) 10.695s (-5.9% 🟢) 0.415s 3 4.15x
🐘 Postgres Express 11.117s (-8.6% 🟢) 11.365s (-8.2% 🟢) 0.248s 3 4.48x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.246s (-2.0%) 3.485s (+2.0%) 1.238s 9 1.00x
▲ Vercel Next.js (Turbopack) 2.619s (+2.5%) 3.696s (-1.1%) 1.078s 9 1.17x
▲ Vercel Nitro 2.928s (+28.4% 🔺) 4.577s (+28.8% 🔺) 1.649s 8 1.30x

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

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Redis 🥇 Next.js (Turbopack) 4.010s 4.724s 0.714s 7 1.00x
💻 Local Next.js (Turbopack) 7.063s 7.769s 0.706s 4 1.76x
💻 Local Express 7.215s (-6.7% 🟢) 8.019s (~) 0.804s 4 1.80x
💻 Local Nitro 7.655s (+3.2%) 8.024s (~) 0.369s 4 1.91x
🌐 MongoDB Next.js (Turbopack) 9.977s 10.350s 0.373s 3 2.49x
🐘 Postgres Express 48.605s (-3.1%) 49.119s (-3.9%) 0.514s 1 12.12x
🐘 Postgres Nitro 51.945s (+8.1% 🔺) 52.110s (+8.2% 🔺) 0.165s 1 12.95x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.917s (-17.2% 🟢) 3.920s (-13.6% 🟢) 1.004s 8 1.00x
▲ Vercel Express 3.620s (+5.5% 🔺) 4.579s (+3.2%) 0.959s 7 1.24x
▲ Vercel Nitro 3.647s (+28.8% 🔺) 4.650s (+15.1% 🔺) 1.004s 7 1.25x

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

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 0.147s 1.001s 0.010s 1.016s 0.869s 10 1.00x
🌐 Redis Next.js (Turbopack) 0.153s 1.000s 0.001s 1.007s 0.854s 10 1.04x
💻 Local Express 0.161s (-8.3% 🟢) 1.003s (~) 0.010s (-7.6% 🟢) 1.015s (~) 0.854s 10 1.09x
💻 Local Nitro 0.179s (~) 1.002s (~) 0.010s (-5.9% 🟢) 1.015s (~) 0.836s 10 1.21x
🌐 MongoDB Next.js (Turbopack) 0.494s 0.945s 0.001s 1.009s 0.514s 10 3.35x
🐘 Postgres Nitro 2.344s (+103.8% 🔺) 2.696s (+42.1% 🔺) 0.002s (+7.1% 🔺) 3.014s (+49.6% 🔺) 0.669s 10 15.90x
🐘 Postgres Express 2.382s (+1.2%) 2.659s (-1.1%) 0.001s (-7.1% 🟢) 3.015s (~) 0.633s 10 16.16x
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 1.610s (+1.4%) 2.168s (+3.0%) 0.095s (-41.3% 🟢) 2.836s (+2.5%) 1.226s 10 1.00x
▲ Vercel Nitro 1.652s (-21.5% 🟢) 1.921s (-30.1% 🟢) 0.222s (+25.1% 🔺) 2.629s (-24.6% 🟢) 0.977s 10 1.03x
▲ Vercel Next.js (Turbopack) 1.740s (+1.0%) 2.565s (+7.6% 🔺) 0.182s (+30.9% 🔺) 3.241s (+5.1% 🔺) 1.502s 10 1.08x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

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

Winner determined by most benchmark wins

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

Worlds:

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

📋 View full workflow run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 19, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 522 1 49 572
✅ 💻 Local Development 556 0 68 624
✅ 📦 Local Production 556 0 68 624
✅ 🐘 Local Postgres 556 0 68 624
✅ 🪟 Windows 49 0 3 52
❌ 🌍 Community Worlds 111 45 9 165
✅ 📋 Other 135 0 21 156
Total 2485 46 286 2817

❌ Failed Tests

▲ Vercel Production (1 failed)

nextjs-turbopack (1 failed):

  • error handling retry behavior workflow completes despite transient 5xx on step_completed
🌍 Community Worlds (45 failed)

turso (45 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • hookWorkflow
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling retry behavior workflow completes despite transient 5xx on step_completed
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router

Details by Category

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

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@VaguelySerious VaguelySerious marked this pull request as ready for review February 19, 2026 01:52
Copy link
Copy Markdown
Contributor

@pranaygp pranaygp left a comment

Choose a reason for hiding this comment

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

Solid PR — the 409 handling pattern is consistent and correct, and the tests cover the key paths well. Left a few minor comments.

},
});
try {
await world.events.create(workflowRunId, {
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.

Nit: This is the only step_failed event creation that does not use withServerErrorRetry. The other three sites (fatal error path, max retries exhausted path, and step_retrying) all wrap the call with it. Was this intentional? If not, might be worth wrapping for consistency:

try {
  await withServerErrorRetry(() =>
    world.events.create(workflowRunId, {
      ...
    })
  );
} catch (err) {

(Pre-existing, but since you're already touching this block it'd be a clean fix.)

},
event: {},
});
mockStepFn.mockResolvedValue('step-result');
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.

Unused variable — callCount is incremented but never asserted on. Either assert it (e.g. expect(callCount).toBe(1) to verify step_completed was actually attempted) or remove it.

).rejects.toThrow('Internal Server Error');
});
});
});
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.

Nice that you have a should re-throw non-409 errors from step_retrying test. Consider adding analogous re-throw tests for step_completed and step_failed (e.g. a 500 from step_completed should propagate, a 500 from step_failed in the max-retries path should propagate). This would fully cover all the throw err / throw stepFailErr branches.

Copy link
Copy Markdown
Contributor

@pranaygp pranaygp left a comment

Choose a reason for hiding this comment

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

Did an audit of 409/410 handling across all world.events.create() call sites in the SDK (cross-referenced against the server's event validation logic and the event sourcing docs). The changes in this PR are correct — here are the pre-existing gaps worth addressing:


Should fix in this PR

packages/core/src/runtime/step-handler.ts:150-153 — uses console.warn() instead of runtimeLogger.info() for the step_started 410 (workflow already completed) case. Every other 410/409 handler in the file uses the structured logger. This should be:

runtimeLogger.info(
  'Workflow run already completed, skipping step',
  { workflowRunId, stepId, message: err.message }
);

info is the right level here — this is an expected, non-actionable condition (same as the 410 handler in the catch block at line 476-486).


Follow-up PR candidates

These are all pre-existing and fine to address separately:

1. packages/core/src/runtime/resume-hook.ts:128hook_received has no error handling at all. Server can return 409 (hook disposed) or 410 (run done) — both benign races that should be caught and logged as info. A 404 here would be a real bug and should throw.

2. packages/core/src/runtime/run.ts:69run_cancelled (the Run.cancel() method) has no error handling. Server returns 409 if run already terminal — should catch and log as warn.

3. packages/core/src/runtime/runs.ts:95run_cancelled (the cancelRun() function) — same issue, different call site. Errors get wrapped in a generic Failed to cancel run message, losing the 409 signal.

4. packages/core/src/runtime.ts:145run_started has no error handling. Server returns 410 if run is already terminal. Should catch 410 and log as info ("run already completed, skipping").

5. packages/core/src/runtime/suspension-handler.ts:116hook_created catches 410 but not 409. Server returns 409 if the hookId already exists (duplicate creation, same as step_created/wait_created). Should catch 409 and log as info, matching the pattern at lines 183 and 238.

6. packages/core/src/runtime/runs.ts:190wait_completed in wakeUpRun() catches 409 silently (increments stoppedCount with no log). A debug log would help observability without noise.

7. packages/core/src/runtime/step-handler.ts:253 — (already commented on this) the pre-execution guard step_failed is the only one not wrapped in withServerErrorRetry.

@VaguelySerious VaguelySerious merged commit c75de97 into main Feb 20, 2026
158 of 164 checks passed
@VaguelySerious VaguelySerious deleted the pnoll/handle-step-409-gracefully branch February 20, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants