Skip to content

ContinueAsNew does not support specifying a new orchestration version #276

@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) has existed since the initial proto commit, but the Java SDK never populates it.

Problem

TaskOrchestrationContext.continueAsNew() only accepts (Object input, boolean preserveUnprocessedEvents). There is no parameter to pass a new version. In TaskOrchestrationExecutor, when building the CompleteOrchestrationAction, setNewVersion() is never called — the field is always left empty.

This prevents version migration scenarios for long-running/eternal orchestrations (e.g., monitoring loops that need to evolve their logic over time via continueAsNew with a new version).

What exists today

  • Proto layer: CompleteOrchestrationAction.newVersion (field 4) is defined and supported by all backends (DurableTask.Core since 2014, DTS/Beskar, gRPC sidecar)
  • Java API: continueAsNew(Object input) and continueAsNew(Object input, boolean preserveUnprocessedEvents) — no version parameter
  • Java executor: CompleteOrchestrationAction.Builder never calls setNewVersion()

Proposed fix

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

  1. Add a ContinueAsNewOptions class with newInput, preserveUnprocessedEvents, and newVersion properties
  2. Add a continueAsNew(ContinueAsNewOptions options) overload to TaskOrchestrationContext
  3. In TaskOrchestrationExecutor, when newVersion is non-null, call builder.setNewVersion(StringValue.of(newVersion)) on the CompleteOrchestrationAction

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions