Monitor directory structure for changes

Describe the problem/error/question

I can not seem to get the Local File Trigger to monitor changes to the entire directory structure (primary folder, all sub-folders, and all files). My search of other questions hasn’t really given me any insight (New to n8n) on how to solve this issues. After researching other question similar to my question, it seems like the Local File Trigger does not support what I am trying to do. But I don’t know the replacement flow to accomplish the goal.

I am using @jimleuk Build a Financial Documents Assistant using Qdrant and Mistral.ai as the template to try and create a chatbot to chat with n8n documents.

What is the error message (if any)?

None

Please share your workflow

Share the output returned by the last node

[
{
“event”: “add”,
“path”: “/automation/docs/n8n-docs/.gitignore”
}
]

Information on your n8n setup

  • n8n version: 1.62.1
  • Database (default: SQLite): psql (PostgreSQL) 16.4 (Debian 16.4-1.pgdg120+1)
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • **Operating system:
  • Locally hosted n8n and Postgres
    Distributor ID: Ubuntu
    Description: Ubuntu 24.04.1 LTS
    Release: 24.04
    Codename: noble

Hi @Khamblin

What exactly is the failure? Does the Trigger not fire or do you get any specific error? Is your workflow activated?

Since you’re hosting with docker, how did you map the bridge to your local directory? Can you share your configuration?

The default n8n container directory is /home/node, this is also where the Local File Trigger will be running from. So if you want to map to /automation/docs/**/* you will need to have that bridge configured in your docker set up like so:

(Docker Compose)

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    volumes:
      - ./automation:/home/node/automation

The trigger is monitoring. I am wanting it to return any file changes within the directory structure. I am testing by moving the entire directory, folders, sub-folders, and all files into the path. However, I am only getting 1 file returned as “added”. So it’s detecting {docs/1_file_added of 8 file added/no_folders_or_files_detected}

x-n8n: &service-n8n
image: n8nio/n8n:latest
networks: [‘demo’]

n8n:
<<: *service-n8n
container_name: n8n
networks: [‘demo’]
restart: unless-stopped
ports:
- 5678:5678
volumes:
- n8n_storage:/home/node/.n8n
- ./n8n/backup:/backup
- ./shared:/data/shared
- ./automation/docs:/automation/docs

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