Handle FailWorkflowExecutionFailed event
A FailWorkflowExecution decision may fail with error UnhandledDecision if there is another scheduled decision at the same time.
See the SWF documentation: An UnhandledDecision fault will be returned if a workflow closing decision is specified and a signal or activity event had been added to the history while the decision task was being performed by the decider. Unlike the above situations which are logic issues, this fault is always possible because of race conditions in a distributed system. The right action here is to call RespondDecisionTaskCompleted without any decisions. This would result in another decision task with these new events included in the history. The decider should handle the new events and may decide to close the workflow execution.