microsoft / microsoft/durabletask-java
ContinueAsNew does not support specifying a new orchestration version
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 29
- Forks
- 18
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 2
Description
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)andcontinueAsNew(Object input, boolean preserveUnprocessedEvents)— no version parameter - Java executor:
CompleteOrchestrationAction.Buildernever callssetNewVersion()
Proposed fix
Follow the pattern from the .NET SDK (microsoft/durabletask-dotnet#682):
- Add a
ContinueAsNewOptionsclass withnewInput,preserveUnprocessedEvents, andnewVersionproperties - Add a
continueAsNew(ContinueAsNewOptions options)overload toTaskOrchestrationContext - In
TaskOrchestrationExecutor, whennewVersionis non-null, callbuilder.setNewVersion(StringValue.of(newVersion))on theCompleteOrchestrationAction
Related
- .NET SDK implementation: microsoft/durabletask-dotnet#682
- Azure Functions extension: Azure/azure-functions-durable-extension#3404
- Proto field:
CompleteOrchestrationAction.newVersion(field 4) inorchestrator_service.proto
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating TaskOrchestrationContext and TaskOrchestrationExecutor, then inspect the existing continueAsNew overloads and CompleteOrchestrationAction construction. Use the .NET SDK issue linked in the description as a reference for the proposed options shape. Done means Java callers can provide a new version and the executor populates CompleteOrchestrationAction.newVersion while preserving current behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, distributed-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100