anchor.diff:      ),
       
       test_utils:mock_expect(Workers, workflow_engine_callback_handler, handle_callback, fun(CallbackId, Result) ->
  -        {_CallbackType, ExecutionId, _EngineId, JobIdentifier, _CallPools} =
  +        {_CallbackType, ExecutionId, EngineId, JobIdentifier, _CallPools} =
               workflow_engine_callback_handler:decode_callback_id(CallbackId),
           {_, _, TaskId} = workflow_execution_state:get_result_processing_data(ExecutionId, JobIdentifier),
           Item = workflow_cached_item:get_item(workflow_execution_state:get_item_id(ExecutionId, JobIdentifier)),
           Master ! {task_processing, self(), <<"result_", TaskId/binary>>, Item},
           receive
               history_saved ->
  +                % Warning: do not use meck:passthrough as it does not work when 2 mocks work within one process
  +                apply(meck_util:original_name(workflow_engine_callback_handler), handle_callback, [CallbackId, Result]);
  +            delay_execution ->
  +                spawn(fun() ->
  +                    lists:foreach(fun(_) ->
  +                        % Warning: do not use meck:passthrough as we are in spawned process
  +                        HeartbeatCallbackId = apply(meck_util:original_name(workflow_engine_callback_handler),
  +                            prepare_heartbeat_callback_id, [ExecutionId, EngineId, JobIdentifier]),
  +                        apply(meck_util:original_name(workflow_engine_callback_handler),
  +                            handle_callback, [HeartbeatCallbackId, undefined]),
  +                        timer:sleep(timer:seconds(3))
  +                    end, lists:seq(1,10))
  +                end),
  +                timer:sleep(timer:seconds(20)),
                   % Warning: do not use meck:passthrough as it does not work when 2 mocks work within one process
                   apply(meck_util:original_name(workflow_engine_callback_handler), handle_callback, [CallbackId, Result]);
               fail_job ->
  
positive.code:                 #{fail_job := {Task, Item}} ->
                      Sender ! fail_job,
                      Acc3;
                  _ ->
                      Sender ! history_saved,
                      Acc3#{execution_history => [{Task, Item} | History]}
  
negative.code:     verify_execution_history(ExpectedAfterRestart, ExecutionHistoryAfterRestart, WorkflowType),
      verify_memory(Config),
      ok.
  
  heartbeat_test(Config) ->
      ResultToDelay = <<"result_async_test_workflow_task3_3_2">>,
      ItemToDelay = <<"100">>,
      set_task_execution_gatherer_option(Config, delay_execution, {ResultToDelay, ItemToDelay}),
      single_workflow_execution_test_base(Config, async),
      unset_task_execution_gatherer_option(Config, delay_execution).
      
  
  %%%===================================================================
  %%% Init/teardown functions
  