Skip to content

Add orchestration cloning with explicit target IDs and optional versions - #312

Draft
Varshitha Bachu (bachuv) with Copilot wants to merge 6 commits into
mainfrom
copilot/add-native-sdk-api-cloning
Draft

Varshitha Bachu (bachuv) with Copilot wants to merge 6 commits into
mainfrom
copilot/add-native-sdk-api-cloning

Conversation

Copilot AI commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Issue describing the changes in this PR

Resolves #311.

Support restarting an orchestration from the beginning with its original name and input, a required target instance ID, and an optional version override. Execution history is not copied.

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes are added to the CHANGELOG.md
  • I have added all required tests (Unit tests, E2E tests)

Additional information

  • Add restartInstance(instanceId, RestartInstanceOptions) with fluent setNewInstanceId and setVersion options. Null options and missing or blank target IDs are rejected before the RPC.
  • Preserve the existing restartInstance(instanceId, boolean) overload and its behavior.
  • An omitted or null version preserves the backend's default restart behavior; "" explicitly selects an unversioned orchestration.
  • Add nullable TaskOrchestrationContext.getSourceInstanceId(). Clones expose their immediate source during execution and replay; sub-orchestrations do not inherit this reference.
  • Use the backend restart RPC without falling back to scheduling a new orchestration. Requires a backend supporting explicit restart targets and versions.
  • Pin protobuf generation to the upstream explicit-target/version contract.
client.restartInstance("order-123",
    new RestartInstanceOptions()
        .setNewInstanceId("order-123-retry")
        .setVersion("2.0"));

// Inside the clone:
ctx.getInstanceId();       // "order-123-retry"
ctx.getSourceInstanceId(); // "order-123"
ctx.getVersion();          // "2.0"

Cloning order-123-retry again exposes order-123-retry as the immediate source, rather than order-123.

Focused tests cover version presence, required options and IDs, chained clones, backend errors, legacy behavior, and replay/sub-orchestration isolation.

Co-authored-by: bachuv <15795068+bachuv@users.noreply.github.com>
Copilot AI changed the title [WIP] Add API for orchestration cloning with target ID Add orchestration cloning with explicit target IDs and optional versions Nov 4, 2026
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.

Support orchestration cloning

2 participants