switch mode {
// update current record
// 1. current workflow only ->
// current workflow cannot be zombie
// 2. current workflow & new workflow ->
// current workflow cannot be created / running,
// new workflow cannot be zombie
// case 1
if newWorkflowState == nil {
if currentWorkflowState == enumsspb.WORKFLOW_EXECUTION_STATE_ZOMBIE {
return newInvalidUpdateWorkflowMode(mode, currentWorkflowState)