Skip to content

[world-vercel] Send the run id on correlation-id event reads - #3334

Merged
VaguelySerious merged 1 commit into
mainfrom
peter/correlation-id-run-scope-wire
Aug 5, 2026
Merged

[world-vercel] Send the run id on correlation-id event reads#3334
VaguelySerious merged 1 commit into
mainfrom
peter/correlation-id-run-scope-wire

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Follow-up to #3280.

#3280 made runId required on ListEventsByCorrelationIdParams, but world-vercel could only apply the scope after the response arrived: it selected by correlation id on the wire and filtered the returned page by run id. A correlation id names a step, hook or wait within its run, so under slot identity step_…001 is the first step of every slot-numbered run, and an unscoped read spans runs. Post-filtering a page the backend chose without knowing the run is not a scope.

This sends runId on the request, so the backend can answer for that run alone. The client-side filter stays as the fallback for a backend that predates the parameter and still answers across runs (skew protection keeps older deployments talking to the current API, and vice versa).

The backend side is tracked separately and ships first.

Tests

  • events-v4.test.ts: getEventsByCorrelationIdV4 puts both correlationId and runId on the query string.
  • events.test.ts: getWorkflowRunEvents with a correlation id sends runId, and when a backend answers with two runs sharing one correlation id, only the requested run's event survives while hasMore/cursor stay the backend's.

Both tests were checked against mutations: dropping the runId query param fails the first, dropping the post-filter fails the second.

#3280 made runId required on ListEventsByCorrelationIdParams, but
world-vercel could only apply the scope after the fact: it selected by
correlation id on the wire and filtered the returned page by run. That
depends on the backend having happened to return the run's rows in the
page it answered with.

Put runId on the request. The backend reads the run's own partition and
answers for that run, so the page comes back scoped. The client-side
filter stays for backends that predate the parameter and still answer
across runs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested a review from a team as a code owner August 4, 2026 20:57
@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8aa1570

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

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

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

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

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Aug 4, 2026 9:00pm
example-nextjs-workflow-webpack Ready Ready Preview Aug 4, 2026 9:00pm
example-workflow Ready Ready Preview Aug 4, 2026 9:00pm
workbench-astro-workflow Ready Ready Preview Aug 4, 2026 9:00pm
workbench-express-workflow Ready Ready Preview Aug 4, 2026 9:00pm
workbench-fastify-workflow Ready Ready Preview Aug 4, 2026 9:00pm
workbench-hono-workflow Ready Ready Preview Aug 4, 2026 9:00pm
workbench-nestjs-workflow Ready Ready Preview Aug 4, 2026 9:00pm
workbench-nitro-workflow Ready Ready Preview Aug 4, 2026 9:00pm
workbench-nuxt-workflow Ready Ready Preview Aug 4, 2026 9:00pm
workbench-sveltekit-workflow Ready Ready Preview Aug 4, 2026 9:00pm
workbench-tanstack-start-workflow Ready Ready Preview Aug 4, 2026 9:00pm
workbench-vite-workflow Ready Ready Preview Aug 4, 2026 9:00pm
workflow-docs Ready Ready Preview, v0 Aug 4, 2026 9:00pm
workflow-swc-playground Ready Ready Preview Aug 4, 2026 9:00pm
workflow-tarballs Ready Ready Preview Aug 4, 2026 9:00pm
workflow-web Ready Ready Preview Aug 4, 2026 9:00pm

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

❌ Failed E2E Tests

📦 Local Production (1 failed)

nitro-stable-node (1 failed):

  • webhookWorkflow | wrun_41KZ79B61F0GX167F4PC6VYMRK

E2E Test Summary

Summary
Passed Failed Skipped Total
✅ ▲ Vercel Production 2932 0 500 3432
✅ 💻 Local Development 2860 0 416 3276
❌ 📦 Local Production 3289 1 454 3744
✅ 🐘 Local Postgres 3134 0 454 3588
✅ 🪟 Windows 312 0 0 312
✅ 📋 Other 2068 0 428 2496
✅ vercel-multi-region 27 0 0 27
Total 14622 1 2252 16875
Details by Category

✅ ▲ Vercel Production

App Passed Failed Skipped
✅ astro-node 127 0 29
✅ astro-quickjs 127 0 29
✅ example-node 127 0 29
✅ example-quickjs 127 0 29
✅ express-node 127 0 29
✅ express-quickjs 127 0 29
✅ fastify-node 127 0 29
✅ fastify-quickjs 127 0 29
✅ hono-node 127 0 29
✅ hono-quickjs 127 0 29
✅ nextjs-turbopack-node 152 0 4
✅ nextjs-turbopack-quickjs 152 0 4
✅ nextjs-webpack-node 152 0 4
✅ nextjs-webpack-quickjs 152 0 4
✅ nitro-node 127 0 29
✅ nitro-quickjs 127 0 29
✅ nuxt-node 127 0 29
✅ nuxt-quickjs 127 0 29
✅ sveltekit-node 146 0 10
✅ sveltekit-quickjs 146 0 10
✅ vite-node 127 0 29
✅ vite-quickjs 127 0 29

✅ 💻 Local Development

App Passed Failed Skipped
✅ astro-stable-node 130 0 26
✅ astro-stable-quickjs 130 0 26
✅ express-stable-node 130 0 26
✅ express-stable-quickjs 130 0 26
✅ fastify-stable-node 130 0 26
✅ fastify-stable-quickjs 130 0 26
✅ hono-stable-node 130 0 26
✅ hono-stable-quickjs 130 0 26
✅ nextjs-turbopack-canary-node 137 0 19
✅ nextjs-turbopack-canary-quickjs 137 0 19
✅ nextjs-turbopack-stable-node 156 0 0
✅ nextjs-turbopack-stable-quickjs 156 0 0
✅ nextjs-webpack-stable-quickjs 156 0 0
✅ nitro-stable-node 130 0 26
✅ nitro-stable-quickjs 130 0 26
✅ nuxt-stable-node 130 0 26
✅ nuxt-stable-quickjs 130 0 26
✅ sveltekit-stable-node 149 0 7
✅ sveltekit-stable-quickjs 149 0 7
✅ vite-stable-node 130 0 26
✅ vite-stable-quickjs 130 0 26

❌ 📦 Local Production

App Passed Failed Skipped
✅ astro-stable-node 130 0 26
✅ astro-stable-quickjs 130 0 26
✅ express-stable-node 130 0 26
✅ express-stable-quickjs 130 0 26
✅ fastify-stable-node 130 0 26
✅ fastify-stable-quickjs 130 0 26
✅ hono-stable-node 130 0 26
✅ hono-stable-quickjs 130 0 26
✅ nextjs-turbopack-canary-node 137 0 19
✅ nextjs-turbopack-canary-quickjs 137 0 19
✅ nextjs-turbopack-stable-node 156 0 0
✅ nextjs-turbopack-stable-quickjs 156 0 0
✅ nextjs-webpack-canary-node 137 0 19
✅ nextjs-webpack-canary-quickjs 137 0 19
✅ nextjs-webpack-stable-node 156 0 0
✅ nextjs-webpack-stable-quickjs 156 0 0
❌ nitro-stable-node 129 1 26
✅ nitro-stable-quickjs 130 0 26
✅ nuxt-stable-node 130 0 26
✅ nuxt-stable-quickjs 130 0 26
✅ sveltekit-stable-node 149 0 7
✅ sveltekit-stable-quickjs 149 0 7
✅ vite-stable-node 130 0 26
✅ vite-stable-quickjs 130 0 26

✅ 🐘 Local Postgres

App Passed Failed Skipped
✅ astro-stable-node 130 0 26
✅ astro-stable-quickjs 130 0 26
✅ express-stable-node 130 0 26
✅ express-stable-quickjs 130 0 26
✅ fastify-stable-node 130 0 26
✅ fastify-stable-quickjs 130 0 26
✅ hono-stable-node 130 0 26
✅ hono-stable-quickjs 130 0 26
✅ nextjs-turbopack-canary-node 137 0 19
✅ nextjs-turbopack-canary-quickjs 137 0 19
✅ nextjs-turbopack-stable-quickjs 156 0 0
✅ nextjs-webpack-canary-node 137 0 19
✅ nextjs-webpack-canary-quickjs 137 0 19
✅ nextjs-webpack-stable-node 156 0 0
✅ nextjs-webpack-stable-quickjs 156 0 0
✅ nitro-stable-node 130 0 26
✅ nitro-stable-quickjs 130 0 26
✅ nuxt-stable-node 130 0 26
✅ nuxt-stable-quickjs 130 0 26
✅ sveltekit-stable-node 149 0 7
✅ sveltekit-stable-quickjs 149 0 7
✅ vite-stable-node 130 0 26
✅ vite-stable-quickjs 130 0 26

✅ 🪟 Windows

App Passed Failed Skipped
✅ nextjs-turbopack-node 156 0 0
✅ nextjs-turbopack-quickjs 156 0 0

✅ 📋 Other

App Passed Failed Skipped
✅ e2e-local-dev-nest-stable-node 130 0 26
✅ e2e-local-dev-nest-stable-quickjs 130 0 26
✅ e2e-local-dev-tanstack-start-node 130 0 26
✅ e2e-local-dev-tanstack-start-quickjs 130 0 26
✅ e2e-local-postgres-nest-stable-node 130 0 26
✅ e2e-local-postgres-nest-stable-quickjs 130 0 26
✅ e2e-local-postgres-tanstack-start-node 130 0 26
✅ e2e-local-postgres-tanstack-start-quickjs 130 0 26
✅ e2e-local-prod-nest-stable-node 130 0 26
✅ e2e-local-prod-nest-stable-quickjs 130 0 26
✅ e2e-local-prod-tanstack-start-node 130 0 26
✅ e2e-local-prod-tanstack-start-quickjs 130 0 26
✅ e2e-vercel-prod-nest-node 127 0 29
✅ e2e-vercel-prod-nest-quickjs 127 0 29
✅ e2e-vercel-prod-tanstack-start-node 127 0 29
✅ e2e-vercel-prod-tanstack-start-quickjs 127 0 29

✅ vercel-multi-region

App Passed Failed Skipped
✅ nextjs-turbopack 27 0 0

📋 View full workflow run

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit 8aa1570 · Tue, 04 Aug 2026 21:17:03 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 1277 (+497%) 🔻 1423 🔴 (+19%) 🔻 1444 🔴 (+17%) 🔻 1567 🔴 (-4.2%) 30
TTFS stream 332 (+35%) 🔻 1476 🔴 (+38%) 🔻 1552 🔴 (+42%) 🔻 1594 🔴 (+39%) 🔻 30
TTFS hook + stream 1567 (+312%) 🔻 1767 🔴 (+34%) 🔻 1890 🔴 (+37%) 🔻 2041 🔴 (+39%) 🔻 30
STSO 1020 steps (inline) 90 (-10%) 146 (-8.8%) 186 (-4.1%) 307 (-30%) 💚 1018
STSO 1020 steps (queue-hop) 3876 (+31%) 🔻 3876 (+31%) 🔻 3876 (+31%) 🔻 3876 (+31%) 🔻 1
WO 1020 steps 148956 (-13%) 148956 (-13%) 148956 (-13%) 148956 (-13%) 1
SL stream latency 115 (+19%) 🔻 156 🔴 (+4.7%) 185 🔴 (-17%) 💚 453 🔴 (-40%) 💚 30
SO stream overhead (text) 116 (-3.3%) 183 (-30%) 💚 198 (-66%) 💚 264 (-67%) 💚 30
SO stream overhead (structured) 117 (±0%) 185 (-41%) 💚 217 (-62%) 💚 385 (-55%) 💚 30
📈 STSO distribution vs main (inline / queue-hop histograms)

1020 steps (inline)

Cumulative STSO time: main 166837ms → this run 143670ms (Δ -23167ms, -14%)

   50-100 ms  ┃                         main   0  this  10   +10
  100-150 ms  ███████████████████░░░░┃  main 624  this 783  +159
  150-200 ms  ████┃████                 main 302  this 155  -147
  200-250 ms  █┃                        main  48  this  50    +2
  250-300 ms  ┃                         main  13  this   9    -4
  300-350 ms  ┃                         main  12  this   3    -9
  350-400 ms  ┃                         main   6  this   4    -2
  400-450 ms  ┃                         main   3  this   0    -3
  450-500 ms  ┃                         main   0  this   1    +1
  500-550 ms  ┃                         main   2  this   1    -1
  550-600 ms  ┃                         main   3  this   0    -3
  650-700 ms  ┃                         main   1  this   0    -1
  850-900 ms  ┃                         main   1  this   0    -1
1200-1250 ms  ┃                         main   0  this   1    +1
2150-2200 ms  ┃                         main   1  this   0    -1
3300-3350 ms  ┃                         main   1  this   0    -1
3450-3500 ms  ┃                         main   0  this   1    +1
3800-3850 ms  ┃                         main   1  this   0    -1

1020 steps (queue-hop)

Cumulative STSO time: main 2968ms → this run 3876ms (Δ +908ms, +31%)

2500-3000 ms  ┃███████████████████████  main 1  this 0  -1
3500-4000 ms  ░░░░░░░░░░░░░░░░░░░░░░░┃  main 0  this 1  +1
ℹ️ Metric definitions & methodology

The collapsed STSO distribution section above buckets every step gap of the sequential-steps run (not a sampled window), split by whether the step ending the gap ran inline — in the same warm process as the step before it, so the gap is pure framework overhead — or after a queue-hop — the first step of a fresh process, which pays queue dispatch, client reinit and event-log replay. Bars overlay the two runs: is main, marks where this run lands, bridges the gap when this run has more samples in a bucket.

Best/P75/P90/P99 deltas compare against the most recent benchmark run on main at the time of this run. 🔻 flags a delta worse than +15%, 💚 one better than −15%.

Metrics — TTFS: time to first step body (in-deployment start() → first step body, deployment clocks) · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (whole-run time outside step bodies, in-deployment anchored) · SL: stream latency (in-deployment write → read propagation, readAt - writtenAt) · SO: stream overhead (end-to-end write+consume time beyond the modelled generation window)

Scenarios — step: one trivial no-op step, no stream; no hooks, so the run stays in turbo mode (in-process fast path) · stream: one streaming step; no hooks, so the run stays in turbo mode (in-process fast path) · hook + stream: registers a hook before one step, which exits turbo mode (dispatch path) · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges, and WO is the whole-run overhead outside step bodies · stream latency: parallel reader/writer steps on a dedicated stream; SL is the in-deployment write->read propagation (readAt - writtenAt) · stream overhead (text): writer streams 300 variable-length text token deltas paced at 100/s for 3s (a haiku-size LLM's token throughput) while a parallel reader drains the whole stream; SO is the end-to-end write+consume time beyond the 3s generation window (overhead/backpressure) · stream overhead (structured): same workload as stream overhead (text), but each delta is an AI-SDK-style structured object ({ type: 'text-delta', id, text }) instead of a raw string, so the SO gap vs the text scenario is the added serialization cost

🔴 marks a percentile over its target (within target is left unmarked). Targets (p75/p90/p99, ms) — TTFS 200/300/600 · SL 50/60/125 · SO 250/500/1000

All metrics are measured from deployment-side timestamps only. Runs are triggered by an in-deployment route that stamps the anchor (clientStart) right before start(), so the CI runner’s request and its path through api.vercel.com sit outside every measured window. TTFS = in-deployment start() → first step body (turbo uses the in-process fast path, non-turbo the dispatch path), and includes the VQS dispatch hop plus any /flow cold start. STSO/WO are measured between step bodies on the deployment. SL is measured inside the workflow (parallel reader/writer steps), so it no longer includes the api.vercel.com read path.

Cold starts are kept in the numbers on purpose — they are part of real bursty-workload latency. The workbench deployment cold-starts the /flow invocation for a large fraction of runs, inflating P75+; the Best column shows the fastest (warm-start) sample for comparison.

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

@VaguelySerious
VaguelySerious merged commit 2eddf74 into main Aug 5, 2026
159 of 165 checks passed
@VaguelySerious
VaguelySerious deleted the peter/correlation-id-run-scope-wire branch August 5, 2026 16:54
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

No backport to stable for 2eddf74 (AI decision).

This commit builds directly on #3280, which is main-only: ListEventsByCorrelationIdParams on stable (packages/world/src/events.ts:483) has no runId field, and stable's getWorkflowRunEvents has neither the run id to send nor the client-side run-scope filter this change amends, so params.runId would not even typecheck there. It is also a wire-protocol change gated on a backend parameter that ships separately, rather than a self-contained fix to behavior that exists on the maintenance line. If the underlying cross-run scoping gap is judged a real defect for stable, #3280 and this follow-up would need to be forced through together via workflow_dispatch.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

2eddf74cb620dcb292ffe8f300699fff89a97100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants