Add SDK version to workflow run executionContext for observability#868
Conversation
Wire `@workflow/core` package version through the `executionContext` field when creating workflow runs. Display the version in the observability UI attribute panel. Uses genversion for build-time version injection. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 2cba1d2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (161 failed)mongodb (40 failed):
redis (40 failed):
starter (41 failed):
turso (40 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
There was a problem hiding this comment.
Pull request overview
Adds @workflow/core SDK version metadata to workflow run context and surfaces it in the observability UI.
Changes:
- Generate a build-time
src/version.tsin@workflow/coreviagenversionand injectworkflowCoreVersionintoexecutionContextwhen creating runs. - Display
workflowCoreVersionin the web attribute panel (ordered afterspecVersion). - Misc formatting/lockfile updates.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds genversion and updates lock snapshots. |
| packages/core/src/runtime/start.ts | Injects workflowCoreVersion into executionContext on run_created. |
| packages/core/package.json | Runs genversion during build/dev/typecheck and cleans generated file. |
| packages/core/.gitignore | Ignores generated src/version.ts. |
| packages/web-shared/src/sidebar/attribute-panel.tsx | Adds workflowCoreVersion attribute and attempts to extract it from executionContext. |
| packages/next/src/builder.ts | Formatting-only change to regex block. |
| packages/cli/bin/run.js | Formatting-only change to warning logging. |
| .changeset/wire-workflow-version.md | Changeset to publish patch releases for core + web-shared. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Extract workflowCoreVersion from executionContext for display | ||
| const displayData = useMemo(() => { | ||
| const result = { ...data }; | ||
| const execCtx = data.executionContext as | ||
| | Record<string, unknown> | ||
| | undefined; | ||
| if (execCtx?.workflowCoreVersion) { | ||
| result.workflowCoreVersion = execCtx.workflowCoreVersion; | ||
| } | ||
| return result; | ||
| }, [data]); |
There was a problem hiding this comment.
displayData extracts workflowCoreVersion from data.executionContext, but executionContext appears to be stripped server-side by hydrateResourceIO (see @workflow/core/observability removing executionContext). As a result, the UI likely never receives executionContext and this field will not render. Consider hoisting workflowCoreVersion into the returned run/step/hook shape before hydration strips executionContext, or adjust hydration to preserve executionContext.workflowCoreVersion while still omitting sensitive fields like traceCarrier.
| // Extract workflowCoreVersion from executionContext for display | |
| const displayData = useMemo(() => { | |
| const result = { ...data }; | |
| const execCtx = data.executionContext as | |
| | Record<string, unknown> | |
| | undefined; | |
| if (execCtx?.workflowCoreVersion) { | |
| result.workflowCoreVersion = execCtx.workflowCoreVersion; | |
| } | |
| return result; | |
| }, [data]); | |
| // Memoized view of data used for attribute display | |
| const displayData = useMemo(() => ({ ...data }), [data]); |
| "build": "genversion --es6 src/version.ts && tsc", | ||
| "dev": "genversion --es6 src/version.ts && tsc --watch", | ||
| "clean": "tsc --build --clean && rm -rf dist src/version.ts", | ||
| "test": "cross-env WORKFLOW_TARGET_WORLD=local vitest run src", | ||
| "test:e2e": "vitest run e2e", | ||
| "typecheck": "tsc --noEmit" | ||
| "typecheck": "genversion --es6 src/version.ts && tsc --noEmit" |
There was a problem hiding this comment.
build now generates src/version.ts, but Turborepo’s root build task only declares dist/** as an output. If the build task is satisfied from cache (especially in CI/remote caching), src/version.ts may not be present for downstream tasks (notably test, which runs against src and does not run genversion). Consider adding packages/core/turbo.json (like packages/world-vercel/turbo.json) to include src/version.ts in build.outputs, or alternatively generate src/version.ts in the test script as well.
- Extract workflowCoreVersion from executionContext in hydrateResourceIO before stripping the context (addresses Copilot review comment) - Add turbo.json to include src/version.ts in build outputs for caching Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use a display name mapping to render the attribute as "@workflow/core version" in the observability UI for better readability. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verification CompleteThe Verified locally:
E2E Tests: All 45 tests passed locally against turbopack. Changes in this PR:
|
TooTallNate
left a comment
There was a problem hiding this comment.
Should be the version of the workflow package, not @workflow/core, right?
Vercel World VerificationConfirmed that From the CI logs of {
"runId": "wrun_01KG0K0WSY5KPNZRVJBW2HMQSP",
"status": "completed",
"deploymentId": "dpl_EP7h7F3eDGxrPXzbVHF4uig6Ufo2",
"workflowName": "workflow//example/workflows/99_e2e.ts//addTenWorkflow",
"specVersion": 2,
"input": [123],
"output": 133,
"workflowCoreVersion": "4.0.1-beta.41"
}The version is being stored in
|
Vercel World Screenshot VerificationConfirmed: Screenshot Details:
Attribute Panel shows:
Screenshot saved at: To add the screenshot to this PR, drag and drop the image file into the PR description edit box. |
TooTallNate
left a comment
There was a problem hiding this comment.
In a follow-up we should update changesets' configuration to keep workflow and @workflow/core package version numbers in sync.
karthikscale3
left a comment
There was a problem hiding this comment.
Tested and looks great!
will do |
Done in #871 |
…s-and-commands * origin/main: fix(@workflow/ai): support provider-executed tools (AI SDK v6) (#734) Publish "workflow" and "@workflow/core" package versions in sync (#870) Add SDK version to workflow run executionContext for observability (#868) Allow recreateRun to accept an optional deploymentId parameter (#869) Add support for top-level `using` declarations inside of step / workflow functions (#866) docs: URL in docs was missing the docs/ prefix, 404 errors (#852) Add "classes" object to `manifest.json` file (#864) Fix Nest workbench app build (#865) Ignore Astro on local dev tests for source map e2e tests (#863) Enable custom class serialization transformations for "client" mode (#860) Submit request bodies with CBOR encoding (#844) [world-vercel] Update queue to use VQS v3 API (#799) NestJS framework support (#840) Fix resolve hook theming and token fetching. (#856) docs: rename Control Flow Patterns to Common Patterns and add new content (#846) docs: revamp World documentation pages (#763) Remove unused `getWritable` stub function (#855) # Conflicts: # packages/core/package.json # pnpm-lock.yaml
Summary
@workflow/corepackage version through theexecutionContextfield when creating workflow runsspecVersion@workflow/world-vercel)Local
Vercel
Changes
@workflow/core:workflowCoreVersionintoexecutionContextinstart()turbo.jsonto includesrc/version.tsin build outputs for cachinghydrateResourceIOto extractworkflowCoreVersionbefore strippingexecutionContext@workflow/web-shared:workflowCoreVersionfromexecutionContextin attribute panel@workflow/core versionfor readabilityVerification
E2E Tests: All 45 tests passed locally against turbopack
Observability UI: Verified locally - the attribute panel now shows:
Test plan
@workflow/core versionappears in observability UI🤖 Generated with Claude Code