I asked a similar question before,
To give some context - our workflow has a wait period of a month, so for all executions to migrate to new workflow type with versioning, it will take at least a month.
val version = Workflow.getVersion("switchToSecondWorkflow", Workflow.DEFAULT_VERSION, 1)
if (version == Workflow.DEFAULT_VERSION) {
val workflow = Workflow.newContinueAsNewStub(FirstWorkflow::class.java)
workflow.execute(object)
} else {
val workflow = Workflow.newContinueAsNewStub(SecondWorkflow::class.java)
workflow.execute(object)
}
Wondering if versioning is absolutely required in this case or can we just do this as we are not modifying command sequence
From
val workflow = Workflow.newContinueAsNewStub(FirstWorkflow::class.java)
workflow.execute(object)
To
val workflow = Workflow.newContinueAsNewStub(SecondWorkflow::class.java)
workflow.execute(object)