title: NiFi: Running ExecuteStreamCommand processor with limited try if failed
body: <p>I have a processor in NiFi that look like this:</p>
  <p><a href="https://i.stack.imgur.com/fDdo9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fDdo9.jpg" alt="NiFi flow" /></a>
  Basically, the <code>ExecuteStreamCommand</code> will run a Python script to do some process then the flowfile will go to the <code>RouteOnAttribute</code> 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 <code>ExecuteStreamCommand</code> processor to send an alert notification(via email, chat, etc). Then it will rerun the first <code>ExecuteStreamCommand</code> again until the script ran without an error.</p>
  <p>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?</p>
  <p>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</p>