Replay the Content of the Flow File in NiFi if it Fails

You can replay the NiFi processor with the last content of the flow file. This is helpful when a NiFi processor has failed to pass the flow file.

With this simple tip you can regenerate the last flow file and pass it again after you have fixed any errors. This tip is only applicable if there is a flow file else the option will not be enabled.

I have a very simple NiFi pipeline that generates a flow file and replaces the original text with a different text.

Simple NiFi pipeline for replay demo

Let us suppose, there is an error in the ReplaceText processor or it is not working as I expected. I want to make changes to the properties again. Earlier, I used to start the flow again to generate a flow file which was time-consuming for complex and large flows.

To do it quickly without starting from the beginning, right-click on the processor that you want to run again. In my case it is ReplaceText. Then, click on View data provenance.

Right click on the processor and click on View data provenance for Replay NiFi processor action

This shows all the flow files that were passed and modified. Click on the View Details button for the last run. Sometimes, you may click on View Details for DROP, CONTENT_MODIFIED, FETCH, etc. based on the type of processor.

View the details of the last processor run

Under Content, scroll down to find the Replay button. Click on it to get the flow file back to the queue just before the processor for a rerun.

Go to content tab and click on Replay to get the flow file back to the queue of the processor

Refresh your pipeline to see the changes.

Flow file replayed and came to the queue.

Up ↑

%d bloggers like this: