anchor.diff:          AtmWorkflowExecutionCtx
       ),
       AtmLambdaSnapshotRegistry = lists:foldl(fun(#document{key = AtmLambdaId} = AtmLambdaDoc, Acc) ->
  -        {ok, AtmLambdaSnapshotId} = atm_lambda_snapshot:create(AtmWorkflowExecutionId, AtmLambdaDoc),
  -        Acc#{AtmLambdaId => AtmLambdaSnapshotId}
  +        try
  +            {ok, AtmLambdaSnapshotId} = atm_lambda_snapshot:create(
  +                AtmWorkflowExecutionId, AtmLambdaDoc
  +            ),
  +            Acc#{AtmLambdaId => AtmLambdaSnapshotId}
  +        catch Type:Reason ->
  +            catch delete_lambda_snapshots(Acc),
  +            erlang:Type(Reason)
  +        end
       end, #{}, maps:values(AtmLambdaDocs)),
   
       ExecutionElements#execution_elements{lambda_snapshot_registry = AtmLambdaSnapshotRegistry}.
  
positive.code: %%%-------------------------------------------------------------------
  %%% @doc
  %%% This module handles creation of all documents associated with automation
  %%% workflow (e.g. task execution docs, store docs, etc.). If creation of any
  %%% element fails then ones created before are deleted.
  %%% @end
  %%%-------------------------------------------------------------------
  -module(atm_workflow_execution_factory).
  
negative.code: delete_execution_elements(#execution_elements{
      lambda_snapshot_registry = AtmLambdaSnapshotRegistry
  } = ExecutionElements) when AtmLambdaSnapshotRegistry /= undefined ->
      catch delete_lambda_snapshots(AtmLambdaSnapshotRegistry),
  
      delete_execution_elements(ExecutionElements#execution_elements{
          lambda_snapshot_registry = undefined
  