How to execute an action when the collect finished

Hi, I want to know if there is a way I can execute an action when the xml collector finished collecting from xml files as I need to delete these files in order to not collect from them each time collection started, those files are created by another service.
Thank you