anchor.diff:              item_ids_to_delete = ItemIdsToDelete,
               task_statuses_to_report = ReportedTaskStatuses
           }}}} ->
  -            lists:foreach(fun workflow_cached_item:delete/1, ItemIdsToDelete),
  +            lists:foreach(fun(ItemId) -> maybe_delete_item(ExecutionId, ItemId) end, ItemIdsToDelete),
               {Doc, IdToReportError, ReportedTaskStatuses};
           {ok, Doc = #document{value = #workflow_execution_state{
               next_lane = #next_lane{
  
positive.code:             IteratorToSave = workflow_cached_item:get_iterator(ItemIdToSnapshot),
              workflow_iterator_snapshot:save(
                  ExecutionId, LaneIndex, LaneId, ItemIndex, IteratorToSave, NextLaneId),
              maybe_delete_item_after_snapshot(ExecutionId, ItemIdToSnapshot),
              lists:foreach(fun workflow_cached_item:delete/1, ItemIdsToDelete),
              {Doc, IdToReportError, ReportedTaskStatuses};
          {ok, Doc = #document{value = #workflow_execution_state{
              update_report = ?TASK_PROCESSED_REPORT(ReportedTaskStatus)
  
negative.code:     {ok, _} = update(ExecutionId, fun(State) -> remove_pending_callback(State, ItemIdToReportError) end),
      ok.
  
  -spec maybe_delete_item(workflow_engine:execution_id(), workflow_cached_item:id()) -> ok.
  maybe_delete_item(ExecutionId, ItemId) ->
      case update(ExecutionId, fun(#workflow_execution_state{items_to_process = ItemsToProcess} = State) ->
          case maps:get(ItemId, ItemsToProcess, undefined) of
              [report, snapshot] ->
  