Repository navigation
feat(functions): expose sub-orchestration tags - #382
Merged
wangbill (YunchuWang) merged 3 commits intoOct 7, 2026
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e0af01a5-0dfa-4e71-a660-c4186e65d7e0
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The options discriminator dereferences null, breaking previously tolerated positional JavaScript calls.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Exposes tagged sub-orchestration scheduling through the Azure Functions facade while preserving positional overloads.
Changes:
- Adds and exports
SubOrchestrationOptions. - Adds options-object overloads with tag snapshotting.
- Tests initial and retried tag propagation.
| File | Description |
|---|---|
src/orchestration-context.ts |
Adds options normalization and overloads. |
src/index.ts |
Exports the new options type. |
test/unit/worker.spec.ts |
Tests tag forwarding and retries. |
CHANGELOG.md |
Documents the API addition. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e0af01a5-0dfa-4e71-a660-c4186e65d7e0
kaibocai (kaibocai)
approved these changes
Oct 7, 2026
wangbill (YunchuWang)
deleted the
yunchuwang-expose-sub-orchestration-tags
branch
October 7, 2026 15:58
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?
SubOrchestrationOptionstype withinstanceId,version, andtags.callSubOrchestrator()andcallSubOrchestratorWithRetry()while retaining the existing positional overloads.the original tag values.
tags through the Durable client after completion.
Why is this change needed?
azure-functions-durablefacade had no public path for supplying those tags.existing positional calls.
Issues / work items
Project checklist
CHANGELOG.mdAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
unit tests, plus the Functions Host E2E app route and Jest coverage.
unrelated formatting churn was removed, and the real provider path was validated locally.
AI verification (required if AI was used):
Testing
Automated tests
npm test -w durable-functions -- --runTestsByPath test/unit/worker.spec.tsfailed on the missing public
SubOrchestrationOptionsexport and object overloads before theproduction change.
npm test -w durable-functions -- --runTestsByPath test/unit/orchestration-context.spec.ts test/unit/worker.spec.ts(40 passed).npm test -w @microsoft/durabletask-js -- --runTestsByPath test/orchestration_executor.spec.ts --testNamePattern "include tags on scheduled sub-orchestration actions|handle sub-orchestration retry with handler"(2 passed, 90 skipped).npm run build -w durable-functions.options-object calls with
npx tsc --noEmit --strict --target ES2022 --module commonjs --moduleResolution node --esModuleInterop --skipLibCheck.npx eslint packages\azure-functions-durable\src\orchestration-context.ts packages\azure-functions-durable\src\index.ts packages\azure-functions-durable\test\unit\worker.spec.ts.git diff --checkpassed.The worker test and changelog retain their existing full-file Prettier debt in both
origin/mainand this branch rather than introducing unrelated reformatting.
origin/main(expected):npm run test:e2e:functions:internal -- --runTestsByPath test/e2e-functions/sub-orchestration-tags.spec.tslaunched the real host and failed, non-skipped,after the parent remained
Runningfor 60 seconds because the old positional facade interpretedthe options object as the child instance ID.
test used the in-repo packages, real
func start, Preview extension bundle, and Azurite-backedAzureStorage provider, then asserted the child metadata contained exactly
{ environment: "functions-e2e", empty: "" }.npm run build -w durable-functionsandnpm run build --prefix test\e2e-functions\test-apppassed.normally ignored app file explicitly); scoped Prettier passed for all three E2E files.
functions-e2e (node 22.x)passed on commit7f31612815774d0b50c13ec56fea291ed5276883. Its log reportsPASS test/e2e-functions/sub-orchestration-tags.spec.ts, 15/15 suites passed, and 43 testspassed. The new file contains one ordinary (non-skipped) test.
samples, build, and CLA.
Manual validation (only if runtime/behavior changed)
Tools; Preview extension bundle
[4.29.0, 5.0.0); Azurite/AzureStorage provider.func startharness with in-repodurable-functionsand core packages.explicit tags, including an empty-string value.
test-only HTTP endpoint backed by the real Durable client, and observed the exact persisted tag
map.
AzureStorage/Azurite provider path, not the Azure Durable Task Scheduler service.
Notes for reviewers
TaskOrchestrationContextWrapper.csat8f1b135,which forwards
options.Tagsfor retry and non-retry sub-orchestration paths.SubOrchestrationOptionstestpins tags alongside instance ID, version, and retry configuration.
origin/main(expected RED) and this branch (GREEN). The hosted full Functions E2E suite passed.