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 generated Go code, but the SDK never populates it.
Problem
OrchestrationContext.ContinueAsNew() accepts (newInput any, options ...ContinueAsNewOption), but the only available option is WithKeepUnprocessedEvents(). There is no WithNewVersion() option.
In internal/helpers/history.go, NewCompleteOrchestrationAction() does not accept a newVersion parameter and never sets the NewVersion field on the proto struct — it always defaults to nil.
This prevents version migration scenarios for long-running/eternal orchestrations.
What exists today
- Proto layer:
CompleteOrchestrationAction.NewVersion (*wrappers.StringValue, field 4) is defined in orchestrator_service.pb.go and supported by all backends
- Go API:
ContinueAsNew(newInput any, options ...ContinueAsNewOption) — no version option
- Helper:
NewCompleteOrchestrationAction() doesn't accept or set NewVersion
Proposed fix
- Add a
WithNewVersion(version string) ContinueAsNewOption functional option
- Store the version on
OrchestrationContext (e.g., continuedAsNewVersion field)
- In
setContinuedAsNew(), pass the version to NewCompleteOrchestrationAction()
- Update
NewCompleteOrchestrationAction() to accept and set NewVersion on the proto
Related
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 generated Go code, but the SDK never populates it.Problem
OrchestrationContext.ContinueAsNew()accepts(newInput any, options ...ContinueAsNewOption), but the only available option isWithKeepUnprocessedEvents(). There is noWithNewVersion()option.In
internal/helpers/history.go,NewCompleteOrchestrationAction()does not accept anewVersionparameter and never sets theNewVersionfield on the proto struct — it always defaults to nil.This prevents version migration scenarios for long-running/eternal orchestrations.
What exists today
CompleteOrchestrationAction.NewVersion(*wrappers.StringValue, field 4) is defined inorchestrator_service.pb.goand supported by all backendsContinueAsNew(newInput any, options ...ContinueAsNewOption)— no version optionNewCompleteOrchestrationAction()doesn't accept or setNewVersionProposed fix
WithNewVersion(version string) ContinueAsNewOptionfunctional optionOrchestrationContext(e.g.,continuedAsNewVersionfield)setContinuedAsNew(), pass the version toNewCompleteOrchestrationAction()NewCompleteOrchestrationAction()to accept and setNewVersionon the protoRelated
CompleteOrchestrationAction.newVersion(field 4) inorchestrator_service.proto