Remove all the files from specific local folder

I want to remove all the files from the specific folder, then only process the existing files from that chat input.
Let me know how to do it. I have tried using the execute command to remove it, but its not working.

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:**1.80.3
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):**Docker
  • **Operating system:**mac os

Quick question: do you have a strategy to deal with the race if you achieve the objective to delete any files? I.e. when you have an active workflow execution that still needs the files and then another execution gets started and tries to remove those.

Thanks for the reminder. I haven’t accomplished that yet, but I may require the files for active workflow execution. Could you guide me on how this can be effectively achieved?

The rm -rf command works for me.

If you are saying it doesn’t work at all, check your path, permissions, etc.

If you are saying it hasn’t worked by the time you reach your Write Files node, it’s probably a timing thing, so try putting it inline, and use a code node to carry forward the item-list output from the node before it, like this.

Edit: And then also deal with concurrency as Olek suggested. Good point Olek. That probably would have been the next question :wink:

3 Likes

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