public static WorkflowItemEvent LambdaEvent(this HistoryEvent historyEvent, IEnumerable <HistoryEvent> allEvents)
        {
            if (historyEvent.IsLambdaCompletedEvent())
            {
                return(new LambdaCompletedEvent(historyEvent, allEvents));
            }
            if (historyEvent.IsLambdaFailedEvent())
            {
                return(new LambdaFailedEvent(historyEvent, allEvents));
            }
            if (historyEvent.IsLambdaTimedoutEvent())
            {
                return(new LambdaTimedoutEvent(historyEvent, allEvents));
            }
            if (historyEvent.IsLambdaStartedEvent())
            {
                return(new LambdaStartedEvent(historyEvent, allEvents));
            }
            if (historyEvent.IsLambdaStartFailedEvent())
            {
                return(new LambdaStartFailedEvent(historyEvent, allEvents));
            }
            if (historyEvent.IsLambdaScheduledEvent())
            {
                return(new LambdaScheduledEvent(historyEvent));
            }
            if (historyEvent.IsLambdaSchedulingFailedEvent())
            {
                return(new LambdaSchedulingFailedEvent(historyEvent));
            }

            return(null);
        }