Add features.encryption to WorkflowMetadata#1652
Conversation
Expose a `features` object on `getWorkflowMetadata()` so library authors can detect at runtime whether encryption is enabled for the current workflow run, allowing them to conditionally handle sensitive data serialization.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: a952244 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 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 (65 failed)mongodb (4 failed):
redis (3 failed):
turso (58 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: Nitro | Next.js (Turbopack) | Express workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) 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 | Express | Next.js (Turbopack) Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 10 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 25 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro workflow with 50 sequential data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 10 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 25 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) workflow with 50 concurrent data payload steps (10KB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) stream pipeline with 5 transform steps (1MB)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express 10 parallel streams (1MB each)💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) fan-out fan-in 10 streams (1MB each)💻 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:
|
There was a problem hiding this comment.
Pull request overview
This PR exposes whether run-level encryption is enabled via a new features.encryption flag on WorkflowMetadata (returned by getWorkflowMetadata()), so libraries can adjust how they handle sensitive data.
Changes:
- Extend
WorkflowMetadatawithfeatures: { encryption: boolean }. - Populate
features.encryptionin both workflow VM context and step execution context. - Add/update E2E + unit tests and document the new field.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| workbench/example/workflows/99_e2e.ts | Includes features in returned workflow metadata payload for E2E validation. |
| packages/core/src/workflow/get-workflow-metadata.ts | Adds features.encryption to the exported WorkflowMetadata type. |
| packages/core/src/workflow.ts | Populates features.encryption in the workflow VM global context. |
| packages/core/src/runtime/step-handler.ts | Populates features.encryption in step AsyncLocalStorage context. |
| packages/core/src/step/writable-stream.test.ts | Updates test fixtures to include new required metadata fields. |
| packages/core/src/serialization.test.ts | Updates test fixture context to include features. |
| packages/core/e2e/e2e.test.ts | Adds E2E assertions for features.encryption presence/type and step metadata exclusion. |
| docs/content/docs/api-reference/workflow/get-workflow-metadata.mdx | Documents features.encryption with an example. |
| .changeset/features-encryption-metadata.md | Adds a changeset for releasing the new metadata field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Step inputs are serialized before the step body runs, so the encryption check should happen in the workflow function before passing data to steps.
Step return values are serialized to the event log after the step body runs, so this is where the check is actually useful - controlling what data gets persisted as output.
…encryption-metadata
Summary
featuresobject toWorkflowMetadata(returned bygetWorkflowMetadata()) with anencryption: booleanfield indicating whether encryption is enabled for the current workflow runencryptionKeyalready threaded through both workflow VM and step contextsUsage
Changes
packages/core/src/workflow/get-workflow-metadata.ts— Addedfeatures: { encryption: boolean }toWorkflowMetadatainterfacepackages/core/src/workflow.ts— Populatefeaturesin workflow VM contextpackages/core/src/runtime/step-handler.ts— Populatefeaturesin step contextworkbench/example/workflows/99_e2e.ts+packages/core/e2e/e2e.test.ts— E2E coveragepackages/core/src/serialization.test.ts,packages/core/src/step/writable-stream.test.ts— Updated test fixturesdocs/content/docs/api-reference/workflow/get-workflow-metadata.mdx— Documented the new field with example