I have a workflow that watches a local folder for new files and processes them. When running n8n as a local process using npm run dev I am able to execute the workflow manually. It then listens to the watched folder and processes the first file that is created in the watched folder.
My question is in production how do I spawn an instance of this workflow for every file that is eventually created in the watched folder?
Hey @Gowthaman_Prabhu, this sounds like a duplicate of Can we run a workflow for every file in a folder? - #6 by Gowthaman_Prabhu. It’d be cool if you could avoid creating multiple topics for the same question.
As for your question, it might be simpler to not create a new workflow for every single file (as these workflows would be really hard to manage and update). How about using the Local File Trigger node instead to watch your entire folder for newly created (or updated) files?
Once your workflow is active, it would execute for every single file matching the trigger condition.
@MutedJam That’s exactly what I did. But when I run the workflow manually it only processes the first file and stops listening.
Yes, that’s expected. Your workflow would only process new/updated files once you active it.
@MutedJam Thanks once again as always…