Make serialization functions async with Encryptor interface#955
Make serialization functions async with Encryptor interface#955TooTallNate wants to merge 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 7b2edf6 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 (163 failed)mongodb (40 failed):
redis (40 failed):
starter (42 failed):
turso (41 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
This PR adds encryption support infrastructure to the Workflow SDK as a no-op refactor, preparing for future E2E encryption implementation. It introduces Encryptor, EncryptionContext, and KeyMaterial interfaces to @workflow/world, extends the World interface to include optional encryption methods, and converts all 8 serialization functions (dehydrate/hydrate) to async with new runId and encryptor parameters.
Changes:
- Added encryption interfaces (
Encryptor,EncryptionContext,KeyMaterial) to@workflow/worldpackage - Made all 8 serialization functions async and added
runIdandencryptorparameters (unused in this PR, prefixed with_) - Updated
WorkflowOrchestratorContextto includerunIdandworldfor threading encryption context through workflow lifecycle - Updated all 200+ call sites across runtime, step handlers, hook handlers, CLI, web-shared, workbenches, and tests to await async hydration and pass new parameters
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/world/src/interfaces.ts | Added Encryptor, EncryptionContext, KeyMaterial interfaces; extended World to include Encryptor |
| packages/core/src/serialization.ts | Converted all 8 dehydrate/hydrate functions to async with new runId and encryptor parameters |
| packages/core/src/serialization.test.ts | Added test wrapper functions to maintain backward-compatible signatures for existing tests |
| packages/core/src/workflow.ts | Updated runWorkflow to accept world parameter and pass it through orchestrator context |
| packages/core/src/private.ts | Added runId and world to WorkflowOrchestratorContext interface |
| packages/core/src/workflow/hook.ts | Updated to use async hydration with .then()/.catch() pattern in event consumer |
| packages/core/src/step.ts | Updated to use async hydration with .then()/.catch() pattern in event consumer |
| packages/core/src/runtime/*.ts | Updated start, run, step-handler, suspension-handler, resume-hook to await async serialization |
| packages/core/src/observability.ts | Converted all hydration helper functions to async and properly await them |
| packages/cli/src/lib/inspect/output.ts | Updated all hydration calls to properly await and pass world |
| packages/web-shared/src/api/workflow-server-actions.ts | Converted hydrate helper to async and updated all callers to await |
| workbench//api/trigger | All 15 workbench trigger endpoints updated to await hydration and pass empty runId/encryptor |
| packages/core/e2e/e2e.test.ts | Removed withResolvers import and updated dehydrateWorkflowArguments call (missing cleanup on lines 96-97) |
| packages/core/e2e/bench.bench.ts | Properly removed all references to ops variable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
3e3830d to
f99520a
Compare
d880bc8 to
162847a
Compare
f99520a to
96619e7
Compare
162847a to
ede75a0
Compare
13c6991 to
7b2edf6
Compare

Summary
Encryptor,EncryptionContext, andKeyMaterialinterfaces to@workflow/worldWorldextendEncryptor(all methods are optional, so existing implementations are unaffected)serialization.tstoasyncwith newrunIdandencryptorparametersrunIdandworldtoWorkflowOrchestratorContextfor threading encryption context through the workflow lifecycleThis is a no-op refactor — the
encryptorparameter is unused (prefixed with_) in this PR. All callers pass{}as the encryptor. The actual encryption logic will be wired in a subsequent PR.Stack
runIdclient-side instart()and simplify streaming types #954 (Generate runId client-side in start())Test plan
All 303 core tests pass. Build succeeds.