Add x-workflow-run-id header to queue messages#922
Conversation
🦋 Changeset detectedLatest commit: 1f4bfa8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
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 |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (169 failed)mongodb (42 failed):
redis (42 failed):
starter (43 failed):
turso (42 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
Pass the workflow run ID as a custom header when enqueueing messages, enabling better observability and correlation with VQS server logs. - Add headers field to QueueOptions interface in @workflow/world - Pass headers through to VQS client in @workflow/world-vercel - Include x-workflow-run-id header in all queueMessage calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This version includes the headers support needed for passing x-workflow-run-id to VQS. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
73a8e69 to
3e4acb7
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds support for custom headers in queue messages and includes the x-workflow-run-id header in all workflow and step queue messages for better observability and correlation.
Changes:
- Updated
@vercel/queuedependency from version 0.0.0-alpha.34 to 0.0.0-alpha.36 to enable headers support - Added
headersfield toQueueOptionsinterface in@workflow/worldpackage - Updated
@workflow/world-vercelto pass headers through to the VQS client - Added
x-workflow-run-idheader to allqueueMessage()calls in step-handler and suspension-handler
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Updates VQS client dependency version to alpha.36 |
| pnpm-lock.yaml | Updates lock file with new VQS client version |
| packages/world/src/queue.ts | Adds optional headers field to QueueOptions interface |
| packages/world-vercel/src/queue.ts | Passes headers option through to VQS client's send method |
| packages/core/src/runtime/suspension-handler.ts | Includes x-workflow-run-id header when queueing step messages |
| packages/core/src/runtime/step-handler.ts | Includes x-workflow-run-id header when queueing workflow messages |
| .changeset/add-queue-headers-support.md | Documents the change for changelog generation |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Custom headers are now spread first in the fetch headers so that system headers (x-vqs-*, content-type) take precedence and cannot be overridden. Also adds TODO comment in world-postgres noting headers are not propagated. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| requestedAt: new Date(), | ||
| }, | ||
| { | ||
| headers: { 'x-workflow-run-id': workflowRunId }, |
There was a problem hiding this comment.
including this so we can log it on the queue server and eventually in sfr/proxy for correlation back to logs
…-parallelization * origin/main: Add x-workflow-run-id header to queue messages (#922) Bump Next.js and React in workbenches (#944) Add subpath export resolution for package IDs (#901) Consolidate console logging to structured logger utility (#935) # Conflicts: # packages/core/src/runtime/step-handler.ts
* Add x-workflow-run-id header to queue messages Pass the workflow run ID as a custom header when enqueueing messages, enabling better observability and correlation with VQS server logs. - Add headers field to QueueOptions interface in @workflow/world - Pass headers through to VQS client in @workflow/world-vercel - Include x-workflow-run-id header in all queueMessage calls Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Upgrade @vercel/queue to 0.0.0-alpha.36 This version includes the headers support needed for passing x-workflow-run-id to VQS. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Pass custom headers through world-local queue implementation Custom headers are now spread first in the fetch headers so that system headers (x-vqs-*, content-type) take precedence and cannot be overridden. Also adds TODO comment in world-postgres noting headers are not propagated. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Summary
headersfield toQueueOptionsinterface in@workflow/world@workflow/world-vercelx-workflow-run-idheader in allqueueMessage()calls from step-handler and suspension-handlerThis enables correlation of queue messages with workflow runs for better observability.
Dependencies
Test plan
@workflow/coretests pass@workflow/world-vercelbuilds successfully🤖 Generated with Claude Code