586
workflowTask := resetMutableState.GetPendingWorkflowTask()
587
if workflowTask == nil {
589
>
// meaning workflow history has NO workflow task ever
590
>
// should also allow workflow reset, the only remaining issues are
591
>
// * what if workflow is a cron workflow, e.g. should add a workflow task directly or still respect the cron job
592
>
return serviceerror.NewInvalidArgumentf(
593
>
"Can only reset workflow to event ID in range [WorkflowTaskScheduled +1, WorkflowTaskStarted + 1]: %v",
594
>
baseRebuildLastEventID+1,
595
>
)
596
>
}
597
598
var err error