I have a processor in NiFi that look like this:
Basically, the ExecuteStreamCommand will run a Python script to do some process then the flowfile will go to the RouteOnAttribute to check whether the previous Python script ran successfully or failed. If success, it will go to the next processor (which I don't show in this figure). But if it failed, the flowfile will go to another ExecuteStreamCommand processor to send an alert notification(via email, chat, etc). Then it will rerun the first ExecuteStreamCommand again until the script ran without an error.
My problem here is that in case if there's an error in python script, it's will keep alerting all the time until I pause the processor. So, are there any other processor or setting to be added to this flow so that in case having an error, it will rerun the Python script for a limited try at a time(this pipeline is set to run every hour so it the number of autoretry should be count separately for each flowfile). Or do I have to add any code in python script for this purpose?
TL;DR I am finding a NiFi processor to be added to my pipeline that can help me counting the number of time that the same flowfile has get through the processor to make a limit of autoretry the python running script