Skip to content

continueAsNew does not support specifying a new orchestration version #205

@YunchuWang

Description

@YunchuWang

Summary

The continueAsNew() API does not expose a way to specify a new orchestration version for the restarted instance. The underlying protobuf field (CompleteOrchestrationAction.newVersion, field 4) exists in the proto definition, but the TypeScript SDK never populates it.

Problem

OrchestrationContext.continueAsNew() only accepts (newInput: any, saveEvents: boolean). There is no parameter to pass a new version.

In src/utils/pb-helper.util.ts, newCompleteOrchestrationAction() does not accept a newVersion parameter and never calls .setNewversion() on the CompleteOrchestrationAction — the field is always left unset.

This prevents version migration scenarios for long-running/eternal orchestrations.

What exists today

  • Proto layer: CompleteOrchestrationAction.newVersion (field 4) is defined in orchestrator_service.proto and supported by all backends
  • TS API: continueAsNew(newInput: any, saveEvents: boolean) — no version parameter
  • pb-helper: newCompleteOrchestrationAction() doesn't accept or set newVersion

Proposed fix

Follow the pattern from the .NET SDK (microsoft/durabletask-dotnet#682):

  1. Add a ContinueAsNewOptions interface with newInput, saveEvents, and newVersion properties
  2. Add a continueAsNew(options: ContinueAsNewOptions) overload (or add optional newVersion parameter)
  3. In pb-helper.util.ts, update newCompleteOrchestrationAction() to accept and set newVersion via .setNewversion()
  4. Wire through from runtime-orchestration-context.ts setContinuedAsNew()

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions