Skip to content

Track Vercel request IDs on workflow events for logs correlation#1396

Open
karthikscale3 wants to merge 57 commits intomainfrom
karthik/logs-correlation
Open

Track Vercel request IDs on workflow events for logs correlation#1396
karthikscale3 wants to merge 57 commits intomainfrom
karthik/logs-correlation

Conversation

@karthikscale3
Copy link
Collaborator

Summary

  • Captures the x-vercel-id header from incoming VQS requests using AsyncLocalStorage and threads it through the entire workflow and step execution pipeline
  • Every world.events.create() call now forwards the request ID as vercelId in the event creation payload, enabling correlation between Vercel platform request logs and workflow events
  • Adds requestId to the CreateEventParams interface (@workflow/world) and the queue handler metadata, making this available to all world implementations

Changes

  • @workflow/world: Added requestId to CreateEventParams and queue handler metadata types
  • @workflow/world-vercel: Extracts x-vercel-id from the incoming request header via AsyncLocalStorage, passes it as vercelId in event creation POST bodies
  • @workflow/core: Plumbs requestId from queue metadata through the runtime, step handler, and suspension handler to all event creation calls (run_started, run_completed, run_failed, step_started, step_completed, step_failed, step_retried, hooks, waits)

Test plan

  • Verify x-vercel-id header is correctly captured from VQS callback requests
  • Confirm vercelId appears in event creation payloads to workflow-server
  • Validate existing e2e tests pass (no behavioral change, additive only)

karthikscale3 and others added 2 commits March 16, 2026 13:29
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Karthik Kalyan <105607645+karthikscale3@users.noreply.github.com>
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