anchor.diff:              NestedRecordDecoder(AtmParallelBoxExecutionJson, atm_parallel_box_execution)
           end, AtmParallelBoxExecutionsJson)
       }.
  +
  +
  +%%%===================================================================
  +%%% Internal functions
  +%%%===================================================================
  +
  +
  +%% @private
  +-spec resolve_index(marker(), atm_workflow_execution:record()) -> index().
  +resolve_index(AtmLaneMarker, #atm_workflow_execution{curr_lane_index = CurrAtmLaneIndex}) ->
  +    utils:ensure_defined(AtmLaneMarker, CurrAtmLaneIndex).
  
positive.code: -export([
      get_schema_id/2,
      get_schema/2,
      get_curr_run/2
  ]).
  -export([update_curr_run/3, update_curr_run/4]).
  -export([to_json/1]).
  
  %% persistent_record callbacks
  -export([version/0, upgrade_encoded_record/2, db_encode/2, db_decode/2]).
  
  
  -type status() ::
      ?SCHEDULED_STATUS | ?PREPARING_STATUS | ?ENQUEUED_STATUS |
  
negative.code: 
  
  %% @private
  -spec update_curr_run(marker(), run_diff(), atm_workflow_execution:record()) ->
      {ok, atm_workflow_execution:record()} | errors:error().
  update_curr_run(AtmLaneMarker, UpdateFun, AtmWorkflowExecution) ->
      update_curr_run(AtmLaneMarker, UpdateFun, undefined, AtmWorkflowExecution).
  
  
  -spec update_curr_run(
      marker(),
      run_diff(),
      undefined | atm_lane_execution:run(),
      atm_workflow_execution:record()
  ) ->
      {ok, atm_workflow_execution:record()} | errors:error().
  update_curr_run(AtmLaneMarker, Diff, Default, AtmWorkflowExecution = #atm_workflow_execution{
      lanes = AtmLaneExecutions,
      curr_run_no = CurrRunNo
  }) ->
      AtmLaneIndex = resolve_index(AtmLaneMarker, AtmWorkflowExecution),
      AtmLaneExecution = #atm_lane_execution{runs = Runs} = lists:nth(AtmLaneIndex, AtmLaneExecutions),
  
      UpdateRunsResult = case Runs of
          [#atm_lane_execution_run{run_no = RunNo} = CurrRun | RestRuns] when
  