Local File Trigger not ignore file paterns

I found reference to similar issue Anymatch in local file trigger, I tried all the suggestions and it didn’t work.
I have Local File Trigger node, that needs to be triggered by any file but should ignore files with extension .json
I tried the following:
With Ignore fixed : /*.json
With Ignore expression: {{ ['
/*.json’]}}

I found this reference, and use it, but did’t work.

What is the error message (if any)?

It is just process, and continue the workflow when *.json file was added to the directory.

Share the output returned by the last node

Information on your n8n setup

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

Just checked on 1.72.1 and 1.78.0, and it appears that the “ignore” option is indeed ignored (i.e. you are correct… it doesn’t work as advertised).

So, until this is fixed, you can avoid further processing files you want to ignore by following the trigger node with a Filter node, and putting the rules there.

If this solves your issue, please mark this as the solution.

Screenshot of it not working right.

Update. Opened a Github issue for this here

Great! thank you!

I have the same issue, using v1.85.4

New version [email protected] got released which includes the GitHub PR 15872.

1 Like

This issue still exists for me

Running n8n (v1.99.0 & v1.100.1) in docker on linux.

From what I can find on GitHub - paulmillr/chokidar: Minimal and efficient cross-platform file watching library.
Since v4.0 the option to directly use strings as the ignored option has been removed and it now has to be a function.

Which i can also confirm since the newly added n8n option Ignore Mode “Contains” does work since it wraps the value into a function

From what I can tell from a quick code check is that it is also no longer possible to use anymatch in the watched path directly,
so a path like “/home/myuser/downloads/*.txt” to only match .txt files

(so the opposite of the Ignore option in n8n is also not possible, though I’m not sure if this ever worked anyway but I did have a workflow setup in the past that would only trigger for a specific file extension, not sure which way I build that though)

Would love to see this fixed in n8n, would drastically reduce the amount of runs n8n initiates just to stop in the next IF node…

(Would also be great if it would be allowed to define a function in n8n too, as that gives a lot more flexibility than if the values set in n8n were just wrapped into a function just like the MacOS “Contains” fix…)

See: Version 4: Typescript, ESM, glob removal, drop node <18 by paulmillr · Pull Request #1195 · paulmillr/chokidar · GitHub

Also see: GitHub - paulmillr/chokidar: Minimal and efficient cross-platform file watching library