Skip to content

本地文件触发器节点(Local File Trigger node)#

本地文件触发节点在检测到文件系统发生变化时启动工作流。这些变化包括文件或文件夹的添加、更改或删除。

🌐 The Local File Trigger node starts a workflow when it detects changes on the file system. These changes involve a file or folder getting added, changed, or deleted.

安全考虑

本地文件触发节点在存在不受信任用户的环境中可能带来重大安全风险。因此,从2.0版本开始,该节点默认被禁用

Self-hosted n8n only

This node isn't available on n8n Cloud.

节点参数(Node parameters)#

你可以使用 触发于 参数选择要监控的事件。

🌐 You can choose what event to watch for using the Trigger On parameter.

对特定文件的更改(Changes to a Specific File)#

当指定的文件发生更改时,此节点会触发。

🌐 The node triggers when the specified file changes.

要监视的文件 中输入要监视的文件路径。

🌐 Enter the path for the file to watch in File to Watch.

涉及特定文件夹的更改(Changes Involving a Specific Folder)#

当选定文件夹发生更改时,此节点会触发。

🌐 The node triggers when a change occurs in the selected folder.

配置以下参数:

🌐 Configure these parameters:

  • 监视文件夹:输入要监视的文件夹路径。
  • 监控:选择要监控的更改类型。

节点选项(Node options)#

使用节点 选项 来包含或排除文件和文件夹。

🌐 Use the node Options to include or exclude files and folders.

  • 包含链接的文件/文件夹:同时监控链接的文件或文件夹的更改。
  • 忽略:要忽略的文件或路径。n8n 会测试整个路径,而不仅仅是文件名。支持 Anymatch 语法。
  • 最大文件夹深度:监控文件夹结构变化的深度。

忽略示例(Examples for Ignore)#

忽略单个文件:

🌐 Ignore a single file:

1
2
**/<fileName>.<suffix>
# For example, **/myfile.txt

忽略你正在监视的目录的子目录:

🌐 Ignore a sub-directory of a directory you're watching:

1
2
**/<directoryName>/**
# For example, **/myDirectory/**

模板和示例(Templates and examples)#

Template widget placeholder.