Skip to content

NewGuid, SetCustomStatus, sendevent between orchestrations api support#86

Merged
YunchuWang merged 16 commits intomainfrom
wangbill/contextapi
Feb 3, 2026
Merged

NewGuid, SetCustomStatus, sendevent between orchestrations api support#86
YunchuWang merged 16 commits intomainfrom
wangbill/contextapi

Conversation

@YunchuWang
Copy link
Member

@YunchuWang YunchuWang commented Feb 3, 2026

Summary

What changed?

-Added newGuid() API to OrchestrationContext that generates deterministic UUIDs using UUID v5 (RFC 4122 §4.3)
-Added setCustomStatus() API to set/retrieve custom orchestration status
-Added sendEvent() API for orchestration-to-orchestration communication (fire-and-forget)
-Fixed setComplete() and setFailed() to preserve fire-and-forget actions (sendEvent) instead of clearing all pending actions

Why is this change needed?

These APIs are required for parity with the .NET and Python Durable Task SDKs
newGuid() allows orchestrations to generate deterministic GUIDs that are consistent across replays
setCustomStatus() enables orchestrations to report progress/state that can be queried externally
sendEvent() enables orchestration-to-orchestration communication patterns

Issues / work items

  • Resolves #
  • Related #

Project checklist

  • Release notes are not required for the next release
    • Otherwise: Notes added to CHANGELOG.md
  • Backport is not required
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • All required tests have been added/updated (unit tests, E2E tests)
  • Breaking change?
    • If yes:
      • Impact:
      • Migration guidance:

AI-assisted code disclosure (required)

Was an AI tool used? (select one)

  • No
  • Yes, AI helped write parts of this PR (e.g., GitHub Copilot)
  • Yes, an AI agent generated most of this PR

If AI was used:

  • Tool(s):
  • AI-assisted areas/files:
  • What you changed after AI output:

AI verification (required if AI was used):

  • I understand the code and can explain it
  • I verified referenced APIs/types exist and are correct
  • I reviewed edge cases/failure paths (timeouts, retries, cancellation, exceptions)
  • I reviewed concurrency/async behavior
  • I checked for unintended breaking or behavior changes

Testing

Automated tests

  • Result: Passed / Failed (link logs if failed)

Manual validation (only if runtime/behavior changed)

  • Environment (OS, Node.js version, components):
  • Steps + observed results:
    1.
    2.
    3.
  • Evidence (optional):

Notes for reviewers

  • N/A

Copilot AI review requested due to automatic review settings February 3, 2026 00:51
@YunchuWang YunchuWang changed the title Wangbill/contextapi NewGuid, SetCustomStatus, sendevent between orchestrations api support Feb 3, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements three new orchestration context API methods to improve feature parity between the JavaScript/TypeScript SDK and the .NET SDK: newGuid(), setCustomStatus(), and sendEvent().

Changes:

  • Added newGuid() method for generating deterministic UUIDs (v5) during orchestration replay
  • Added setCustomStatus() method for setting custom status values on orchestration instances
  • Added sendEvent() method for sending events from one orchestration to another
  • Modified OrchestrationExecutor to return a result object containing both actions and custom status
  • Added comprehensive unit and E2E tests for all three new methods
  • Created feature parity documentation tracking differences with the .NET SDK

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/durabletask-js/src/task/context/orchestration-context.ts Added abstract method declarations for newGuid(), setCustomStatus(), and sendEvent()
packages/durabletask-js/src/worker/runtime-orchestration-context.ts Implemented the three new methods with UUID v5 generation algorithm and custom status management
packages/durabletask-js/src/worker/orchestration-executor.ts Changed return type to OrchestrationExecutionResult to include custom status alongside actions
packages/durabletask-js/src/worker/task-hub-grpc-worker.ts Updated to extract and set custom status from execution result in orchestrator response
packages/durabletask-js/src/utils/pb-helper.util.ts Added newSendEventAction() helper for creating send event actions
packages/durabletask-js/test/orchestration_context_methods.spec.ts New unit test file with comprehensive tests for all three new methods
packages/durabletask-js/test/orchestration_executor.spec.ts Updated all existing tests to use new OrchestrationExecutionResult return type
test/e2e-azuremanaged/orchestration.spec.ts Added E2E tests for the new methods and support for connection string configuration
docs/FEATURE_PARITY.md New documentation tracking feature parity between JS and .NET SDKs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@YunchuWang
Copy link
Member Author

@copilot update pr description to follow .github/PULL_REQUEST_TEMPLATE.md

Copy link
Contributor

Copilot AI commented Feb 3, 2026

@YunchuWang I've opened a new pull request, #87, to work on those changes. Once the pull request is ready, I'll request review from you.

@YunchuWang YunchuWang merged commit da2982b into main Feb 3, 2026
7 checks passed
@YunchuWang YunchuWang deleted the wangbill/contextapi branch February 3, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants