Decided to share something we found out in Production. I have searched and searched and sadly found nothing related to this in either AIF documentation or help.sap.com
Trully hope this helps someone else out there.
Restart information, and more to the point, which AIF Actions ran successfully is taken from Application Log. This requires special attention when defining Application Log Lifetime ( Defaults to 90 days ).
AIF Function Module /AIF/FILE_PERFORM_ACTIONS starts by fetching records from Application Log and stores that into local variable lt_applog_msgs. It then cycles through all configured Actions and tries to find a success flag information from the Log. Of course when the Log entries are deleted this information is lost and we end up with Actions that were successful, even have information in AIF's restore Table /AIF/T_FLD_REST but because no success flag is found run again, and in our case causing errors.
Moving to S4 has not changed this as the Function Module mentioned above has the code approach...
Technically this feels like an extremely poor implementation because it would be much safer (and faster) to search for the last failing action. This way we would simply call the restore feature for all configured actions before that one....food for thought SAP.
P.S: Relevant lines in this Function Module /AIF/FILE_PERFORM_ACTIONSare:
Line 230 -> Where variable lt_applog_msgs is changed
Line 831 -> Where variable lt_applog_msgs is checked to see if this AIF action ran once with success