Local n8n, workflow that watches a folder, having it run 'forever'

Describe the problem/error/question

I’ve got a very simple workflow that:

  • Watches a folder
  • Filters to only continue if the extension is jpg
  • Reads the file
  • Resizes the image
  • Saves it to a new folder

When testing, this runs perfectly. I click to execute the workflow, I see it wait, I drop a file and then it executes perfectly… and stops.

How do I get it to run forever essentially? (To be clear, not setting up a production server or anything, this is just testing, but want to see how I’d do it in general.)

1 Like

You can schedule it with the schedule trigger. So let it run every minute. Or if that isnt good enough, you can let it trigger itself when it is done. Make sure to set it to not wait on subflow to complete so you dont have thousands of the same flow running :sweat_smile:

Hmm. How does that work though when Local File Trigger is the existing trigger?

This is what I got - I added Schedule - but unsure how to ‘connect’ it.

Ah sorry didnt realise u were using that.
You can simply activate the workflow and it will keep checking

That’s what I thought too - and… I swear it didn’t work. I tried one more time to be sure… and it works. Thank you!

1 Like

Sir, can u share how to set the node watch folder. I am using local host and run from docker desktop. I already add my local path to docker container. But when i put the files in the spesified folder, it loading for long time and didnt start the trigger.

Thanks in advance

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.