Step queue write idempotency - #776

Merged
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54
Jan 13, 2026
Merged

Step queue write idempotency#776
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54

Conversation

@Timer

Copy link
Copy Markdown
Contributor

Description

Fixes a race condition where a workflow step could get stuck in a "pending" state indefinitely.

Previously, if a process crashed after creating a step in the database but before queuing it for execution, subsequent retries would encounter a 409 conflict (step already exists) and skip the queue write. This left the step pending with 0 attempts.

The fix ensures that the step is always written to the execution queue, even if it already exists in the database. The queue write uses an idempotency key (correlationId), so duplicate queue messages are safely handled by the queue service. Detailed comments have been added to explain this critical behavior.

How did you test your changes?

  • Built the @workflow/core package locally.
  • Ran all 219 tests for the @workflow/core package, which passed successfully.
  • Verified linting and typechecking for the @workflow/core package.

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
    • During beta, we only use "patch" mode for changes. Don't tag minor/major versions.
    • Use pnpm changeset --empty if you are changing documentation or workbench apps
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)

Slack Thread

Open in CursorOpen in Web

This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
@cursor

cursorBot commented Jan 13, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel

vercelBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentReviewUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-astro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-express-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-fastify-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-hono-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nitro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nuxt-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-sveltekit-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-vite-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
1 Skipped Deployment
ProjectDeploymentReviewUpdated (UTC)
workflow-docsSkippedSkippedJan 13, 2026 9:32pm

@changeset-bot

changeset-botBot commented Jan 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 967c489

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

This PR includes changesets to release 13 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/docs-typecheckPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@workflow/world-testingPatch
@workflow/nuxtPatch
@workflow/aiPatch

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

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

@github-actions

github-actionsBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production374011385
✅ 💻 Local Development34208350
✅ 📦 Local Production34208350
✅ 🐘 Local Postgres34208350
✅ 🪟 Windows350035
❌ 🌍 Community Worlds136160152
Total157116351622

❌ Failed Tests

🌍 Community Worlds (16 failed)

mongodb (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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 catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3401
✅ example3401
✅ express3401
✅ fastify3401
✅ hono3401
✅ nextjs-turbopack3401
✅ nextjs-webpack3401
✅ nitro3401
✅ nuxt3401
✅ sveltekit3401
✅ vite3401
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack3500
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3410
✅ redis-dev300
✅ redis3500
✅ starter-dev300
❌ starter21140
✅ turso-dev300
❌ turso3410

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 13, 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
🌐 Starter🥇 Next.js (Turbopack)0.037s (-6.7% 🟢)1.014s (~)0.976s101.00x
💻 LocalNext.js (Turbopack)0.038s (-1.3%)1.014s (~)0.975s101.02x
🌐 RedisNext.js (Turbopack)0.045s (+27.3% 🔺)1.020s (~)0.975s101.19x
💻 LocalNitro0.045s (+41.5% 🔺)1.006s (~)0.961s101.20x
💻 LocalExpress0.045s (+5.8% 🔺)1.007s (~)0.962s101.21x
🌐 MongoDBNext.js (Turbopack)0.084s (+84.0% 🔺)1.015s (~)0.931s102.24x
🌐 TursoNext.js (Turbopack)0.110s (+4.9%)1.013s (~)0.903s102.93x
🐘 PostgresNext.js (Turbopack)0.247s (-5.9% 🟢)1.021s (~)0.774s106.59x
🐘 PostgresNitro0.261s (+11.0% 🔺)1.013s (-1.3%)0.752s106.96x
🐘 PostgresExpress0.268s (-7.8% 🟢)1.035s (+1.5%)0.767s107.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.571s (-1.7%)1.505s (+2.0%)0.934s101.00x
▲ VercelNitro0.643s (+3.6%)1.602s (+12.2% 🔺)0.959s101.13x
▲ VercelNext.js (Turbopack)0.711s (-10.1% 🟢)1.573s (-7.2% 🟢)0.863s101.25x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (~)2.011s (~)0.919s101.00x
💻 LocalNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.01x
🌐 RedisNext.js (Turbopack)1.103s (+2.3%)2.013s (~)0.910s101.01x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
💻 LocalNitro1.114s (+3.2%)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.311s (+1.1%)2.015s (~)0.703s101.20x
🌐 TursoNext.js (Turbopack)1.320s (+1.6%)2.012s (~)0.692s101.21x
🐘 PostgresNext.js (Turbopack)1.708s (-8.8% 🟢)2.018s (~)0.309s101.56x
🐘 PostgresNitro2.199s (-9.0% 🟢)3.016s (~)0.817s102.01x
🐘 PostgresExpress2.456s (+15.6% 🔺)3.014s (~)0.558s102.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.832s (+6.2% 🔺)3.800s (+3.0%)0.968s101.00x
▲ VercelNext.js (Turbopack)2.905s (+3.9%)3.699s (-0.9%)0.794s101.03x
▲ VercelExpress2.968s (+3.3%)3.716s (-2.0%)0.748s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.601s (~)11.012s (~)0.411s51.00x
💻 LocalNext.js (Turbopack)10.666s (~)11.018s (~)0.352s51.01x
🌐 RedisNext.js (Turbopack)10.704s (+1.3%)11.020s (~)0.315s51.01x
💻 LocalExpress10.799s (~)11.014s (~)0.215s51.02x
💻 LocalNitro10.818s (+2.6%)11.012s (~)0.194s51.02x
🌐 TursoNext.js (Turbopack)12.213s (~)13.021s (~)0.808s51.15x
🌐 MongoDBNext.js (Turbopack)12.239s (+2.6%)13.027s (+8.3% 🔺)0.787s51.15x
🐘 PostgresNext.js (Turbopack)15.388s (+3.4%)16.041s (+2.6%)0.653s51.45x
🐘 PostgresExpress20.294s (-1.0%)21.040s (~)0.745s51.91x
🐘 PostgresNitro20.462s (~)21.030s (~)0.568s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.886s (+6.8% 🔺)24.788s (+7.6% 🔺)0.902s51.00x
▲ VercelNitro24.184s (+5.1% 🔺)24.858s (+5.2% 🔺)0.673s51.01x
▲ VercelExpress24.366s (+6.3% 🔺)25.109s (+6.0% 🔺)0.743s51.02x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.352s (~)2.008s (~)0.656s151.00x
🌐 RedisNext.js (Turbopack)1.369s (+3.4%)2.011s (~)0.643s151.01x
💻 LocalNext.js (Turbopack)1.387s (~)2.011s (~)0.625s151.03x
💻 LocalExpress1.402s (~)2.006s (~)0.604s151.04x
💻 LocalNitro1.427s (+5.4% 🔺)2.006s (~)0.579s151.06x
🐘 PostgresNext.js (Turbopack)1.935s (+12.4% 🔺)2.167s (+7.7% 🔺)0.232s141.43x
🌐 MongoDBNext.js (Turbopack)2.145s (+0.8%)3.011s (~)0.866s101.59x
🌐 TursoNext.js (Turbopack)2.211s (~)3.013s (~)0.803s101.63x
🐘 PostgresNitro2.370s (-10.0% 🟢)3.012s (~)0.643s101.75x
🐘 PostgresExpress2.616s (+7.6% 🔺)3.016s (~)0.401s101.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.812s (-15.7% 🟢)3.800s (-5.2% 🟢)0.988s81.00x
▲ VercelExpress3.034s (+9.2% 🔺)3.776s (+1.2%)0.742s81.08x
▲ VercelNext.js (Turbopack)3.055s (+5.2% 🔺)3.838s (+3.3%)0.782s81.09x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.121s (~)3.009s (~)0.888s101.00x
💻 LocalExpress2.207s (~)3.164s (~)0.957s101.04x
💻 LocalNitro2.258s (+12.8% 🔺)3.208s (+33.5% 🔺)0.950s101.06x
🌐 StarterNext.js (Turbopack)2.467s (~)3.009s (~)0.542s101.16x
🌐 RedisNext.js (Turbopack)2.517s (+6.3% 🔺)3.020s (~)0.503s101.19x
🐘 PostgresNext.js (Turbopack)2.647s (+7.6% 🔺)3.018s (~)0.372s101.25x
🐘 PostgresExpress2.963s (-2.6%)3.013s (-15.7% 🟢)0.050s101.40x
🐘 PostgresNitro3.079s (+4.5%)3.696s (+18.6% 🔺)0.617s91.45x
🌐 TursoNext.js (Turbopack)4.661s (-1.8%)5.187s (~)0.526s62.20x
🌐 MongoDBNext.js (Turbopack)4.715s (+0.7%)5.182s (~)0.467s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.515s (+8.1% 🔺)4.047s (+12.9% 🔺)0.532s81.00x
▲ VercelExpress3.660s (+11.1% 🔺)4.628s (+19.4% 🔺)0.967s71.04x
▲ VercelNext.js (Turbopack)3.753s (-6.5% 🟢)4.655s (+1.1%)0.902s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.376s (-0.7%)2.008s (~)0.632s151.00x
💻 LocalNext.js (Turbopack)1.378s (-1.3%)2.011s (~)0.634s151.00x
🌐 RedisNext.js (Turbopack)1.396s (+4.1%)2.010s (~)0.614s151.01x
💻 LocalExpress1.439s (+1.3%)2.005s (~)0.566s151.05x
💻 LocalNitro1.447s (+8.7% 🔺)2.005s (~)0.558s151.05x
🐘 PostgresNext.js (Turbopack)1.648s (-0.9%)2.014s (~)0.366s151.20x
🐘 PostgresExpress1.713s (-17.8% 🟢)2.012s (-16.2% 🟢)0.299s151.24x
🐘 PostgresNitro1.937s (+13.6% 🔺)2.010s (~)0.073s151.41x
🌐 MongoDBNext.js (Turbopack)2.156s (+1.9%)3.011s (~)0.856s101.57x
🌐 TursoNext.js (Turbopack)2.225s (-0.6%)3.014s (~)0.789s101.62x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.938s (+4.0%)3.791s (+1.6%)0.854s81.00x
▲ VercelNitro2.982s (+3.8%)3.908s (+8.9% 🔺)0.925s81.02x
▲ VercelNext.js (Turbopack)3.188s (+8.4% 🔺)3.784s (+0.8%)0.596s81.09x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.153s (-0.7%)3.115s (+1.2%)0.962s101.00x
💻 LocalNitro2.282s (+9.2% 🔺)3.213s (+16.8% 🔺)0.931s101.06x
💻 LocalExpress2.330s (+1.5%)3.236s (~)0.905s101.08x
🌐 StarterNext.js (Turbopack)2.466s (~)3.013s (~)0.547s101.15x
🌐 RedisNext.js (Turbopack)2.523s (+6.6% 🔺)3.019s (~)0.496s101.17x
🐘 PostgresNitro2.695s (~)3.011s (~)0.316s101.25x
🐘 PostgresNext.js (Turbopack)2.704s (+10.1% 🔺)3.025s (~)0.320s101.26x
🐘 PostgresExpress2.955s (+2.2%)3.227s (+3.7%)0.272s101.37x
🌐 MongoDBNext.js (Turbopack)4.652s (-1.3%)5.180s (~)0.528s62.16x
🌐 TursoNext.js (Turbopack)4.706s (-2.1%)5.187s (~)0.480s62.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.332s (+2.7%)3.792s (~)0.460s81.00x
▲ VercelExpress3.333s (+3.2%)3.912s (+4.3%)0.579s81.00x
▲ VercelNext.js (Turbopack)3.715s (+11.3% 🔺)4.333s (+7.7% 🔺)0.617s81.12x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.128s (-1.5%)1.006s (~)0.000s (NaN%)1.011s (~)0.883s101.00x
💻 LocalNext.js (Turbopack)0.137s (-1.1%)1.004s (~)0.015s (-4.9%)1.027s (~)0.890s101.06x
🌐 RedisNext.js (Turbopack)0.153s (+33.9% 🔺)1.005s (~)0.000s (+Infinity% 🔺)1.015s (~)0.862s101.19x
💻 LocalExpress0.176s (+1.0%)0.992s (~)0.015s (+6.2% 🔺)1.022s (~)0.846s101.37x
💻 LocalNitro0.181s (+48.6% 🔺)0.992s (-0.6%)0.016s (-2.5%)1.021s (~)0.840s101.41x
🌐 TursoNext.js (Turbopack)0.465s (-8.7% 🟢)0.986s (+3.4%)0.000s (-50.0% 🟢)1.013s (~)0.548s103.62x
🌐 MongoDBNext.js (Turbopack)0.500s (+1.3%)0.950s (~)0.000s (-100.0% 🟢)1.013s (~)0.513s103.89x
🐘 PostgresNext.js (Turbopack)0.734s (-42.5% 🟢)0.885s (-42.9% 🟢)0.000s (+200.0% 🔺)1.017s (-44.1% 🟢)0.283s105.71x
🐘 PostgresExpress2.186s (-6.1% 🟢)2.860s (+5.4% 🔺)0.000s (NaN%)3.015s (~)0.829s1017.03x
🐘 PostgresNitro2.289s (+9.6% 🔺)2.753s (-1.8%)0.000s (+100.0% 🔺)3.013s (+3.4%)0.724s1017.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.009s (+1.7%)3.285s (+5.2% 🔺)0.753s (+11.7% 🔺)4.527s (+6.7% 🔺)1.518s101.00x
▲ VercelExpress3.050s (+5.0% 🔺)3.269s (+2.6%)0.893s (+79.4% 🔺)4.719s (+13.8% 🔺)1.670s101.01x
▲ VercelNext.js (Turbopack)3.056s (+2.8%)3.238s (-2.2%)0.886s (+75.7% 🔺)4.629s (+7.7% 🔺)1.574s101.02x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNitro5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Comment on lines -119 to -127
waitUntil(
Promise.all(ops).catch((opErr) => {
// Ignore expected client disconnect errors (e.g., browser refresh during streaming)
const isAbortError =
opErr?.name === 'AbortError' || opErr?.name === 'ResponseAborted';
if (!isAbortError) throw opErr;
})
);

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.

we can't remove this

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.

will simplify this after event sourcing ( #621 ) but need to keep it in for now

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.

hmm wait maybe Cursor is right and this is dead code since e2e tests are passing

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

lgtm

@TooTallNate
TooTallNate merged commit 49f650c into mainJan 13, 2026
98 checks passed
@TooTallNate
TooTallNate deleted the cursor/step-queue-write-idempotency-ee54 branch January 13, 2026 22:00
VaguelySerious pushed a commit that referenced this pull request Jan 16, 2026
* fix(core): always write step to queue even if step already exists
This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
* chore: add changeset for step queue idempotency fix
* chore(core): remove dead ops array code from processStep
The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
* DCO Remediation Commit for Cursor Agent <cursoragent@cursor.com>
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
---------
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Timer@TooTallNate@pranaygp@cursoragent
, '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

Step queue write idempotency - #776

Merged
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54
Jan 13, 2026
Merged

Step queue write idempotency#776
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54

Conversation

@Timer

Copy link
Copy Markdown
Contributor

Description

Fixes a race condition where a workflow step could get stuck in a "pending" state indefinitely.

Previously, if a process crashed after creating a step in the database but before queuing it for execution, subsequent retries would encounter a 409 conflict (step already exists) and skip the queue write. This left the step pending with 0 attempts.

The fix ensures that the step is always written to the execution queue, even if it already exists in the database. The queue write uses an idempotency key (correlationId), so duplicate queue messages are safely handled by the queue service. Detailed comments have been added to explain this critical behavior.

How did you test your changes?

  • Built the @workflow/core package locally.
  • Ran all 219 tests for the @workflow/core package, which passed successfully.
  • Verified linting and typechecking for the @workflow/core package.

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
    • During beta, we only use "patch" mode for changes. Don't tag minor/major versions.
    • Use pnpm changeset --empty if you are changing documentation or workbench apps
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)

Slack Thread

Open in CursorOpen in Web

This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
@cursor

cursorBot commented Jan 13, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel

vercelBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentReviewUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-astro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-express-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-fastify-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-hono-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nitro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nuxt-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-sveltekit-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-vite-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
1 Skipped Deployment
ProjectDeploymentReviewUpdated (UTC)
workflow-docsSkippedSkippedJan 13, 2026 9:32pm

@changeset-bot

changeset-botBot commented Jan 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 967c489

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

This PR includes changesets to release 13 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/docs-typecheckPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@workflow/world-testingPatch
@workflow/nuxtPatch
@workflow/aiPatch

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

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

@github-actions

github-actionsBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production374011385
✅ 💻 Local Development34208350
✅ 📦 Local Production34208350
✅ 🐘 Local Postgres34208350
✅ 🪟 Windows350035
❌ 🌍 Community Worlds136160152
Total157116351622

❌ Failed Tests

🌍 Community Worlds (16 failed)

mongodb (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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 catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3401
✅ example3401
✅ express3401
✅ fastify3401
✅ hono3401
✅ nextjs-turbopack3401
✅ nextjs-webpack3401
✅ nitro3401
✅ nuxt3401
✅ sveltekit3401
✅ vite3401
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack3500
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3410
✅ redis-dev300
✅ redis3500
✅ starter-dev300
❌ starter21140
✅ turso-dev300
❌ turso3410

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 13, 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
🌐 Starter🥇 Next.js (Turbopack)0.037s (-6.7% 🟢)1.014s (~)0.976s101.00x
💻 LocalNext.js (Turbopack)0.038s (-1.3%)1.014s (~)0.975s101.02x
🌐 RedisNext.js (Turbopack)0.045s (+27.3% 🔺)1.020s (~)0.975s101.19x
💻 LocalNitro0.045s (+41.5% 🔺)1.006s (~)0.961s101.20x
💻 LocalExpress0.045s (+5.8% 🔺)1.007s (~)0.962s101.21x
🌐 MongoDBNext.js (Turbopack)0.084s (+84.0% 🔺)1.015s (~)0.931s102.24x
🌐 TursoNext.js (Turbopack)0.110s (+4.9%)1.013s (~)0.903s102.93x
🐘 PostgresNext.js (Turbopack)0.247s (-5.9% 🟢)1.021s (~)0.774s106.59x
🐘 PostgresNitro0.261s (+11.0% 🔺)1.013s (-1.3%)0.752s106.96x
🐘 PostgresExpress0.268s (-7.8% 🟢)1.035s (+1.5%)0.767s107.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.571s (-1.7%)1.505s (+2.0%)0.934s101.00x
▲ VercelNitro0.643s (+3.6%)1.602s (+12.2% 🔺)0.959s101.13x
▲ VercelNext.js (Turbopack)0.711s (-10.1% 🟢)1.573s (-7.2% 🟢)0.863s101.25x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (~)2.011s (~)0.919s101.00x
💻 LocalNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.01x
🌐 RedisNext.js (Turbopack)1.103s (+2.3%)2.013s (~)0.910s101.01x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
💻 LocalNitro1.114s (+3.2%)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.311s (+1.1%)2.015s (~)0.703s101.20x
🌐 TursoNext.js (Turbopack)1.320s (+1.6%)2.012s (~)0.692s101.21x
🐘 PostgresNext.js (Turbopack)1.708s (-8.8% 🟢)2.018s (~)0.309s101.56x
🐘 PostgresNitro2.199s (-9.0% 🟢)3.016s (~)0.817s102.01x
🐘 PostgresExpress2.456s (+15.6% 🔺)3.014s (~)0.558s102.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.832s (+6.2% 🔺)3.800s (+3.0%)0.968s101.00x
▲ VercelNext.js (Turbopack)2.905s (+3.9%)3.699s (-0.9%)0.794s101.03x
▲ VercelExpress2.968s (+3.3%)3.716s (-2.0%)0.748s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.601s (~)11.012s (~)0.411s51.00x
💻 LocalNext.js (Turbopack)10.666s (~)11.018s (~)0.352s51.01x
🌐 RedisNext.js (Turbopack)10.704s (+1.3%)11.020s (~)0.315s51.01x
💻 LocalExpress10.799s (~)11.014s (~)0.215s51.02x
💻 LocalNitro10.818s (+2.6%)11.012s (~)0.194s51.02x
🌐 TursoNext.js (Turbopack)12.213s (~)13.021s (~)0.808s51.15x
🌐 MongoDBNext.js (Turbopack)12.239s (+2.6%)13.027s (+8.3% 🔺)0.787s51.15x
🐘 PostgresNext.js (Turbopack)15.388s (+3.4%)16.041s (+2.6%)0.653s51.45x
🐘 PostgresExpress20.294s (-1.0%)21.040s (~)0.745s51.91x
🐘 PostgresNitro20.462s (~)21.030s (~)0.568s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.886s (+6.8% 🔺)24.788s (+7.6% 🔺)0.902s51.00x
▲ VercelNitro24.184s (+5.1% 🔺)24.858s (+5.2% 🔺)0.673s51.01x
▲ VercelExpress24.366s (+6.3% 🔺)25.109s (+6.0% 🔺)0.743s51.02x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.352s (~)2.008s (~)0.656s151.00x
🌐 RedisNext.js (Turbopack)1.369s (+3.4%)2.011s (~)0.643s151.01x
💻 LocalNext.js (Turbopack)1.387s (~)2.011s (~)0.625s151.03x
💻 LocalExpress1.402s (~)2.006s (~)0.604s151.04x
💻 LocalNitro1.427s (+5.4% 🔺)2.006s (~)0.579s151.06x
🐘 PostgresNext.js (Turbopack)1.935s (+12.4% 🔺)2.167s (+7.7% 🔺)0.232s141.43x
🌐 MongoDBNext.js (Turbopack)2.145s (+0.8%)3.011s (~)0.866s101.59x
🌐 TursoNext.js (Turbopack)2.211s (~)3.013s (~)0.803s101.63x
🐘 PostgresNitro2.370s (-10.0% 🟢)3.012s (~)0.643s101.75x
🐘 PostgresExpress2.616s (+7.6% 🔺)3.016s (~)0.401s101.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.812s (-15.7% 🟢)3.800s (-5.2% 🟢)0.988s81.00x
▲ VercelExpress3.034s (+9.2% 🔺)3.776s (+1.2%)0.742s81.08x
▲ VercelNext.js (Turbopack)3.055s (+5.2% 🔺)3.838s (+3.3%)0.782s81.09x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.121s (~)3.009s (~)0.888s101.00x
💻 LocalExpress2.207s (~)3.164s (~)0.957s101.04x
💻 LocalNitro2.258s (+12.8% 🔺)3.208s (+33.5% 🔺)0.950s101.06x
🌐 StarterNext.js (Turbopack)2.467s (~)3.009s (~)0.542s101.16x
🌐 RedisNext.js (Turbopack)2.517s (+6.3% 🔺)3.020s (~)0.503s101.19x
🐘 PostgresNext.js (Turbopack)2.647s (+7.6% 🔺)3.018s (~)0.372s101.25x
🐘 PostgresExpress2.963s (-2.6%)3.013s (-15.7% 🟢)0.050s101.40x
🐘 PostgresNitro3.079s (+4.5%)3.696s (+18.6% 🔺)0.617s91.45x
🌐 TursoNext.js (Turbopack)4.661s (-1.8%)5.187s (~)0.526s62.20x
🌐 MongoDBNext.js (Turbopack)4.715s (+0.7%)5.182s (~)0.467s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.515s (+8.1% 🔺)4.047s (+12.9% 🔺)0.532s81.00x
▲ VercelExpress3.660s (+11.1% 🔺)4.628s (+19.4% 🔺)0.967s71.04x
▲ VercelNext.js (Turbopack)3.753s (-6.5% 🟢)4.655s (+1.1%)0.902s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.376s (-0.7%)2.008s (~)0.632s151.00x
💻 LocalNext.js (Turbopack)1.378s (-1.3%)2.011s (~)0.634s151.00x
🌐 RedisNext.js (Turbopack)1.396s (+4.1%)2.010s (~)0.614s151.01x
💻 LocalExpress1.439s (+1.3%)2.005s (~)0.566s151.05x
💻 LocalNitro1.447s (+8.7% 🔺)2.005s (~)0.558s151.05x
🐘 PostgresNext.js (Turbopack)1.648s (-0.9%)2.014s (~)0.366s151.20x
🐘 PostgresExpress1.713s (-17.8% 🟢)2.012s (-16.2% 🟢)0.299s151.24x
🐘 PostgresNitro1.937s (+13.6% 🔺)2.010s (~)0.073s151.41x
🌐 MongoDBNext.js (Turbopack)2.156s (+1.9%)3.011s (~)0.856s101.57x
🌐 TursoNext.js (Turbopack)2.225s (-0.6%)3.014s (~)0.789s101.62x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.938s (+4.0%)3.791s (+1.6%)0.854s81.00x
▲ VercelNitro2.982s (+3.8%)3.908s (+8.9% 🔺)0.925s81.02x
▲ VercelNext.js (Turbopack)3.188s (+8.4% 🔺)3.784s (+0.8%)0.596s81.09x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.153s (-0.7%)3.115s (+1.2%)0.962s101.00x
💻 LocalNitro2.282s (+9.2% 🔺)3.213s (+16.8% 🔺)0.931s101.06x
💻 LocalExpress2.330s (+1.5%)3.236s (~)0.905s101.08x
🌐 StarterNext.js (Turbopack)2.466s (~)3.013s (~)0.547s101.15x
🌐 RedisNext.js (Turbopack)2.523s (+6.6% 🔺)3.019s (~)0.496s101.17x
🐘 PostgresNitro2.695s (~)3.011s (~)0.316s101.25x
🐘 PostgresNext.js (Turbopack)2.704s (+10.1% 🔺)3.025s (~)0.320s101.26x
🐘 PostgresExpress2.955s (+2.2%)3.227s (+3.7%)0.272s101.37x
🌐 MongoDBNext.js (Turbopack)4.652s (-1.3%)5.180s (~)0.528s62.16x
🌐 TursoNext.js (Turbopack)4.706s (-2.1%)5.187s (~)0.480s62.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.332s (+2.7%)3.792s (~)0.460s81.00x
▲ VercelExpress3.333s (+3.2%)3.912s (+4.3%)0.579s81.00x
▲ VercelNext.js (Turbopack)3.715s (+11.3% 🔺)4.333s (+7.7% 🔺)0.617s81.12x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.128s (-1.5%)1.006s (~)0.000s (NaN%)1.011s (~)0.883s101.00x
💻 LocalNext.js (Turbopack)0.137s (-1.1%)1.004s (~)0.015s (-4.9%)1.027s (~)0.890s101.06x
🌐 RedisNext.js (Turbopack)0.153s (+33.9% 🔺)1.005s (~)0.000s (+Infinity% 🔺)1.015s (~)0.862s101.19x
💻 LocalExpress0.176s (+1.0%)0.992s (~)0.015s (+6.2% 🔺)1.022s (~)0.846s101.37x
💻 LocalNitro0.181s (+48.6% 🔺)0.992s (-0.6%)0.016s (-2.5%)1.021s (~)0.840s101.41x
🌐 TursoNext.js (Turbopack)0.465s (-8.7% 🟢)0.986s (+3.4%)0.000s (-50.0% 🟢)1.013s (~)0.548s103.62x
🌐 MongoDBNext.js (Turbopack)0.500s (+1.3%)0.950s (~)0.000s (-100.0% 🟢)1.013s (~)0.513s103.89x
🐘 PostgresNext.js (Turbopack)0.734s (-42.5% 🟢)0.885s (-42.9% 🟢)0.000s (+200.0% 🔺)1.017s (-44.1% 🟢)0.283s105.71x
🐘 PostgresExpress2.186s (-6.1% 🟢)2.860s (+5.4% 🔺)0.000s (NaN%)3.015s (~)0.829s1017.03x
🐘 PostgresNitro2.289s (+9.6% 🔺)2.753s (-1.8%)0.000s (+100.0% 🔺)3.013s (+3.4%)0.724s1017.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.009s (+1.7%)3.285s (+5.2% 🔺)0.753s (+11.7% 🔺)4.527s (+6.7% 🔺)1.518s101.00x
▲ VercelExpress3.050s (+5.0% 🔺)3.269s (+2.6%)0.893s (+79.4% 🔺)4.719s (+13.8% 🔺)1.670s101.01x
▲ VercelNext.js (Turbopack)3.056s (+2.8%)3.238s (-2.2%)0.886s (+75.7% 🔺)4.629s (+7.7% 🔺)1.574s101.02x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNitro5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Comment on lines -119 to -127
waitUntil(
Promise.all(ops).catch((opErr) => {
// Ignore expected client disconnect errors (e.g., browser refresh during streaming)
const isAbortError =
opErr?.name === 'AbortError' || opErr?.name === 'ResponseAborted';
if (!isAbortError) throw opErr;
})
);

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.

we can't remove this

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.

will simplify this after event sourcing ( #621 ) but need to keep it in for now

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.

hmm wait maybe Cursor is right and this is dead code since e2e tests are passing

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

lgtm

@TooTallNate
TooTallNate merged commit 49f650c into mainJan 13, 2026
98 checks passed
@TooTallNate
TooTallNate deleted the cursor/step-queue-write-idempotency-ee54 branch January 13, 2026 22:00
VaguelySerious pushed a commit that referenced this pull request Jan 16, 2026
* fix(core): always write step to queue even if step already exists
This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
* chore: add changeset for step queue idempotency fix
* chore(core): remove dead ops array code from processStep
The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
* DCO Remediation Commit for Cursor Agent <cursoragent@cursor.com>
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
---------
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Timer@TooTallNate@pranaygp@cursoragent
, '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

Step queue write idempotency - #776

Merged
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54
Jan 13, 2026
Merged

Step queue write idempotency#776
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54

Conversation

@Timer

Copy link
Copy Markdown
Contributor

Description

Fixes a race condition where a workflow step could get stuck in a "pending" state indefinitely.

Previously, if a process crashed after creating a step in the database but before queuing it for execution, subsequent retries would encounter a 409 conflict (step already exists) and skip the queue write. This left the step pending with 0 attempts.

The fix ensures that the step is always written to the execution queue, even if it already exists in the database. The queue write uses an idempotency key (correlationId), so duplicate queue messages are safely handled by the queue service. Detailed comments have been added to explain this critical behavior.

How did you test your changes?

  • Built the @workflow/core package locally.
  • Ran all 219 tests for the @workflow/core package, which passed successfully.
  • Verified linting and typechecking for the @workflow/core package.

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
    • During beta, we only use "patch" mode for changes. Don't tag minor/major versions.
    • Use pnpm changeset --empty if you are changing documentation or workbench apps
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)

Slack Thread

Open in CursorOpen in Web

This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
@cursor

cursorBot commented Jan 13, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel

vercelBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentReviewUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-astro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-express-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-fastify-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-hono-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nitro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nuxt-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-sveltekit-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-vite-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
1 Skipped Deployment
ProjectDeploymentReviewUpdated (UTC)
workflow-docsSkippedSkippedJan 13, 2026 9:32pm

@changeset-bot

changeset-botBot commented Jan 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 967c489

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

This PR includes changesets to release 13 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/docs-typecheckPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@workflow/world-testingPatch
@workflow/nuxtPatch
@workflow/aiPatch

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

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

@github-actions

github-actionsBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production374011385
✅ 💻 Local Development34208350
✅ 📦 Local Production34208350
✅ 🐘 Local Postgres34208350
✅ 🪟 Windows350035
❌ 🌍 Community Worlds136160152
Total157116351622

❌ Failed Tests

🌍 Community Worlds (16 failed)

mongodb (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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 catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3401
✅ example3401
✅ express3401
✅ fastify3401
✅ hono3401
✅ nextjs-turbopack3401
✅ nextjs-webpack3401
✅ nitro3401
✅ nuxt3401
✅ sveltekit3401
✅ vite3401
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack3500
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3410
✅ redis-dev300
✅ redis3500
✅ starter-dev300
❌ starter21140
✅ turso-dev300
❌ turso3410

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 13, 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
🌐 Starter🥇 Next.js (Turbopack)0.037s (-6.7% 🟢)1.014s (~)0.976s101.00x
💻 LocalNext.js (Turbopack)0.038s (-1.3%)1.014s (~)0.975s101.02x
🌐 RedisNext.js (Turbopack)0.045s (+27.3% 🔺)1.020s (~)0.975s101.19x
💻 LocalNitro0.045s (+41.5% 🔺)1.006s (~)0.961s101.20x
💻 LocalExpress0.045s (+5.8% 🔺)1.007s (~)0.962s101.21x
🌐 MongoDBNext.js (Turbopack)0.084s (+84.0% 🔺)1.015s (~)0.931s102.24x
🌐 TursoNext.js (Turbopack)0.110s (+4.9%)1.013s (~)0.903s102.93x
🐘 PostgresNext.js (Turbopack)0.247s (-5.9% 🟢)1.021s (~)0.774s106.59x
🐘 PostgresNitro0.261s (+11.0% 🔺)1.013s (-1.3%)0.752s106.96x
🐘 PostgresExpress0.268s (-7.8% 🟢)1.035s (+1.5%)0.767s107.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.571s (-1.7%)1.505s (+2.0%)0.934s101.00x
▲ VercelNitro0.643s (+3.6%)1.602s (+12.2% 🔺)0.959s101.13x
▲ VercelNext.js (Turbopack)0.711s (-10.1% 🟢)1.573s (-7.2% 🟢)0.863s101.25x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (~)2.011s (~)0.919s101.00x
💻 LocalNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.01x
🌐 RedisNext.js (Turbopack)1.103s (+2.3%)2.013s (~)0.910s101.01x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
💻 LocalNitro1.114s (+3.2%)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.311s (+1.1%)2.015s (~)0.703s101.20x
🌐 TursoNext.js (Turbopack)1.320s (+1.6%)2.012s (~)0.692s101.21x
🐘 PostgresNext.js (Turbopack)1.708s (-8.8% 🟢)2.018s (~)0.309s101.56x
🐘 PostgresNitro2.199s (-9.0% 🟢)3.016s (~)0.817s102.01x
🐘 PostgresExpress2.456s (+15.6% 🔺)3.014s (~)0.558s102.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.832s (+6.2% 🔺)3.800s (+3.0%)0.968s101.00x
▲ VercelNext.js (Turbopack)2.905s (+3.9%)3.699s (-0.9%)0.794s101.03x
▲ VercelExpress2.968s (+3.3%)3.716s (-2.0%)0.748s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.601s (~)11.012s (~)0.411s51.00x
💻 LocalNext.js (Turbopack)10.666s (~)11.018s (~)0.352s51.01x
🌐 RedisNext.js (Turbopack)10.704s (+1.3%)11.020s (~)0.315s51.01x
💻 LocalExpress10.799s (~)11.014s (~)0.215s51.02x
💻 LocalNitro10.818s (+2.6%)11.012s (~)0.194s51.02x
🌐 TursoNext.js (Turbopack)12.213s (~)13.021s (~)0.808s51.15x
🌐 MongoDBNext.js (Turbopack)12.239s (+2.6%)13.027s (+8.3% 🔺)0.787s51.15x
🐘 PostgresNext.js (Turbopack)15.388s (+3.4%)16.041s (+2.6%)0.653s51.45x
🐘 PostgresExpress20.294s (-1.0%)21.040s (~)0.745s51.91x
🐘 PostgresNitro20.462s (~)21.030s (~)0.568s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.886s (+6.8% 🔺)24.788s (+7.6% 🔺)0.902s51.00x
▲ VercelNitro24.184s (+5.1% 🔺)24.858s (+5.2% 🔺)0.673s51.01x
▲ VercelExpress24.366s (+6.3% 🔺)25.109s (+6.0% 🔺)0.743s51.02x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.352s (~)2.008s (~)0.656s151.00x
🌐 RedisNext.js (Turbopack)1.369s (+3.4%)2.011s (~)0.643s151.01x
💻 LocalNext.js (Turbopack)1.387s (~)2.011s (~)0.625s151.03x
💻 LocalExpress1.402s (~)2.006s (~)0.604s151.04x
💻 LocalNitro1.427s (+5.4% 🔺)2.006s (~)0.579s151.06x
🐘 PostgresNext.js (Turbopack)1.935s (+12.4% 🔺)2.167s (+7.7% 🔺)0.232s141.43x
🌐 MongoDBNext.js (Turbopack)2.145s (+0.8%)3.011s (~)0.866s101.59x
🌐 TursoNext.js (Turbopack)2.211s (~)3.013s (~)0.803s101.63x
🐘 PostgresNitro2.370s (-10.0% 🟢)3.012s (~)0.643s101.75x
🐘 PostgresExpress2.616s (+7.6% 🔺)3.016s (~)0.401s101.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.812s (-15.7% 🟢)3.800s (-5.2% 🟢)0.988s81.00x
▲ VercelExpress3.034s (+9.2% 🔺)3.776s (+1.2%)0.742s81.08x
▲ VercelNext.js (Turbopack)3.055s (+5.2% 🔺)3.838s (+3.3%)0.782s81.09x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.121s (~)3.009s (~)0.888s101.00x
💻 LocalExpress2.207s (~)3.164s (~)0.957s101.04x
💻 LocalNitro2.258s (+12.8% 🔺)3.208s (+33.5% 🔺)0.950s101.06x
🌐 StarterNext.js (Turbopack)2.467s (~)3.009s (~)0.542s101.16x
🌐 RedisNext.js (Turbopack)2.517s (+6.3% 🔺)3.020s (~)0.503s101.19x
🐘 PostgresNext.js (Turbopack)2.647s (+7.6% 🔺)3.018s (~)0.372s101.25x
🐘 PostgresExpress2.963s (-2.6%)3.013s (-15.7% 🟢)0.050s101.40x
🐘 PostgresNitro3.079s (+4.5%)3.696s (+18.6% 🔺)0.617s91.45x
🌐 TursoNext.js (Turbopack)4.661s (-1.8%)5.187s (~)0.526s62.20x
🌐 MongoDBNext.js (Turbopack)4.715s (+0.7%)5.182s (~)0.467s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.515s (+8.1% 🔺)4.047s (+12.9% 🔺)0.532s81.00x
▲ VercelExpress3.660s (+11.1% 🔺)4.628s (+19.4% 🔺)0.967s71.04x
▲ VercelNext.js (Turbopack)3.753s (-6.5% 🟢)4.655s (+1.1%)0.902s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.376s (-0.7%)2.008s (~)0.632s151.00x
💻 LocalNext.js (Turbopack)1.378s (-1.3%)2.011s (~)0.634s151.00x
🌐 RedisNext.js (Turbopack)1.396s (+4.1%)2.010s (~)0.614s151.01x
💻 LocalExpress1.439s (+1.3%)2.005s (~)0.566s151.05x
💻 LocalNitro1.447s (+8.7% 🔺)2.005s (~)0.558s151.05x
🐘 PostgresNext.js (Turbopack)1.648s (-0.9%)2.014s (~)0.366s151.20x
🐘 PostgresExpress1.713s (-17.8% 🟢)2.012s (-16.2% 🟢)0.299s151.24x
🐘 PostgresNitro1.937s (+13.6% 🔺)2.010s (~)0.073s151.41x
🌐 MongoDBNext.js (Turbopack)2.156s (+1.9%)3.011s (~)0.856s101.57x
🌐 TursoNext.js (Turbopack)2.225s (-0.6%)3.014s (~)0.789s101.62x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.938s (+4.0%)3.791s (+1.6%)0.854s81.00x
▲ VercelNitro2.982s (+3.8%)3.908s (+8.9% 🔺)0.925s81.02x
▲ VercelNext.js (Turbopack)3.188s (+8.4% 🔺)3.784s (+0.8%)0.596s81.09x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.153s (-0.7%)3.115s (+1.2%)0.962s101.00x
💻 LocalNitro2.282s (+9.2% 🔺)3.213s (+16.8% 🔺)0.931s101.06x
💻 LocalExpress2.330s (+1.5%)3.236s (~)0.905s101.08x
🌐 StarterNext.js (Turbopack)2.466s (~)3.013s (~)0.547s101.15x
🌐 RedisNext.js (Turbopack)2.523s (+6.6% 🔺)3.019s (~)0.496s101.17x
🐘 PostgresNitro2.695s (~)3.011s (~)0.316s101.25x
🐘 PostgresNext.js (Turbopack)2.704s (+10.1% 🔺)3.025s (~)0.320s101.26x
🐘 PostgresExpress2.955s (+2.2%)3.227s (+3.7%)0.272s101.37x
🌐 MongoDBNext.js (Turbopack)4.652s (-1.3%)5.180s (~)0.528s62.16x
🌐 TursoNext.js (Turbopack)4.706s (-2.1%)5.187s (~)0.480s62.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.332s (+2.7%)3.792s (~)0.460s81.00x
▲ VercelExpress3.333s (+3.2%)3.912s (+4.3%)0.579s81.00x
▲ VercelNext.js (Turbopack)3.715s (+11.3% 🔺)4.333s (+7.7% 🔺)0.617s81.12x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.128s (-1.5%)1.006s (~)0.000s (NaN%)1.011s (~)0.883s101.00x
💻 LocalNext.js (Turbopack)0.137s (-1.1%)1.004s (~)0.015s (-4.9%)1.027s (~)0.890s101.06x
🌐 RedisNext.js (Turbopack)0.153s (+33.9% 🔺)1.005s (~)0.000s (+Infinity% 🔺)1.015s (~)0.862s101.19x
💻 LocalExpress0.176s (+1.0%)0.992s (~)0.015s (+6.2% 🔺)1.022s (~)0.846s101.37x
💻 LocalNitro0.181s (+48.6% 🔺)0.992s (-0.6%)0.016s (-2.5%)1.021s (~)0.840s101.41x
🌐 TursoNext.js (Turbopack)0.465s (-8.7% 🟢)0.986s (+3.4%)0.000s (-50.0% 🟢)1.013s (~)0.548s103.62x
🌐 MongoDBNext.js (Turbopack)0.500s (+1.3%)0.950s (~)0.000s (-100.0% 🟢)1.013s (~)0.513s103.89x
🐘 PostgresNext.js (Turbopack)0.734s (-42.5% 🟢)0.885s (-42.9% 🟢)0.000s (+200.0% 🔺)1.017s (-44.1% 🟢)0.283s105.71x
🐘 PostgresExpress2.186s (-6.1% 🟢)2.860s (+5.4% 🔺)0.000s (NaN%)3.015s (~)0.829s1017.03x
🐘 PostgresNitro2.289s (+9.6% 🔺)2.753s (-1.8%)0.000s (+100.0% 🔺)3.013s (+3.4%)0.724s1017.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.009s (+1.7%)3.285s (+5.2% 🔺)0.753s (+11.7% 🔺)4.527s (+6.7% 🔺)1.518s101.00x
▲ VercelExpress3.050s (+5.0% 🔺)3.269s (+2.6%)0.893s (+79.4% 🔺)4.719s (+13.8% 🔺)1.670s101.01x
▲ VercelNext.js (Turbopack)3.056s (+2.8%)3.238s (-2.2%)0.886s (+75.7% 🔺)4.629s (+7.7% 🔺)1.574s101.02x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNitro5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Comment on lines -119 to -127
waitUntil(
Promise.all(ops).catch((opErr) => {
// Ignore expected client disconnect errors (e.g., browser refresh during streaming)
const isAbortError =
opErr?.name === 'AbortError' || opErr?.name === 'ResponseAborted';
if (!isAbortError) throw opErr;
})
);

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.

we can't remove this

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.

will simplify this after event sourcing ( #621 ) but need to keep it in for now

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.

hmm wait maybe Cursor is right and this is dead code since e2e tests are passing

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

lgtm

@TooTallNate
TooTallNate merged commit 49f650c into mainJan 13, 2026
98 checks passed
@TooTallNate
TooTallNate deleted the cursor/step-queue-write-idempotency-ee54 branch January 13, 2026 22:00
VaguelySerious pushed a commit that referenced this pull request Jan 16, 2026
* fix(core): always write step to queue even if step already exists
This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
* chore: add changeset for step queue idempotency fix
* chore(core): remove dead ops array code from processStep
The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
* DCO Remediation Commit for Cursor Agent <cursoragent@cursor.com>
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
---------
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Timer@TooTallNate@pranaygp@cursoragent
, '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

Step queue write idempotency - #776

Merged
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54
Jan 13, 2026
Merged

Step queue write idempotency#776
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54

Conversation

@Timer

Copy link
Copy Markdown
Contributor

Description

Fixes a race condition where a workflow step could get stuck in a "pending" state indefinitely.

Previously, if a process crashed after creating a step in the database but before queuing it for execution, subsequent retries would encounter a 409 conflict (step already exists) and skip the queue write. This left the step pending with 0 attempts.

The fix ensures that the step is always written to the execution queue, even if it already exists in the database. The queue write uses an idempotency key (correlationId), so duplicate queue messages are safely handled by the queue service. Detailed comments have been added to explain this critical behavior.

How did you test your changes?

  • Built the @workflow/core package locally.
  • Ran all 219 tests for the @workflow/core package, which passed successfully.
  • Verified linting and typechecking for the @workflow/core package.

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
    • During beta, we only use "patch" mode for changes. Don't tag minor/major versions.
    • Use pnpm changeset --empty if you are changing documentation or workbench apps
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)

Slack Thread

Open in CursorOpen in Web

This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
@cursor

cursorBot commented Jan 13, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel

vercelBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentReviewUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-astro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-express-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-fastify-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-hono-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nitro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nuxt-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-sveltekit-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-vite-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
1 Skipped Deployment
ProjectDeploymentReviewUpdated (UTC)
workflow-docsSkippedSkippedJan 13, 2026 9:32pm

@changeset-bot

changeset-botBot commented Jan 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 967c489

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

This PR includes changesets to release 13 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/docs-typecheckPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@workflow/world-testingPatch
@workflow/nuxtPatch
@workflow/aiPatch

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

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

@github-actions

github-actionsBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production374011385
✅ 💻 Local Development34208350
✅ 📦 Local Production34208350
✅ 🐘 Local Postgres34208350
✅ 🪟 Windows350035
❌ 🌍 Community Worlds136160152
Total157116351622

❌ Failed Tests

🌍 Community Worlds (16 failed)

mongodb (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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 catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3401
✅ example3401
✅ express3401
✅ fastify3401
✅ hono3401
✅ nextjs-turbopack3401
✅ nextjs-webpack3401
✅ nitro3401
✅ nuxt3401
✅ sveltekit3401
✅ vite3401
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack3500
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3410
✅ redis-dev300
✅ redis3500
✅ starter-dev300
❌ starter21140
✅ turso-dev300
❌ turso3410

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 13, 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
🌐 Starter🥇 Next.js (Turbopack)0.037s (-6.7% 🟢)1.014s (~)0.976s101.00x
💻 LocalNext.js (Turbopack)0.038s (-1.3%)1.014s (~)0.975s101.02x
🌐 RedisNext.js (Turbopack)0.045s (+27.3% 🔺)1.020s (~)0.975s101.19x
💻 LocalNitro0.045s (+41.5% 🔺)1.006s (~)0.961s101.20x
💻 LocalExpress0.045s (+5.8% 🔺)1.007s (~)0.962s101.21x
🌐 MongoDBNext.js (Turbopack)0.084s (+84.0% 🔺)1.015s (~)0.931s102.24x
🌐 TursoNext.js (Turbopack)0.110s (+4.9%)1.013s (~)0.903s102.93x
🐘 PostgresNext.js (Turbopack)0.247s (-5.9% 🟢)1.021s (~)0.774s106.59x
🐘 PostgresNitro0.261s (+11.0% 🔺)1.013s (-1.3%)0.752s106.96x
🐘 PostgresExpress0.268s (-7.8% 🟢)1.035s (+1.5%)0.767s107.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.571s (-1.7%)1.505s (+2.0%)0.934s101.00x
▲ VercelNitro0.643s (+3.6%)1.602s (+12.2% 🔺)0.959s101.13x
▲ VercelNext.js (Turbopack)0.711s (-10.1% 🟢)1.573s (-7.2% 🟢)0.863s101.25x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (~)2.011s (~)0.919s101.00x
💻 LocalNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.01x
🌐 RedisNext.js (Turbopack)1.103s (+2.3%)2.013s (~)0.910s101.01x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
💻 LocalNitro1.114s (+3.2%)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.311s (+1.1%)2.015s (~)0.703s101.20x
🌐 TursoNext.js (Turbopack)1.320s (+1.6%)2.012s (~)0.692s101.21x
🐘 PostgresNext.js (Turbopack)1.708s (-8.8% 🟢)2.018s (~)0.309s101.56x
🐘 PostgresNitro2.199s (-9.0% 🟢)3.016s (~)0.817s102.01x
🐘 PostgresExpress2.456s (+15.6% 🔺)3.014s (~)0.558s102.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.832s (+6.2% 🔺)3.800s (+3.0%)0.968s101.00x
▲ VercelNext.js (Turbopack)2.905s (+3.9%)3.699s (-0.9%)0.794s101.03x
▲ VercelExpress2.968s (+3.3%)3.716s (-2.0%)0.748s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.601s (~)11.012s (~)0.411s51.00x
💻 LocalNext.js (Turbopack)10.666s (~)11.018s (~)0.352s51.01x
🌐 RedisNext.js (Turbopack)10.704s (+1.3%)11.020s (~)0.315s51.01x
💻 LocalExpress10.799s (~)11.014s (~)0.215s51.02x
💻 LocalNitro10.818s (+2.6%)11.012s (~)0.194s51.02x
🌐 TursoNext.js (Turbopack)12.213s (~)13.021s (~)0.808s51.15x
🌐 MongoDBNext.js (Turbopack)12.239s (+2.6%)13.027s (+8.3% 🔺)0.787s51.15x
🐘 PostgresNext.js (Turbopack)15.388s (+3.4%)16.041s (+2.6%)0.653s51.45x
🐘 PostgresExpress20.294s (-1.0%)21.040s (~)0.745s51.91x
🐘 PostgresNitro20.462s (~)21.030s (~)0.568s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.886s (+6.8% 🔺)24.788s (+7.6% 🔺)0.902s51.00x
▲ VercelNitro24.184s (+5.1% 🔺)24.858s (+5.2% 🔺)0.673s51.01x
▲ VercelExpress24.366s (+6.3% 🔺)25.109s (+6.0% 🔺)0.743s51.02x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.352s (~)2.008s (~)0.656s151.00x
🌐 RedisNext.js (Turbopack)1.369s (+3.4%)2.011s (~)0.643s151.01x
💻 LocalNext.js (Turbopack)1.387s (~)2.011s (~)0.625s151.03x
💻 LocalExpress1.402s (~)2.006s (~)0.604s151.04x
💻 LocalNitro1.427s (+5.4% 🔺)2.006s (~)0.579s151.06x
🐘 PostgresNext.js (Turbopack)1.935s (+12.4% 🔺)2.167s (+7.7% 🔺)0.232s141.43x
🌐 MongoDBNext.js (Turbopack)2.145s (+0.8%)3.011s (~)0.866s101.59x
🌐 TursoNext.js (Turbopack)2.211s (~)3.013s (~)0.803s101.63x
🐘 PostgresNitro2.370s (-10.0% 🟢)3.012s (~)0.643s101.75x
🐘 PostgresExpress2.616s (+7.6% 🔺)3.016s (~)0.401s101.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.812s (-15.7% 🟢)3.800s (-5.2% 🟢)0.988s81.00x
▲ VercelExpress3.034s (+9.2% 🔺)3.776s (+1.2%)0.742s81.08x
▲ VercelNext.js (Turbopack)3.055s (+5.2% 🔺)3.838s (+3.3%)0.782s81.09x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.121s (~)3.009s (~)0.888s101.00x
💻 LocalExpress2.207s (~)3.164s (~)0.957s101.04x
💻 LocalNitro2.258s (+12.8% 🔺)3.208s (+33.5% 🔺)0.950s101.06x
🌐 StarterNext.js (Turbopack)2.467s (~)3.009s (~)0.542s101.16x
🌐 RedisNext.js (Turbopack)2.517s (+6.3% 🔺)3.020s (~)0.503s101.19x
🐘 PostgresNext.js (Turbopack)2.647s (+7.6% 🔺)3.018s (~)0.372s101.25x
🐘 PostgresExpress2.963s (-2.6%)3.013s (-15.7% 🟢)0.050s101.40x
🐘 PostgresNitro3.079s (+4.5%)3.696s (+18.6% 🔺)0.617s91.45x
🌐 TursoNext.js (Turbopack)4.661s (-1.8%)5.187s (~)0.526s62.20x
🌐 MongoDBNext.js (Turbopack)4.715s (+0.7%)5.182s (~)0.467s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.515s (+8.1% 🔺)4.047s (+12.9% 🔺)0.532s81.00x
▲ VercelExpress3.660s (+11.1% 🔺)4.628s (+19.4% 🔺)0.967s71.04x
▲ VercelNext.js (Turbopack)3.753s (-6.5% 🟢)4.655s (+1.1%)0.902s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.376s (-0.7%)2.008s (~)0.632s151.00x
💻 LocalNext.js (Turbopack)1.378s (-1.3%)2.011s (~)0.634s151.00x
🌐 RedisNext.js (Turbopack)1.396s (+4.1%)2.010s (~)0.614s151.01x
💻 LocalExpress1.439s (+1.3%)2.005s (~)0.566s151.05x
💻 LocalNitro1.447s (+8.7% 🔺)2.005s (~)0.558s151.05x
🐘 PostgresNext.js (Turbopack)1.648s (-0.9%)2.014s (~)0.366s151.20x
🐘 PostgresExpress1.713s (-17.8% 🟢)2.012s (-16.2% 🟢)0.299s151.24x
🐘 PostgresNitro1.937s (+13.6% 🔺)2.010s (~)0.073s151.41x
🌐 MongoDBNext.js (Turbopack)2.156s (+1.9%)3.011s (~)0.856s101.57x
🌐 TursoNext.js (Turbopack)2.225s (-0.6%)3.014s (~)0.789s101.62x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.938s (+4.0%)3.791s (+1.6%)0.854s81.00x
▲ VercelNitro2.982s (+3.8%)3.908s (+8.9% 🔺)0.925s81.02x
▲ VercelNext.js (Turbopack)3.188s (+8.4% 🔺)3.784s (+0.8%)0.596s81.09x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.153s (-0.7%)3.115s (+1.2%)0.962s101.00x
💻 LocalNitro2.282s (+9.2% 🔺)3.213s (+16.8% 🔺)0.931s101.06x
💻 LocalExpress2.330s (+1.5%)3.236s (~)0.905s101.08x
🌐 StarterNext.js (Turbopack)2.466s (~)3.013s (~)0.547s101.15x
🌐 RedisNext.js (Turbopack)2.523s (+6.6% 🔺)3.019s (~)0.496s101.17x
🐘 PostgresNitro2.695s (~)3.011s (~)0.316s101.25x
🐘 PostgresNext.js (Turbopack)2.704s (+10.1% 🔺)3.025s (~)0.320s101.26x
🐘 PostgresExpress2.955s (+2.2%)3.227s (+3.7%)0.272s101.37x
🌐 MongoDBNext.js (Turbopack)4.652s (-1.3%)5.180s (~)0.528s62.16x
🌐 TursoNext.js (Turbopack)4.706s (-2.1%)5.187s (~)0.480s62.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.332s (+2.7%)3.792s (~)0.460s81.00x
▲ VercelExpress3.333s (+3.2%)3.912s (+4.3%)0.579s81.00x
▲ VercelNext.js (Turbopack)3.715s (+11.3% 🔺)4.333s (+7.7% 🔺)0.617s81.12x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.128s (-1.5%)1.006s (~)0.000s (NaN%)1.011s (~)0.883s101.00x
💻 LocalNext.js (Turbopack)0.137s (-1.1%)1.004s (~)0.015s (-4.9%)1.027s (~)0.890s101.06x
🌐 RedisNext.js (Turbopack)0.153s (+33.9% 🔺)1.005s (~)0.000s (+Infinity% 🔺)1.015s (~)0.862s101.19x
💻 LocalExpress0.176s (+1.0%)0.992s (~)0.015s (+6.2% 🔺)1.022s (~)0.846s101.37x
💻 LocalNitro0.181s (+48.6% 🔺)0.992s (-0.6%)0.016s (-2.5%)1.021s (~)0.840s101.41x
🌐 TursoNext.js (Turbopack)0.465s (-8.7% 🟢)0.986s (+3.4%)0.000s (-50.0% 🟢)1.013s (~)0.548s103.62x
🌐 MongoDBNext.js (Turbopack)0.500s (+1.3%)0.950s (~)0.000s (-100.0% 🟢)1.013s (~)0.513s103.89x
🐘 PostgresNext.js (Turbopack)0.734s (-42.5% 🟢)0.885s (-42.9% 🟢)0.000s (+200.0% 🔺)1.017s (-44.1% 🟢)0.283s105.71x
🐘 PostgresExpress2.186s (-6.1% 🟢)2.860s (+5.4% 🔺)0.000s (NaN%)3.015s (~)0.829s1017.03x
🐘 PostgresNitro2.289s (+9.6% 🔺)2.753s (-1.8%)0.000s (+100.0% 🔺)3.013s (+3.4%)0.724s1017.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.009s (+1.7%)3.285s (+5.2% 🔺)0.753s (+11.7% 🔺)4.527s (+6.7% 🔺)1.518s101.00x
▲ VercelExpress3.050s (+5.0% 🔺)3.269s (+2.6%)0.893s (+79.4% 🔺)4.719s (+13.8% 🔺)1.670s101.01x
▲ VercelNext.js (Turbopack)3.056s (+2.8%)3.238s (-2.2%)0.886s (+75.7% 🔺)4.629s (+7.7% 🔺)1.574s101.02x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNitro5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Comment on lines -119 to -127
waitUntil(
Promise.all(ops).catch((opErr) => {
// Ignore expected client disconnect errors (e.g., browser refresh during streaming)
const isAbortError =
opErr?.name === 'AbortError' || opErr?.name === 'ResponseAborted';
if (!isAbortError) throw opErr;
})
);

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.

we can't remove this

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.

will simplify this after event sourcing ( #621 ) but need to keep it in for now

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.

hmm wait maybe Cursor is right and this is dead code since e2e tests are passing

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

lgtm

@TooTallNate
TooTallNate merged commit 49f650c into mainJan 13, 2026
98 checks passed
@TooTallNate
TooTallNate deleted the cursor/step-queue-write-idempotency-ee54 branch January 13, 2026 22:00
VaguelySerious pushed a commit that referenced this pull request Jan 16, 2026
* fix(core): always write step to queue even if step already exists
This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
* chore: add changeset for step queue idempotency fix
* chore(core): remove dead ops array code from processStep
The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
* DCO Remediation Commit for Cursor Agent <cursoragent@cursor.com>
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
---------
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Timer@TooTallNate@pranaygp@cursoragent
, '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

Step queue write idempotency - #776

Merged
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54
Jan 13, 2026
Merged

Step queue write idempotency#776
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54

Conversation

@Timer

Copy link
Copy Markdown
Contributor

Description

Fixes a race condition where a workflow step could get stuck in a "pending" state indefinitely.

Previously, if a process crashed after creating a step in the database but before queuing it for execution, subsequent retries would encounter a 409 conflict (step already exists) and skip the queue write. This left the step pending with 0 attempts.

The fix ensures that the step is always written to the execution queue, even if it already exists in the database. The queue write uses an idempotency key (correlationId), so duplicate queue messages are safely handled by the queue service. Detailed comments have been added to explain this critical behavior.

How did you test your changes?

  • Built the @workflow/core package locally.
  • Ran all 219 tests for the @workflow/core package, which passed successfully.
  • Verified linting and typechecking for the @workflow/core package.

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
    • During beta, we only use "patch" mode for changes. Don't tag minor/major versions.
    • Use pnpm changeset --empty if you are changing documentation or workbench apps
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)

Slack Thread

Open in CursorOpen in Web

This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
@cursor

cursorBot commented Jan 13, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel

vercelBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentReviewUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-astro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-express-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-fastify-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-hono-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nitro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nuxt-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-sveltekit-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-vite-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
1 Skipped Deployment
ProjectDeploymentReviewUpdated (UTC)
workflow-docsSkippedSkippedJan 13, 2026 9:32pm

@changeset-bot

changeset-botBot commented Jan 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 967c489

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

This PR includes changesets to release 13 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/docs-typecheckPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@workflow/world-testingPatch
@workflow/nuxtPatch
@workflow/aiPatch

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

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

@github-actions

github-actionsBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production374011385
✅ 💻 Local Development34208350
✅ 📦 Local Production34208350
✅ 🐘 Local Postgres34208350
✅ 🪟 Windows350035
❌ 🌍 Community Worlds136160152
Total157116351622

❌ Failed Tests

🌍 Community Worlds (16 failed)

mongodb (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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 catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3401
✅ example3401
✅ express3401
✅ fastify3401
✅ hono3401
✅ nextjs-turbopack3401
✅ nextjs-webpack3401
✅ nitro3401
✅ nuxt3401
✅ sveltekit3401
✅ vite3401
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack3500
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3410
✅ redis-dev300
✅ redis3500
✅ starter-dev300
❌ starter21140
✅ turso-dev300
❌ turso3410

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 13, 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
🌐 Starter🥇 Next.js (Turbopack)0.037s (-6.7% 🟢)1.014s (~)0.976s101.00x
💻 LocalNext.js (Turbopack)0.038s (-1.3%)1.014s (~)0.975s101.02x
🌐 RedisNext.js (Turbopack)0.045s (+27.3% 🔺)1.020s (~)0.975s101.19x
💻 LocalNitro0.045s (+41.5% 🔺)1.006s (~)0.961s101.20x
💻 LocalExpress0.045s (+5.8% 🔺)1.007s (~)0.962s101.21x
🌐 MongoDBNext.js (Turbopack)0.084s (+84.0% 🔺)1.015s (~)0.931s102.24x
🌐 TursoNext.js (Turbopack)0.110s (+4.9%)1.013s (~)0.903s102.93x
🐘 PostgresNext.js (Turbopack)0.247s (-5.9% 🟢)1.021s (~)0.774s106.59x
🐘 PostgresNitro0.261s (+11.0% 🔺)1.013s (-1.3%)0.752s106.96x
🐘 PostgresExpress0.268s (-7.8% 🟢)1.035s (+1.5%)0.767s107.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.571s (-1.7%)1.505s (+2.0%)0.934s101.00x
▲ VercelNitro0.643s (+3.6%)1.602s (+12.2% 🔺)0.959s101.13x
▲ VercelNext.js (Turbopack)0.711s (-10.1% 🟢)1.573s (-7.2% 🟢)0.863s101.25x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (~)2.011s (~)0.919s101.00x
💻 LocalNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.01x
🌐 RedisNext.js (Turbopack)1.103s (+2.3%)2.013s (~)0.910s101.01x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
💻 LocalNitro1.114s (+3.2%)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.311s (+1.1%)2.015s (~)0.703s101.20x
🌐 TursoNext.js (Turbopack)1.320s (+1.6%)2.012s (~)0.692s101.21x
🐘 PostgresNext.js (Turbopack)1.708s (-8.8% 🟢)2.018s (~)0.309s101.56x
🐘 PostgresNitro2.199s (-9.0% 🟢)3.016s (~)0.817s102.01x
🐘 PostgresExpress2.456s (+15.6% 🔺)3.014s (~)0.558s102.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.832s (+6.2% 🔺)3.800s (+3.0%)0.968s101.00x
▲ VercelNext.js (Turbopack)2.905s (+3.9%)3.699s (-0.9%)0.794s101.03x
▲ VercelExpress2.968s (+3.3%)3.716s (-2.0%)0.748s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.601s (~)11.012s (~)0.411s51.00x
💻 LocalNext.js (Turbopack)10.666s (~)11.018s (~)0.352s51.01x
🌐 RedisNext.js (Turbopack)10.704s (+1.3%)11.020s (~)0.315s51.01x
💻 LocalExpress10.799s (~)11.014s (~)0.215s51.02x
💻 LocalNitro10.818s (+2.6%)11.012s (~)0.194s51.02x
🌐 TursoNext.js (Turbopack)12.213s (~)13.021s (~)0.808s51.15x
🌐 MongoDBNext.js (Turbopack)12.239s (+2.6%)13.027s (+8.3% 🔺)0.787s51.15x
🐘 PostgresNext.js (Turbopack)15.388s (+3.4%)16.041s (+2.6%)0.653s51.45x
🐘 PostgresExpress20.294s (-1.0%)21.040s (~)0.745s51.91x
🐘 PostgresNitro20.462s (~)21.030s (~)0.568s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.886s (+6.8% 🔺)24.788s (+7.6% 🔺)0.902s51.00x
▲ VercelNitro24.184s (+5.1% 🔺)24.858s (+5.2% 🔺)0.673s51.01x
▲ VercelExpress24.366s (+6.3% 🔺)25.109s (+6.0% 🔺)0.743s51.02x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.352s (~)2.008s (~)0.656s151.00x
🌐 RedisNext.js (Turbopack)1.369s (+3.4%)2.011s (~)0.643s151.01x
💻 LocalNext.js (Turbopack)1.387s (~)2.011s (~)0.625s151.03x
💻 LocalExpress1.402s (~)2.006s (~)0.604s151.04x
💻 LocalNitro1.427s (+5.4% 🔺)2.006s (~)0.579s151.06x
🐘 PostgresNext.js (Turbopack)1.935s (+12.4% 🔺)2.167s (+7.7% 🔺)0.232s141.43x
🌐 MongoDBNext.js (Turbopack)2.145s (+0.8%)3.011s (~)0.866s101.59x
🌐 TursoNext.js (Turbopack)2.211s (~)3.013s (~)0.803s101.63x
🐘 PostgresNitro2.370s (-10.0% 🟢)3.012s (~)0.643s101.75x
🐘 PostgresExpress2.616s (+7.6% 🔺)3.016s (~)0.401s101.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.812s (-15.7% 🟢)3.800s (-5.2% 🟢)0.988s81.00x
▲ VercelExpress3.034s (+9.2% 🔺)3.776s (+1.2%)0.742s81.08x
▲ VercelNext.js (Turbopack)3.055s (+5.2% 🔺)3.838s (+3.3%)0.782s81.09x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.121s (~)3.009s (~)0.888s101.00x
💻 LocalExpress2.207s (~)3.164s (~)0.957s101.04x
💻 LocalNitro2.258s (+12.8% 🔺)3.208s (+33.5% 🔺)0.950s101.06x
🌐 StarterNext.js (Turbopack)2.467s (~)3.009s (~)0.542s101.16x
🌐 RedisNext.js (Turbopack)2.517s (+6.3% 🔺)3.020s (~)0.503s101.19x
🐘 PostgresNext.js (Turbopack)2.647s (+7.6% 🔺)3.018s (~)0.372s101.25x
🐘 PostgresExpress2.963s (-2.6%)3.013s (-15.7% 🟢)0.050s101.40x
🐘 PostgresNitro3.079s (+4.5%)3.696s (+18.6% 🔺)0.617s91.45x
🌐 TursoNext.js (Turbopack)4.661s (-1.8%)5.187s (~)0.526s62.20x
🌐 MongoDBNext.js (Turbopack)4.715s (+0.7%)5.182s (~)0.467s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.515s (+8.1% 🔺)4.047s (+12.9% 🔺)0.532s81.00x
▲ VercelExpress3.660s (+11.1% 🔺)4.628s (+19.4% 🔺)0.967s71.04x
▲ VercelNext.js (Turbopack)3.753s (-6.5% 🟢)4.655s (+1.1%)0.902s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.376s (-0.7%)2.008s (~)0.632s151.00x
💻 LocalNext.js (Turbopack)1.378s (-1.3%)2.011s (~)0.634s151.00x
🌐 RedisNext.js (Turbopack)1.396s (+4.1%)2.010s (~)0.614s151.01x
💻 LocalExpress1.439s (+1.3%)2.005s (~)0.566s151.05x
💻 LocalNitro1.447s (+8.7% 🔺)2.005s (~)0.558s151.05x
🐘 PostgresNext.js (Turbopack)1.648s (-0.9%)2.014s (~)0.366s151.20x
🐘 PostgresExpress1.713s (-17.8% 🟢)2.012s (-16.2% 🟢)0.299s151.24x
🐘 PostgresNitro1.937s (+13.6% 🔺)2.010s (~)0.073s151.41x
🌐 MongoDBNext.js (Turbopack)2.156s (+1.9%)3.011s (~)0.856s101.57x
🌐 TursoNext.js (Turbopack)2.225s (-0.6%)3.014s (~)0.789s101.62x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.938s (+4.0%)3.791s (+1.6%)0.854s81.00x
▲ VercelNitro2.982s (+3.8%)3.908s (+8.9% 🔺)0.925s81.02x
▲ VercelNext.js (Turbopack)3.188s (+8.4% 🔺)3.784s (+0.8%)0.596s81.09x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.153s (-0.7%)3.115s (+1.2%)0.962s101.00x
💻 LocalNitro2.282s (+9.2% 🔺)3.213s (+16.8% 🔺)0.931s101.06x
💻 LocalExpress2.330s (+1.5%)3.236s (~)0.905s101.08x
🌐 StarterNext.js (Turbopack)2.466s (~)3.013s (~)0.547s101.15x
🌐 RedisNext.js (Turbopack)2.523s (+6.6% 🔺)3.019s (~)0.496s101.17x
🐘 PostgresNitro2.695s (~)3.011s (~)0.316s101.25x
🐘 PostgresNext.js (Turbopack)2.704s (+10.1% 🔺)3.025s (~)0.320s101.26x
🐘 PostgresExpress2.955s (+2.2%)3.227s (+3.7%)0.272s101.37x
🌐 MongoDBNext.js (Turbopack)4.652s (-1.3%)5.180s (~)0.528s62.16x
🌐 TursoNext.js (Turbopack)4.706s (-2.1%)5.187s (~)0.480s62.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.332s (+2.7%)3.792s (~)0.460s81.00x
▲ VercelExpress3.333s (+3.2%)3.912s (+4.3%)0.579s81.00x
▲ VercelNext.js (Turbopack)3.715s (+11.3% 🔺)4.333s (+7.7% 🔺)0.617s81.12x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.128s (-1.5%)1.006s (~)0.000s (NaN%)1.011s (~)0.883s101.00x
💻 LocalNext.js (Turbopack)0.137s (-1.1%)1.004s (~)0.015s (-4.9%)1.027s (~)0.890s101.06x
🌐 RedisNext.js (Turbopack)0.153s (+33.9% 🔺)1.005s (~)0.000s (+Infinity% 🔺)1.015s (~)0.862s101.19x
💻 LocalExpress0.176s (+1.0%)0.992s (~)0.015s (+6.2% 🔺)1.022s (~)0.846s101.37x
💻 LocalNitro0.181s (+48.6% 🔺)0.992s (-0.6%)0.016s (-2.5%)1.021s (~)0.840s101.41x
🌐 TursoNext.js (Turbopack)0.465s (-8.7% 🟢)0.986s (+3.4%)0.000s (-50.0% 🟢)1.013s (~)0.548s103.62x
🌐 MongoDBNext.js (Turbopack)0.500s (+1.3%)0.950s (~)0.000s (-100.0% 🟢)1.013s (~)0.513s103.89x
🐘 PostgresNext.js (Turbopack)0.734s (-42.5% 🟢)0.885s (-42.9% 🟢)0.000s (+200.0% 🔺)1.017s (-44.1% 🟢)0.283s105.71x
🐘 PostgresExpress2.186s (-6.1% 🟢)2.860s (+5.4% 🔺)0.000s (NaN%)3.015s (~)0.829s1017.03x
🐘 PostgresNitro2.289s (+9.6% 🔺)2.753s (-1.8%)0.000s (+100.0% 🔺)3.013s (+3.4%)0.724s1017.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.009s (+1.7%)3.285s (+5.2% 🔺)0.753s (+11.7% 🔺)4.527s (+6.7% 🔺)1.518s101.00x
▲ VercelExpress3.050s (+5.0% 🔺)3.269s (+2.6%)0.893s (+79.4% 🔺)4.719s (+13.8% 🔺)1.670s101.01x
▲ VercelNext.js (Turbopack)3.056s (+2.8%)3.238s (-2.2%)0.886s (+75.7% 🔺)4.629s (+7.7% 🔺)1.574s101.02x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNitro5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Comment on lines -119 to -127
waitUntil(
Promise.all(ops).catch((opErr) => {
// Ignore expected client disconnect errors (e.g., browser refresh during streaming)
const isAbortError =
opErr?.name === 'AbortError' || opErr?.name === 'ResponseAborted';
if (!isAbortError) throw opErr;
})
);

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.

we can't remove this

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.

will simplify this after event sourcing ( #621 ) but need to keep it in for now

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.

hmm wait maybe Cursor is right and this is dead code since e2e tests are passing

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

lgtm

@TooTallNate
TooTallNate merged commit 49f650c into mainJan 13, 2026
98 checks passed
@TooTallNate
TooTallNate deleted the cursor/step-queue-write-idempotency-ee54 branch January 13, 2026 22:00
VaguelySerious pushed a commit that referenced this pull request Jan 16, 2026
* fix(core): always write step to queue even if step already exists
This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
* chore: add changeset for step queue idempotency fix
* chore(core): remove dead ops array code from processStep
The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
* DCO Remediation Commit for Cursor Agent <cursoragent@cursor.com>
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
---------
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Timer@TooTallNate@pranaygp@cursoragent
, '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

Step queue write idempotency - #776

Merged
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54
Jan 13, 2026
Merged

Step queue write idempotency#776
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54

Conversation

@Timer

Copy link
Copy Markdown
Contributor

Description

Fixes a race condition where a workflow step could get stuck in a "pending" state indefinitely.

Previously, if a process crashed after creating a step in the database but before queuing it for execution, subsequent retries would encounter a 409 conflict (step already exists) and skip the queue write. This left the step pending with 0 attempts.

The fix ensures that the step is always written to the execution queue, even if it already exists in the database. The queue write uses an idempotency key (correlationId), so duplicate queue messages are safely handled by the queue service. Detailed comments have been added to explain this critical behavior.

How did you test your changes?

  • Built the @workflow/core package locally.
  • Ran all 219 tests for the @workflow/core package, which passed successfully.
  • Verified linting and typechecking for the @workflow/core package.

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
    • During beta, we only use "patch" mode for changes. Don't tag minor/major versions.
    • Use pnpm changeset --empty if you are changing documentation or workbench apps
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)

Slack Thread

Open in CursorOpen in Web

This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
@cursor

cursorBot commented Jan 13, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel

vercelBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentReviewUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-astro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-express-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-fastify-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-hono-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nitro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nuxt-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-sveltekit-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-vite-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
1 Skipped Deployment
ProjectDeploymentReviewUpdated (UTC)
workflow-docsSkippedSkippedJan 13, 2026 9:32pm

@changeset-bot

changeset-botBot commented Jan 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 967c489

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

This PR includes changesets to release 13 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/docs-typecheckPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@workflow/world-testingPatch
@workflow/nuxtPatch
@workflow/aiPatch

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

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

@github-actions

github-actionsBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production374011385
✅ 💻 Local Development34208350
✅ 📦 Local Production34208350
✅ 🐘 Local Postgres34208350
✅ 🪟 Windows350035
❌ 🌍 Community Worlds136160152
Total157116351622

❌ Failed Tests

🌍 Community Worlds (16 failed)

mongodb (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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 catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3401
✅ example3401
✅ express3401
✅ fastify3401
✅ hono3401
✅ nextjs-turbopack3401
✅ nextjs-webpack3401
✅ nitro3401
✅ nuxt3401
✅ sveltekit3401
✅ vite3401
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack3500
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3410
✅ redis-dev300
✅ redis3500
✅ starter-dev300
❌ starter21140
✅ turso-dev300
❌ turso3410

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 13, 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
🌐 Starter🥇 Next.js (Turbopack)0.037s (-6.7% 🟢)1.014s (~)0.976s101.00x
💻 LocalNext.js (Turbopack)0.038s (-1.3%)1.014s (~)0.975s101.02x
🌐 RedisNext.js (Turbopack)0.045s (+27.3% 🔺)1.020s (~)0.975s101.19x
💻 LocalNitro0.045s (+41.5% 🔺)1.006s (~)0.961s101.20x
💻 LocalExpress0.045s (+5.8% 🔺)1.007s (~)0.962s101.21x
🌐 MongoDBNext.js (Turbopack)0.084s (+84.0% 🔺)1.015s (~)0.931s102.24x
🌐 TursoNext.js (Turbopack)0.110s (+4.9%)1.013s (~)0.903s102.93x
🐘 PostgresNext.js (Turbopack)0.247s (-5.9% 🟢)1.021s (~)0.774s106.59x
🐘 PostgresNitro0.261s (+11.0% 🔺)1.013s (-1.3%)0.752s106.96x
🐘 PostgresExpress0.268s (-7.8% 🟢)1.035s (+1.5%)0.767s107.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.571s (-1.7%)1.505s (+2.0%)0.934s101.00x
▲ VercelNitro0.643s (+3.6%)1.602s (+12.2% 🔺)0.959s101.13x
▲ VercelNext.js (Turbopack)0.711s (-10.1% 🟢)1.573s (-7.2% 🟢)0.863s101.25x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (~)2.011s (~)0.919s101.00x
💻 LocalNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.01x
🌐 RedisNext.js (Turbopack)1.103s (+2.3%)2.013s (~)0.910s101.01x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
💻 LocalNitro1.114s (+3.2%)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.311s (+1.1%)2.015s (~)0.703s101.20x
🌐 TursoNext.js (Turbopack)1.320s (+1.6%)2.012s (~)0.692s101.21x
🐘 PostgresNext.js (Turbopack)1.708s (-8.8% 🟢)2.018s (~)0.309s101.56x
🐘 PostgresNitro2.199s (-9.0% 🟢)3.016s (~)0.817s102.01x
🐘 PostgresExpress2.456s (+15.6% 🔺)3.014s (~)0.558s102.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.832s (+6.2% 🔺)3.800s (+3.0%)0.968s101.00x
▲ VercelNext.js (Turbopack)2.905s (+3.9%)3.699s (-0.9%)0.794s101.03x
▲ VercelExpress2.968s (+3.3%)3.716s (-2.0%)0.748s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.601s (~)11.012s (~)0.411s51.00x
💻 LocalNext.js (Turbopack)10.666s (~)11.018s (~)0.352s51.01x
🌐 RedisNext.js (Turbopack)10.704s (+1.3%)11.020s (~)0.315s51.01x
💻 LocalExpress10.799s (~)11.014s (~)0.215s51.02x
💻 LocalNitro10.818s (+2.6%)11.012s (~)0.194s51.02x
🌐 TursoNext.js (Turbopack)12.213s (~)13.021s (~)0.808s51.15x
🌐 MongoDBNext.js (Turbopack)12.239s (+2.6%)13.027s (+8.3% 🔺)0.787s51.15x
🐘 PostgresNext.js (Turbopack)15.388s (+3.4%)16.041s (+2.6%)0.653s51.45x
🐘 PostgresExpress20.294s (-1.0%)21.040s (~)0.745s51.91x
🐘 PostgresNitro20.462s (~)21.030s (~)0.568s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.886s (+6.8% 🔺)24.788s (+7.6% 🔺)0.902s51.00x
▲ VercelNitro24.184s (+5.1% 🔺)24.858s (+5.2% 🔺)0.673s51.01x
▲ VercelExpress24.366s (+6.3% 🔺)25.109s (+6.0% 🔺)0.743s51.02x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.352s (~)2.008s (~)0.656s151.00x
🌐 RedisNext.js (Turbopack)1.369s (+3.4%)2.011s (~)0.643s151.01x
💻 LocalNext.js (Turbopack)1.387s (~)2.011s (~)0.625s151.03x
💻 LocalExpress1.402s (~)2.006s (~)0.604s151.04x
💻 LocalNitro1.427s (+5.4% 🔺)2.006s (~)0.579s151.06x
🐘 PostgresNext.js (Turbopack)1.935s (+12.4% 🔺)2.167s (+7.7% 🔺)0.232s141.43x
🌐 MongoDBNext.js (Turbopack)2.145s (+0.8%)3.011s (~)0.866s101.59x
🌐 TursoNext.js (Turbopack)2.211s (~)3.013s (~)0.803s101.63x
🐘 PostgresNitro2.370s (-10.0% 🟢)3.012s (~)0.643s101.75x
🐘 PostgresExpress2.616s (+7.6% 🔺)3.016s (~)0.401s101.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.812s (-15.7% 🟢)3.800s (-5.2% 🟢)0.988s81.00x
▲ VercelExpress3.034s (+9.2% 🔺)3.776s (+1.2%)0.742s81.08x
▲ VercelNext.js (Turbopack)3.055s (+5.2% 🔺)3.838s (+3.3%)0.782s81.09x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.121s (~)3.009s (~)0.888s101.00x
💻 LocalExpress2.207s (~)3.164s (~)0.957s101.04x
💻 LocalNitro2.258s (+12.8% 🔺)3.208s (+33.5% 🔺)0.950s101.06x
🌐 StarterNext.js (Turbopack)2.467s (~)3.009s (~)0.542s101.16x
🌐 RedisNext.js (Turbopack)2.517s (+6.3% 🔺)3.020s (~)0.503s101.19x
🐘 PostgresNext.js (Turbopack)2.647s (+7.6% 🔺)3.018s (~)0.372s101.25x
🐘 PostgresExpress2.963s (-2.6%)3.013s (-15.7% 🟢)0.050s101.40x
🐘 PostgresNitro3.079s (+4.5%)3.696s (+18.6% 🔺)0.617s91.45x
🌐 TursoNext.js (Turbopack)4.661s (-1.8%)5.187s (~)0.526s62.20x
🌐 MongoDBNext.js (Turbopack)4.715s (+0.7%)5.182s (~)0.467s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.515s (+8.1% 🔺)4.047s (+12.9% 🔺)0.532s81.00x
▲ VercelExpress3.660s (+11.1% 🔺)4.628s (+19.4% 🔺)0.967s71.04x
▲ VercelNext.js (Turbopack)3.753s (-6.5% 🟢)4.655s (+1.1%)0.902s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.376s (-0.7%)2.008s (~)0.632s151.00x
💻 LocalNext.js (Turbopack)1.378s (-1.3%)2.011s (~)0.634s151.00x
🌐 RedisNext.js (Turbopack)1.396s (+4.1%)2.010s (~)0.614s151.01x
💻 LocalExpress1.439s (+1.3%)2.005s (~)0.566s151.05x
💻 LocalNitro1.447s (+8.7% 🔺)2.005s (~)0.558s151.05x
🐘 PostgresNext.js (Turbopack)1.648s (-0.9%)2.014s (~)0.366s151.20x
🐘 PostgresExpress1.713s (-17.8% 🟢)2.012s (-16.2% 🟢)0.299s151.24x
🐘 PostgresNitro1.937s (+13.6% 🔺)2.010s (~)0.073s151.41x
🌐 MongoDBNext.js (Turbopack)2.156s (+1.9%)3.011s (~)0.856s101.57x
🌐 TursoNext.js (Turbopack)2.225s (-0.6%)3.014s (~)0.789s101.62x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.938s (+4.0%)3.791s (+1.6%)0.854s81.00x
▲ VercelNitro2.982s (+3.8%)3.908s (+8.9% 🔺)0.925s81.02x
▲ VercelNext.js (Turbopack)3.188s (+8.4% 🔺)3.784s (+0.8%)0.596s81.09x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.153s (-0.7%)3.115s (+1.2%)0.962s101.00x
💻 LocalNitro2.282s (+9.2% 🔺)3.213s (+16.8% 🔺)0.931s101.06x
💻 LocalExpress2.330s (+1.5%)3.236s (~)0.905s101.08x
🌐 StarterNext.js (Turbopack)2.466s (~)3.013s (~)0.547s101.15x
🌐 RedisNext.js (Turbopack)2.523s (+6.6% 🔺)3.019s (~)0.496s101.17x
🐘 PostgresNitro2.695s (~)3.011s (~)0.316s101.25x
🐘 PostgresNext.js (Turbopack)2.704s (+10.1% 🔺)3.025s (~)0.320s101.26x
🐘 PostgresExpress2.955s (+2.2%)3.227s (+3.7%)0.272s101.37x
🌐 MongoDBNext.js (Turbopack)4.652s (-1.3%)5.180s (~)0.528s62.16x
🌐 TursoNext.js (Turbopack)4.706s (-2.1%)5.187s (~)0.480s62.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.332s (+2.7%)3.792s (~)0.460s81.00x
▲ VercelExpress3.333s (+3.2%)3.912s (+4.3%)0.579s81.00x
▲ VercelNext.js (Turbopack)3.715s (+11.3% 🔺)4.333s (+7.7% 🔺)0.617s81.12x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.128s (-1.5%)1.006s (~)0.000s (NaN%)1.011s (~)0.883s101.00x
💻 LocalNext.js (Turbopack)0.137s (-1.1%)1.004s (~)0.015s (-4.9%)1.027s (~)0.890s101.06x
🌐 RedisNext.js (Turbopack)0.153s (+33.9% 🔺)1.005s (~)0.000s (+Infinity% 🔺)1.015s (~)0.862s101.19x
💻 LocalExpress0.176s (+1.0%)0.992s (~)0.015s (+6.2% 🔺)1.022s (~)0.846s101.37x
💻 LocalNitro0.181s (+48.6% 🔺)0.992s (-0.6%)0.016s (-2.5%)1.021s (~)0.840s101.41x
🌐 TursoNext.js (Turbopack)0.465s (-8.7% 🟢)0.986s (+3.4%)0.000s (-50.0% 🟢)1.013s (~)0.548s103.62x
🌐 MongoDBNext.js (Turbopack)0.500s (+1.3%)0.950s (~)0.000s (-100.0% 🟢)1.013s (~)0.513s103.89x
🐘 PostgresNext.js (Turbopack)0.734s (-42.5% 🟢)0.885s (-42.9% 🟢)0.000s (+200.0% 🔺)1.017s (-44.1% 🟢)0.283s105.71x
🐘 PostgresExpress2.186s (-6.1% 🟢)2.860s (+5.4% 🔺)0.000s (NaN%)3.015s (~)0.829s1017.03x
🐘 PostgresNitro2.289s (+9.6% 🔺)2.753s (-1.8%)0.000s (+100.0% 🔺)3.013s (+3.4%)0.724s1017.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.009s (+1.7%)3.285s (+5.2% 🔺)0.753s (+11.7% 🔺)4.527s (+6.7% 🔺)1.518s101.00x
▲ VercelExpress3.050s (+5.0% 🔺)3.269s (+2.6%)0.893s (+79.4% 🔺)4.719s (+13.8% 🔺)1.670s101.01x
▲ VercelNext.js (Turbopack)3.056s (+2.8%)3.238s (-2.2%)0.886s (+75.7% 🔺)4.629s (+7.7% 🔺)1.574s101.02x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNitro5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Comment on lines -119 to -127
waitUntil(
Promise.all(ops).catch((opErr) => {
// Ignore expected client disconnect errors (e.g., browser refresh during streaming)
const isAbortError =
opErr?.name === 'AbortError' || opErr?.name === 'ResponseAborted';
if (!isAbortError) throw opErr;
})
);

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.

we can't remove this

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.

will simplify this after event sourcing ( #621 ) but need to keep it in for now

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.

hmm wait maybe Cursor is right and this is dead code since e2e tests are passing

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

lgtm

@TooTallNate
TooTallNate merged commit 49f650c into mainJan 13, 2026
98 checks passed
@TooTallNate
TooTallNate deleted the cursor/step-queue-write-idempotency-ee54 branch January 13, 2026 22:00
VaguelySerious pushed a commit that referenced this pull request Jan 16, 2026
* fix(core): always write step to queue even if step already exists
This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
* chore: add changeset for step queue idempotency fix
* chore(core): remove dead ops array code from processStep
The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
* DCO Remediation Commit for Cursor Agent <cursoragent@cursor.com>
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
---------
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Timer@TooTallNate@pranaygp@cursoragent
, '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

Step queue write idempotency - #776

Merged
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54
Jan 13, 2026
Merged

Step queue write idempotency#776
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54

Conversation

@Timer

Copy link
Copy Markdown
Contributor

Description

Fixes a race condition where a workflow step could get stuck in a "pending" state indefinitely.

Previously, if a process crashed after creating a step in the database but before queuing it for execution, subsequent retries would encounter a 409 conflict (step already exists) and skip the queue write. This left the step pending with 0 attempts.

The fix ensures that the step is always written to the execution queue, even if it already exists in the database. The queue write uses an idempotency key (correlationId), so duplicate queue messages are safely handled by the queue service. Detailed comments have been added to explain this critical behavior.

How did you test your changes?

  • Built the @workflow/core package locally.
  • Ran all 219 tests for the @workflow/core package, which passed successfully.
  • Verified linting and typechecking for the @workflow/core package.

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
    • During beta, we only use "patch" mode for changes. Don't tag minor/major versions.
    • Use pnpm changeset --empty if you are changing documentation or workbench apps
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)

Slack Thread

Open in CursorOpen in Web

This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
@cursor

cursorBot commented Jan 13, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel

vercelBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentReviewUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-astro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-express-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-fastify-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-hono-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nitro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nuxt-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-sveltekit-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-vite-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
1 Skipped Deployment
ProjectDeploymentReviewUpdated (UTC)
workflow-docsSkippedSkippedJan 13, 2026 9:32pm

@changeset-bot

changeset-botBot commented Jan 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 967c489

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

This PR includes changesets to release 13 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/docs-typecheckPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@workflow/world-testingPatch
@workflow/nuxtPatch
@workflow/aiPatch

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

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

@github-actions

github-actionsBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production374011385
✅ 💻 Local Development34208350
✅ 📦 Local Production34208350
✅ 🐘 Local Postgres34208350
✅ 🪟 Windows350035
❌ 🌍 Community Worlds136160152
Total157116351622

❌ Failed Tests

🌍 Community Worlds (16 failed)

mongodb (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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 catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3401
✅ example3401
✅ express3401
✅ fastify3401
✅ hono3401
✅ nextjs-turbopack3401
✅ nextjs-webpack3401
✅ nitro3401
✅ nuxt3401
✅ sveltekit3401
✅ vite3401
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack3500
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3410
✅ redis-dev300
✅ redis3500
✅ starter-dev300
❌ starter21140
✅ turso-dev300
❌ turso3410

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 13, 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
🌐 Starter🥇 Next.js (Turbopack)0.037s (-6.7% 🟢)1.014s (~)0.976s101.00x
💻 LocalNext.js (Turbopack)0.038s (-1.3%)1.014s (~)0.975s101.02x
🌐 RedisNext.js (Turbopack)0.045s (+27.3% 🔺)1.020s (~)0.975s101.19x
💻 LocalNitro0.045s (+41.5% 🔺)1.006s (~)0.961s101.20x
💻 LocalExpress0.045s (+5.8% 🔺)1.007s (~)0.962s101.21x
🌐 MongoDBNext.js (Turbopack)0.084s (+84.0% 🔺)1.015s (~)0.931s102.24x
🌐 TursoNext.js (Turbopack)0.110s (+4.9%)1.013s (~)0.903s102.93x
🐘 PostgresNext.js (Turbopack)0.247s (-5.9% 🟢)1.021s (~)0.774s106.59x
🐘 PostgresNitro0.261s (+11.0% 🔺)1.013s (-1.3%)0.752s106.96x
🐘 PostgresExpress0.268s (-7.8% 🟢)1.035s (+1.5%)0.767s107.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.571s (-1.7%)1.505s (+2.0%)0.934s101.00x
▲ VercelNitro0.643s (+3.6%)1.602s (+12.2% 🔺)0.959s101.13x
▲ VercelNext.js (Turbopack)0.711s (-10.1% 🟢)1.573s (-7.2% 🟢)0.863s101.25x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (~)2.011s (~)0.919s101.00x
💻 LocalNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.01x
🌐 RedisNext.js (Turbopack)1.103s (+2.3%)2.013s (~)0.910s101.01x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
💻 LocalNitro1.114s (+3.2%)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.311s (+1.1%)2.015s (~)0.703s101.20x
🌐 TursoNext.js (Turbopack)1.320s (+1.6%)2.012s (~)0.692s101.21x
🐘 PostgresNext.js (Turbopack)1.708s (-8.8% 🟢)2.018s (~)0.309s101.56x
🐘 PostgresNitro2.199s (-9.0% 🟢)3.016s (~)0.817s102.01x
🐘 PostgresExpress2.456s (+15.6% 🔺)3.014s (~)0.558s102.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.832s (+6.2% 🔺)3.800s (+3.0%)0.968s101.00x
▲ VercelNext.js (Turbopack)2.905s (+3.9%)3.699s (-0.9%)0.794s101.03x
▲ VercelExpress2.968s (+3.3%)3.716s (-2.0%)0.748s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.601s (~)11.012s (~)0.411s51.00x
💻 LocalNext.js (Turbopack)10.666s (~)11.018s (~)0.352s51.01x
🌐 RedisNext.js (Turbopack)10.704s (+1.3%)11.020s (~)0.315s51.01x
💻 LocalExpress10.799s (~)11.014s (~)0.215s51.02x
💻 LocalNitro10.818s (+2.6%)11.012s (~)0.194s51.02x
🌐 TursoNext.js (Turbopack)12.213s (~)13.021s (~)0.808s51.15x
🌐 MongoDBNext.js (Turbopack)12.239s (+2.6%)13.027s (+8.3% 🔺)0.787s51.15x
🐘 PostgresNext.js (Turbopack)15.388s (+3.4%)16.041s (+2.6%)0.653s51.45x
🐘 PostgresExpress20.294s (-1.0%)21.040s (~)0.745s51.91x
🐘 PostgresNitro20.462s (~)21.030s (~)0.568s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.886s (+6.8% 🔺)24.788s (+7.6% 🔺)0.902s51.00x
▲ VercelNitro24.184s (+5.1% 🔺)24.858s (+5.2% 🔺)0.673s51.01x
▲ VercelExpress24.366s (+6.3% 🔺)25.109s (+6.0% 🔺)0.743s51.02x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.352s (~)2.008s (~)0.656s151.00x
🌐 RedisNext.js (Turbopack)1.369s (+3.4%)2.011s (~)0.643s151.01x
💻 LocalNext.js (Turbopack)1.387s (~)2.011s (~)0.625s151.03x
💻 LocalExpress1.402s (~)2.006s (~)0.604s151.04x
💻 LocalNitro1.427s (+5.4% 🔺)2.006s (~)0.579s151.06x
🐘 PostgresNext.js (Turbopack)1.935s (+12.4% 🔺)2.167s (+7.7% 🔺)0.232s141.43x
🌐 MongoDBNext.js (Turbopack)2.145s (+0.8%)3.011s (~)0.866s101.59x
🌐 TursoNext.js (Turbopack)2.211s (~)3.013s (~)0.803s101.63x
🐘 PostgresNitro2.370s (-10.0% 🟢)3.012s (~)0.643s101.75x
🐘 PostgresExpress2.616s (+7.6% 🔺)3.016s (~)0.401s101.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.812s (-15.7% 🟢)3.800s (-5.2% 🟢)0.988s81.00x
▲ VercelExpress3.034s (+9.2% 🔺)3.776s (+1.2%)0.742s81.08x
▲ VercelNext.js (Turbopack)3.055s (+5.2% 🔺)3.838s (+3.3%)0.782s81.09x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.121s (~)3.009s (~)0.888s101.00x
💻 LocalExpress2.207s (~)3.164s (~)0.957s101.04x
💻 LocalNitro2.258s (+12.8% 🔺)3.208s (+33.5% 🔺)0.950s101.06x
🌐 StarterNext.js (Turbopack)2.467s (~)3.009s (~)0.542s101.16x
🌐 RedisNext.js (Turbopack)2.517s (+6.3% 🔺)3.020s (~)0.503s101.19x
🐘 PostgresNext.js (Turbopack)2.647s (+7.6% 🔺)3.018s (~)0.372s101.25x
🐘 PostgresExpress2.963s (-2.6%)3.013s (-15.7% 🟢)0.050s101.40x
🐘 PostgresNitro3.079s (+4.5%)3.696s (+18.6% 🔺)0.617s91.45x
🌐 TursoNext.js (Turbopack)4.661s (-1.8%)5.187s (~)0.526s62.20x
🌐 MongoDBNext.js (Turbopack)4.715s (+0.7%)5.182s (~)0.467s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.515s (+8.1% 🔺)4.047s (+12.9% 🔺)0.532s81.00x
▲ VercelExpress3.660s (+11.1% 🔺)4.628s (+19.4% 🔺)0.967s71.04x
▲ VercelNext.js (Turbopack)3.753s (-6.5% 🟢)4.655s (+1.1%)0.902s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.376s (-0.7%)2.008s (~)0.632s151.00x
💻 LocalNext.js (Turbopack)1.378s (-1.3%)2.011s (~)0.634s151.00x
🌐 RedisNext.js (Turbopack)1.396s (+4.1%)2.010s (~)0.614s151.01x
💻 LocalExpress1.439s (+1.3%)2.005s (~)0.566s151.05x
💻 LocalNitro1.447s (+8.7% 🔺)2.005s (~)0.558s151.05x
🐘 PostgresNext.js (Turbopack)1.648s (-0.9%)2.014s (~)0.366s151.20x
🐘 PostgresExpress1.713s (-17.8% 🟢)2.012s (-16.2% 🟢)0.299s151.24x
🐘 PostgresNitro1.937s (+13.6% 🔺)2.010s (~)0.073s151.41x
🌐 MongoDBNext.js (Turbopack)2.156s (+1.9%)3.011s (~)0.856s101.57x
🌐 TursoNext.js (Turbopack)2.225s (-0.6%)3.014s (~)0.789s101.62x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.938s (+4.0%)3.791s (+1.6%)0.854s81.00x
▲ VercelNitro2.982s (+3.8%)3.908s (+8.9% 🔺)0.925s81.02x
▲ VercelNext.js (Turbopack)3.188s (+8.4% 🔺)3.784s (+0.8%)0.596s81.09x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.153s (-0.7%)3.115s (+1.2%)0.962s101.00x
💻 LocalNitro2.282s (+9.2% 🔺)3.213s (+16.8% 🔺)0.931s101.06x
💻 LocalExpress2.330s (+1.5%)3.236s (~)0.905s101.08x
🌐 StarterNext.js (Turbopack)2.466s (~)3.013s (~)0.547s101.15x
🌐 RedisNext.js (Turbopack)2.523s (+6.6% 🔺)3.019s (~)0.496s101.17x
🐘 PostgresNitro2.695s (~)3.011s (~)0.316s101.25x
🐘 PostgresNext.js (Turbopack)2.704s (+10.1% 🔺)3.025s (~)0.320s101.26x
🐘 PostgresExpress2.955s (+2.2%)3.227s (+3.7%)0.272s101.37x
🌐 MongoDBNext.js (Turbopack)4.652s (-1.3%)5.180s (~)0.528s62.16x
🌐 TursoNext.js (Turbopack)4.706s (-2.1%)5.187s (~)0.480s62.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.332s (+2.7%)3.792s (~)0.460s81.00x
▲ VercelExpress3.333s (+3.2%)3.912s (+4.3%)0.579s81.00x
▲ VercelNext.js (Turbopack)3.715s (+11.3% 🔺)4.333s (+7.7% 🔺)0.617s81.12x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.128s (-1.5%)1.006s (~)0.000s (NaN%)1.011s (~)0.883s101.00x
💻 LocalNext.js (Turbopack)0.137s (-1.1%)1.004s (~)0.015s (-4.9%)1.027s (~)0.890s101.06x
🌐 RedisNext.js (Turbopack)0.153s (+33.9% 🔺)1.005s (~)0.000s (+Infinity% 🔺)1.015s (~)0.862s101.19x
💻 LocalExpress0.176s (+1.0%)0.992s (~)0.015s (+6.2% 🔺)1.022s (~)0.846s101.37x
💻 LocalNitro0.181s (+48.6% 🔺)0.992s (-0.6%)0.016s (-2.5%)1.021s (~)0.840s101.41x
🌐 TursoNext.js (Turbopack)0.465s (-8.7% 🟢)0.986s (+3.4%)0.000s (-50.0% 🟢)1.013s (~)0.548s103.62x
🌐 MongoDBNext.js (Turbopack)0.500s (+1.3%)0.950s (~)0.000s (-100.0% 🟢)1.013s (~)0.513s103.89x
🐘 PostgresNext.js (Turbopack)0.734s (-42.5% 🟢)0.885s (-42.9% 🟢)0.000s (+200.0% 🔺)1.017s (-44.1% 🟢)0.283s105.71x
🐘 PostgresExpress2.186s (-6.1% 🟢)2.860s (+5.4% 🔺)0.000s (NaN%)3.015s (~)0.829s1017.03x
🐘 PostgresNitro2.289s (+9.6% 🔺)2.753s (-1.8%)0.000s (+100.0% 🔺)3.013s (+3.4%)0.724s1017.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.009s (+1.7%)3.285s (+5.2% 🔺)0.753s (+11.7% 🔺)4.527s (+6.7% 🔺)1.518s101.00x
▲ VercelExpress3.050s (+5.0% 🔺)3.269s (+2.6%)0.893s (+79.4% 🔺)4.719s (+13.8% 🔺)1.670s101.01x
▲ VercelNext.js (Turbopack)3.056s (+2.8%)3.238s (-2.2%)0.886s (+75.7% 🔺)4.629s (+7.7% 🔺)1.574s101.02x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNitro5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Comment on lines -119 to -127
waitUntil(
Promise.all(ops).catch((opErr) => {
// Ignore expected client disconnect errors (e.g., browser refresh during streaming)
const isAbortError =
opErr?.name === 'AbortError' || opErr?.name === 'ResponseAborted';
if (!isAbortError) throw opErr;
})
);

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.

we can't remove this

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.

will simplify this after event sourcing ( #621 ) but need to keep it in for now

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.

hmm wait maybe Cursor is right and this is dead code since e2e tests are passing

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

lgtm

@TooTallNate
TooTallNate merged commit 49f650c into mainJan 13, 2026
98 checks passed
@TooTallNate
TooTallNate deleted the cursor/step-queue-write-idempotency-ee54 branch January 13, 2026 22:00
VaguelySerious pushed a commit that referenced this pull request Jan 16, 2026
* fix(core): always write step to queue even if step already exists
This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
* chore: add changeset for step queue idempotency fix
* chore(core): remove dead ops array code from processStep
The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
* DCO Remediation Commit for Cursor Agent <cursoragent@cursor.com>
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
---------
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Timer@TooTallNate@pranaygp@cursoragent
, '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

Step queue write idempotency - #776

Merged
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54
Jan 13, 2026
Merged

Step queue write idempotency#776
TooTallNate merged 4 commits into
mainfrom
cursor/step-queue-write-idempotency-ee54

Conversation

@Timer

Copy link
Copy Markdown
Contributor

Description

Fixes a race condition where a workflow step could get stuck in a "pending" state indefinitely.

Previously, if a process crashed after creating a step in the database but before queuing it for execution, subsequent retries would encounter a 409 conflict (step already exists) and skip the queue write. This left the step pending with 0 attempts.

The fix ensures that the step is always written to the execution queue, even if it already exists in the database. The queue write uses an idempotency key (correlationId), so duplicate queue messages are safely handled by the queue service. Detailed comments have been added to explain this critical behavior.

How did you test your changes?

  • Built the @workflow/core package locally.
  • Ran all 219 tests for the @workflow/core package, which passed successfully.
  • Verified linting and typechecking for the @workflow/core package.

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
    • During beta, we only use "patch" mode for changes. Don't tag minor/major versions.
    • Use pnpm changeset --empty if you are changing documentation or workbench apps
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)

Slack Thread

Open in CursorOpen in Web

This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
@cursor

cursorBot commented Jan 13, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel

vercelBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentReviewUpdated (UTC)
example-nextjs-workflow-turbopackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-nextjs-workflow-webpackReadyReadyPreview, CommentJan 13, 2026 9:32pm
example-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-astro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-express-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-fastify-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-hono-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nitro-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-nuxt-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-sveltekit-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
workbench-vite-workflowReadyReadyPreview, CommentJan 13, 2026 9:32pm
1 Skipped Deployment
ProjectDeploymentReviewUpdated (UTC)
workflow-docsSkippedSkippedJan 13, 2026 9:32pm

@changeset-bot

changeset-botBot commented Jan 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 967c489

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

This PR includes changesets to release 13 packages
NameType
@workflow/corePatch
@workflow/buildersPatch
@workflow/cliPatch
@workflow/docs-typecheckPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/web-sharedPatch
workflowPatch
@workflow/astroPatch
@workflow/sveltekitPatch
@workflow/world-testingPatch
@workflow/nuxtPatch
@workflow/aiPatch

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

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

@github-actions

github-actionsBot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production374011385
✅ 💻 Local Development34208350
✅ 📦 Local Production34208350
✅ 🐘 Local Postgres34208350
✅ 🪟 Windows350035
❌ 🌍 Community Worlds136160152
Total157116351622

❌ Failed Tests

🌍 Community Worlds (16 failed)

mongodb (1 failed):

  • webhookWorkflow

starter (14 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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 catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro3401
✅ example3401
✅ express3401
✅ fastify3401
✅ hono3401
✅ nextjs-turbopack3401
✅ nextjs-webpack3401
✅ nitro3401
✅ nuxt3401
✅ sveltekit3401
✅ vite3401
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable3401
✅ express-stable3401
✅ fastify-stable3401
✅ hono-stable3401
✅ nextjs-turbopack-stable3500
✅ nextjs-webpack-stable3500
✅ nitro-stable3401
✅ nuxt-stable3401
✅ sveltekit-stable3401
✅ vite-stable3401
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack3500
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev300
❌ mongodb3410
✅ redis-dev300
✅ redis3500
✅ starter-dev300
❌ starter21140
✅ turso-dev300
❌ turso3410

📋 View full workflow run

@github-actions

github-actionsBot commented Jan 13, 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
🌐 Starter🥇 Next.js (Turbopack)0.037s (-6.7% 🟢)1.014s (~)0.976s101.00x
💻 LocalNext.js (Turbopack)0.038s (-1.3%)1.014s (~)0.975s101.02x
🌐 RedisNext.js (Turbopack)0.045s (+27.3% 🔺)1.020s (~)0.975s101.19x
💻 LocalNitro0.045s (+41.5% 🔺)1.006s (~)0.961s101.20x
💻 LocalExpress0.045s (+5.8% 🔺)1.007s (~)0.962s101.21x
🌐 MongoDBNext.js (Turbopack)0.084s (+84.0% 🔺)1.015s (~)0.931s102.24x
🌐 TursoNext.js (Turbopack)0.110s (+4.9%)1.013s (~)0.903s102.93x
🐘 PostgresNext.js (Turbopack)0.247s (-5.9% 🟢)1.021s (~)0.774s106.59x
🐘 PostgresNitro0.261s (+11.0% 🔺)1.013s (-1.3%)0.752s106.96x
🐘 PostgresExpress0.268s (-7.8% 🟢)1.035s (+1.5%)0.767s107.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.571s (-1.7%)1.505s (+2.0%)0.934s101.00x
▲ VercelNitro0.643s (+3.6%)1.602s (+12.2% 🔺)0.959s101.13x
▲ VercelNext.js (Turbopack)0.711s (-10.1% 🟢)1.573s (-7.2% 🟢)0.863s101.25x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (~)2.011s (~)0.919s101.00x
💻 LocalNext.js (Turbopack)1.099s (~)2.011s (~)0.912s101.01x
🌐 RedisNext.js (Turbopack)1.103s (+2.3%)2.013s (~)0.910s101.01x
💻 LocalExpress1.114s (~)2.007s (~)0.893s101.02x
💻 LocalNitro1.114s (+3.2%)2.007s (~)0.893s101.02x
🌐 MongoDBNext.js (Turbopack)1.311s (+1.1%)2.015s (~)0.703s101.20x
🌐 TursoNext.js (Turbopack)1.320s (+1.6%)2.012s (~)0.692s101.21x
🐘 PostgresNext.js (Turbopack)1.708s (-8.8% 🟢)2.018s (~)0.309s101.56x
🐘 PostgresNitro2.199s (-9.0% 🟢)3.016s (~)0.817s102.01x
🐘 PostgresExpress2.456s (+15.6% 🔺)3.014s (~)0.558s102.25x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.832s (+6.2% 🔺)3.800s (+3.0%)0.968s101.00x
▲ VercelNext.js (Turbopack)2.905s (+3.9%)3.699s (-0.9%)0.794s101.03x
▲ VercelExpress2.968s (+3.3%)3.716s (-2.0%)0.748s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.601s (~)11.012s (~)0.411s51.00x
💻 LocalNext.js (Turbopack)10.666s (~)11.018s (~)0.352s51.01x
🌐 RedisNext.js (Turbopack)10.704s (+1.3%)11.020s (~)0.315s51.01x
💻 LocalExpress10.799s (~)11.014s (~)0.215s51.02x
💻 LocalNitro10.818s (+2.6%)11.012s (~)0.194s51.02x
🌐 TursoNext.js (Turbopack)12.213s (~)13.021s (~)0.808s51.15x
🌐 MongoDBNext.js (Turbopack)12.239s (+2.6%)13.027s (+8.3% 🔺)0.787s51.15x
🐘 PostgresNext.js (Turbopack)15.388s (+3.4%)16.041s (+2.6%)0.653s51.45x
🐘 PostgresExpress20.294s (-1.0%)21.040s (~)0.745s51.91x
🐘 PostgresNitro20.462s (~)21.030s (~)0.568s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)23.886s (+6.8% 🔺)24.788s (+7.6% 🔺)0.902s51.00x
▲ VercelNitro24.184s (+5.1% 🔺)24.858s (+5.2% 🔺)0.673s51.01x
▲ VercelExpress24.366s (+6.3% 🔺)25.109s (+6.0% 🔺)0.743s51.02x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.352s (~)2.008s (~)0.656s151.00x
🌐 RedisNext.js (Turbopack)1.369s (+3.4%)2.011s (~)0.643s151.01x
💻 LocalNext.js (Turbopack)1.387s (~)2.011s (~)0.625s151.03x
💻 LocalExpress1.402s (~)2.006s (~)0.604s151.04x
💻 LocalNitro1.427s (+5.4% 🔺)2.006s (~)0.579s151.06x
🐘 PostgresNext.js (Turbopack)1.935s (+12.4% 🔺)2.167s (+7.7% 🔺)0.232s141.43x
🌐 MongoDBNext.js (Turbopack)2.145s (+0.8%)3.011s (~)0.866s101.59x
🌐 TursoNext.js (Turbopack)2.211s (~)3.013s (~)0.803s101.63x
🐘 PostgresNitro2.370s (-10.0% 🟢)3.012s (~)0.643s101.75x
🐘 PostgresExpress2.616s (+7.6% 🔺)3.016s (~)0.401s101.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.812s (-15.7% 🟢)3.800s (-5.2% 🟢)0.988s81.00x
▲ VercelExpress3.034s (+9.2% 🔺)3.776s (+1.2%)0.742s81.08x
▲ VercelNext.js (Turbopack)3.055s (+5.2% 🔺)3.838s (+3.3%)0.782s81.09x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.121s (~)3.009s (~)0.888s101.00x
💻 LocalExpress2.207s (~)3.164s (~)0.957s101.04x
💻 LocalNitro2.258s (+12.8% 🔺)3.208s (+33.5% 🔺)0.950s101.06x
🌐 StarterNext.js (Turbopack)2.467s (~)3.009s (~)0.542s101.16x
🌐 RedisNext.js (Turbopack)2.517s (+6.3% 🔺)3.020s (~)0.503s101.19x
🐘 PostgresNext.js (Turbopack)2.647s (+7.6% 🔺)3.018s (~)0.372s101.25x
🐘 PostgresExpress2.963s (-2.6%)3.013s (-15.7% 🟢)0.050s101.40x
🐘 PostgresNitro3.079s (+4.5%)3.696s (+18.6% 🔺)0.617s91.45x
🌐 TursoNext.js (Turbopack)4.661s (-1.8%)5.187s (~)0.526s62.20x
🌐 MongoDBNext.js (Turbopack)4.715s (+0.7%)5.182s (~)0.467s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.515s (+8.1% 🔺)4.047s (+12.9% 🔺)0.532s81.00x
▲ VercelExpress3.660s (+11.1% 🔺)4.628s (+19.4% 🔺)0.967s71.04x
▲ VercelNext.js (Turbopack)3.753s (-6.5% 🟢)4.655s (+1.1%)0.902s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.376s (-0.7%)2.008s (~)0.632s151.00x
💻 LocalNext.js (Turbopack)1.378s (-1.3%)2.011s (~)0.634s151.00x
🌐 RedisNext.js (Turbopack)1.396s (+4.1%)2.010s (~)0.614s151.01x
💻 LocalExpress1.439s (+1.3%)2.005s (~)0.566s151.05x
💻 LocalNitro1.447s (+8.7% 🔺)2.005s (~)0.558s151.05x
🐘 PostgresNext.js (Turbopack)1.648s (-0.9%)2.014s (~)0.366s151.20x
🐘 PostgresExpress1.713s (-17.8% 🟢)2.012s (-16.2% 🟢)0.299s151.24x
🐘 PostgresNitro1.937s (+13.6% 🔺)2.010s (~)0.073s151.41x
🌐 MongoDBNext.js (Turbopack)2.156s (+1.9%)3.011s (~)0.856s101.57x
🌐 TursoNext.js (Turbopack)2.225s (-0.6%)3.014s (~)0.789s101.62x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.938s (+4.0%)3.791s (+1.6%)0.854s81.00x
▲ VercelNitro2.982s (+3.8%)3.908s (+8.9% 🔺)0.925s81.02x
▲ VercelNext.js (Turbopack)3.188s (+8.4% 🔺)3.784s (+0.8%)0.596s81.09x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.153s (-0.7%)3.115s (+1.2%)0.962s101.00x
💻 LocalNitro2.282s (+9.2% 🔺)3.213s (+16.8% 🔺)0.931s101.06x
💻 LocalExpress2.330s (+1.5%)3.236s (~)0.905s101.08x
🌐 StarterNext.js (Turbopack)2.466s (~)3.013s (~)0.547s101.15x
🌐 RedisNext.js (Turbopack)2.523s (+6.6% 🔺)3.019s (~)0.496s101.17x
🐘 PostgresNitro2.695s (~)3.011s (~)0.316s101.25x
🐘 PostgresNext.js (Turbopack)2.704s (+10.1% 🔺)3.025s (~)0.320s101.26x
🐘 PostgresExpress2.955s (+2.2%)3.227s (+3.7%)0.272s101.37x
🌐 MongoDBNext.js (Turbopack)4.652s (-1.3%)5.180s (~)0.528s62.16x
🌐 TursoNext.js (Turbopack)4.706s (-2.1%)5.187s (~)0.480s62.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.332s (+2.7%)3.792s (~)0.460s81.00x
▲ VercelExpress3.333s (+3.2%)3.912s (+4.3%)0.579s81.00x
▲ VercelNext.js (Turbopack)3.715s (+11.3% 🔺)4.333s (+7.7% 🔺)0.617s81.12x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.128s (-1.5%)1.006s (~)0.000s (NaN%)1.011s (~)0.883s101.00x
💻 LocalNext.js (Turbopack)0.137s (-1.1%)1.004s (~)0.015s (-4.9%)1.027s (~)0.890s101.06x
🌐 RedisNext.js (Turbopack)0.153s (+33.9% 🔺)1.005s (~)0.000s (+Infinity% 🔺)1.015s (~)0.862s101.19x
💻 LocalExpress0.176s (+1.0%)0.992s (~)0.015s (+6.2% 🔺)1.022s (~)0.846s101.37x
💻 LocalNitro0.181s (+48.6% 🔺)0.992s (-0.6%)0.016s (-2.5%)1.021s (~)0.840s101.41x
🌐 TursoNext.js (Turbopack)0.465s (-8.7% 🟢)0.986s (+3.4%)0.000s (-50.0% 🟢)1.013s (~)0.548s103.62x
🌐 MongoDBNext.js (Turbopack)0.500s (+1.3%)0.950s (~)0.000s (-100.0% 🟢)1.013s (~)0.513s103.89x
🐘 PostgresNext.js (Turbopack)0.734s (-42.5% 🟢)0.885s (-42.9% 🟢)0.000s (+200.0% 🔺)1.017s (-44.1% 🟢)0.283s105.71x
🐘 PostgresExpress2.186s (-6.1% 🟢)2.860s (+5.4% 🔺)0.000s (NaN%)3.015s (~)0.829s1017.03x
🐘 PostgresNitro2.289s (+9.6% 🔺)2.753s (-1.8%)0.000s (+100.0% 🔺)3.013s (+3.4%)0.724s1017.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.009s (+1.7%)3.285s (+5.2% 🔺)0.753s (+11.7% 🔺)4.527s (+6.7% 🔺)1.518s101.00x
▲ VercelExpress3.050s (+5.0% 🔺)3.269s (+2.6%)0.893s (+79.4% 🔺)4.719s (+13.8% 🔺)1.670s101.01x
▲ VercelNext.js (Turbopack)3.056s (+2.8%)3.238s (-2.2%)0.886s (+75.7% 🔺)4.629s (+7.7% 🔺)1.574s101.02x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)8/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelNitro5/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Comment on lines -119 to -127
waitUntil(
Promise.all(ops).catch((opErr) => {
// Ignore expected client disconnect errors (e.g., browser refresh during streaming)
const isAbortError =
opErr?.name === 'AbortError' || opErr?.name === 'ResponseAborted';
if (!isAbortError) throw opErr;
})
);

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.

we can't remove this

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.

will simplify this after event sourcing ( #621 ) but need to keep it in for now

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.

hmm wait maybe Cursor is right and this is dead code since e2e tests are passing

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

lgtm

@TooTallNate
TooTallNate merged commit 49f650c into mainJan 13, 2026
98 checks passed
@TooTallNate
TooTallNate deleted the cursor/step-queue-write-idempotency-ee54 branch January 13, 2026 22:00
VaguelySerious pushed a commit that referenced this pull request Jan 16, 2026
* fix(core): always write step to queue even if step already exists
This fixes a race condition where:
1. Step is written to workflow database
2. Process crashes/times out before queue write completes
3. Upstream retry occurs
4. Step already exists (409), so queue write was skipped
5. Step sits pending forever with 0 attempts
The queue write already uses an idempotency key (correlation ID),
so duplicate writes are safely deduplicated by the queue service.
* chore: add changeset for step queue idempotency fix
* chore(core): remove dead ops array code from processStep
The ops array was leftover from a previous refactor that used to collect
promises for parallel execution. Nothing was ever pushed to it, making
the waitUntil(Promise.all(ops)) a no-op.
* DCO Remediation Commit for Cursor Agent <cursoragent@cursor.com>
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 6e510f7
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 5394d49
I, Cursor Agent <cursoragent@cursor.com>, hereby add my Signed-off-by to this commit: 23424ff
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
---------
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Timer@TooTallNate@pranaygp@cursoragent