689
return nil, handler.failWorkflowTaskOnInvalidArgument(enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES, err)
690
}
692
>
// If ai is nil, the activity has already been canceled/completed/timedout. The cancel request
693
>
// will be recorded in the history, but no further action will be taken.
694
>
if ai.StartedEventId == common.EmptyEventID {
695
// We haven't started the activity yet, we can cancel the activity right away and
696
// schedule a workflow task to ensure the workflow makes progress.