Support Questions
Find answers, ask questions, and share your expertise

Adding sequence Number to filename

Adding sequence Number to filename


Hi Nifi Experts,

I have a requirement to add a sequence number to file names in sequential order and reset the value to 1 on next run. 


Job is scheduled to run once every hour. I could see we can achieve incrementing the value using getStatevalue but not sure how can we reset the value. Could you please help me.






Re: Adding sequence Number to filename

Expert Contributor


Maybe you could reset the state via NiFi-REST-API at beginning of your flow?

Hava a look here:


Could be:
POST "https://[ip:port]/nifi-api/processors/${pg-id}/state/clear-requests"


This is the request which NiFi itself uses when you go to the processor in the UI and choose the menu-option "view state" -> "clear state".

Don't have an account?