Parent Orchestration Access For SubOrchestration#92
Merged
YunchuWang merged 6 commits intomainfrom Feb 4, 2026
Merged
Conversation
…ions - Introduced ParentOrchestrationInstance type to represent details of the parent orchestration. - Updated OrchestrationContext to include a parent property for accessing parent orchestration details. - Enhanced newExecutionStartedEvent function to accept parent instance information. - Modified OrchestrationExecutor to extract and set parent instance info during execution. - Added tests to verify parent orchestration info is correctly handled in sub-orchestrations. - Created FEATURE_PARITY.md to document feature comparison between durabletask-js and durabletask-dotnet.
…tion or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR implements parent orchestration access for sub-orchestrations, allowing orchestrations to access information about their parent when they are invoked as sub-orchestrations. The implementation adds a new ParentOrchestrationInstance type that exposes the parent's name, instance ID, and task scheduled ID through the OrchestrationContext.parent property.
Changes:
- Added
ParentOrchestrationInstanceinterface with parent orchestration metadata (name, instanceId, taskScheduledId) - Extended
OrchestrationContextwith abstractparentgetter property - Implemented parent info extraction in
OrchestrationExecutorfrom protobuf events - Added comprehensive unit tests and E2E tests for the feature
- Created extensive feature parity documentation comparing durabletask-js with durabletask-dotnet
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/durabletask-js/src/types/parent-orchestration-instance.type.ts | Defines the ParentOrchestrationInstance interface with documentation |
| packages/durabletask-js/src/task/context/orchestration-context.ts | Adds abstract parent property to OrchestrationContext |
| packages/durabletask-js/src/worker/runtime-orchestration-context.ts | Implements parent property storage in runtime context |
| packages/durabletask-js/src/worker/orchestration-executor.ts | Extracts parent info from ExecutionStartedEvent and populates context |
| packages/durabletask-js/src/utils/pb-helper.util.ts | Updates test helper to support parent instance info in event creation |
| packages/durabletask-js/src/index.ts | Exports ParentOrchestrationInstance type for public API |
| packages/durabletask-js/test/parent-orchestration-instance.spec.ts | Comprehensive unit tests for parent orchestration feature |
| test/e2e-azuremanaged/orchestration.spec.ts | E2E tests validating parent info in real orchestration scenarios |
| docs/FEATURE_PARITY.md | New documentation comparing feature parity with .NET SDK |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/durabletask-js/test/parent-orchestration-instance.spec.ts
Outdated
Show resolved
Hide resolved
packages/durabletask-js/test/parent-orchestration-instance.spec.ts
Outdated
Show resolved
Hide resolved
kaibocai
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What changed?
ParentOrchestrationInstancetype to expose parent orchestration information in sub-orchestrationsparentproperty toOrchestrationContextbase classparentgetter inRuntimeOrchestrationContextthat extracts parent info fromExecutionStartedEventorchestration-executor.tsto extractParentInstanceInfofrom protobuf eventsnewExecutionStartedEventhelper to supportparentInstanceparameter for testingParentOrchestrationInstancetype from package indexWhy is this change needed?
context.Parentfor sub-orchestrationsIssues / work items
Project checklist
CHANGELOG.mdAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
src/types/parent-orchestration-instance.type.ts(new file)src/task/context/orchestration-context.ts(added abstract property)src/worker/runtime-orchestration-context.ts(implemented parent getter)src/worker/orchestration-executor.ts(extract parent from events)src/utils/pb-helper.util.ts(test helper update)src/index.ts(export)test/parent-orchestration-instance.spec.ts(new unit tests)test/e2e-azuremanaged/orchestration.spec.ts(new E2E tests)docs/FEATURE_PARITY.md(documentation update)AI verification (required if AI was used):
Testing
Automated tests
Unit tests (5 new tests)
E2E tests (2 new tests)
Manual validation (only if runtime/behavior changed)
npm run test:e2e:azuremanaged:internalExecutionStartedEventNotes for reviewers
taskScheduledIdfield is included in theParentOrchestrationInstanceinterface (optional). This differs slightly from .NET which doesn't expose it publicly, but the proto supports it and it can be useful for debugging.durabletask-dotnet/src/Worker/Core/Shims/TaskOrchestrationContextWrapper.cs