I would go through the task queue mechanism see https://docs.mendix.com/refguide/task-queue/
Additionally, maybe marketplace options might also help. See Task Queue Helpers as suggested in the above documentation or others.
You can also have a look at the custom runtime settings in order to cleanup tasks.
Finally, would suggest to handle the error within your mendix microflows?
Let me know what worked!