There are no generally accepted best practices for this. There are certain community-made frameworks for logging and error handling. I have created some myself and have delivered sessions on that in tech conferences.
The best practice in my opinion is to have your sub-flows in an On block error that handles all of the actions within a sub-flow the same way. Then have the On block error call a different sub-flow when an error occurs. This sub-flow is then responsible for creating the log. It should have a Get last error action to get the details of your error and then some functionality for logging those details.
I personally prefer logging into text files and then feeding them to a monitoring software. But this part is really just a matter of preference. You can definitely write back to your Excel file, if you want to.
I would generally suggest actually creating those entries in a data table that works better than Excel. You could use a SharePoint list, a Dataverse table or even a SQL database for that. Would then be easier to update the values with lower chances of application errors.
Alternatively, you could use the work queue functionality and actually add each file to be downloaded as a separate item to your queue. Then, as you process them one by one, keep updating them. This would keep the queue items that are not processed easily visible and available.
If you want to be able to restart your flow upon error and continue without processing items that have already been processed, I would suggest splitting your flow into two parts where:
- You read your Excel file and create items in your queue / database in the first flow
- You only read the queue / database and ignore the Excel file in the second flow. As you process your items, you update them in the queue / database.
The others who have replied to the topic have already explained how you can check if a file has been downloaded.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.