Samba (SMB2) Trigger icon

Samba (SMB2) Trigger

Trigger a workflow on Samba (SMB2) filesystem changes

Overview

This node triggers workflows based on changes detected in a Samba (SMB2) filesystem. It is useful for automating processes that depend on file or folder events such as creation, deletion, or updates within a specific folder, a specific file, or an entire drive accessible via SMB2 protocol.

Common scenarios include:

  • Monitoring a shared network folder for new files to process automatically.
  • Triggering workflows when configuration files are updated on a remote SMB share.
  • Reacting to deletions or modifications of folders or files in a collaborative environment.

For example, you could use this node to watch a project folder on a network share and trigger a workflow whenever a new document is added, ensuring timely processing or notifications.

Properties

Name Meaning
Trigger On Defines the scope of monitoring. Options: "Changes Involving a Specific Folder". (Note: The provided properties only show this option.)
Recursive Boolean flag indicating whether to watch subfolders recursively within the specified folder.
File (Shown if "Trigger On" is set to monitor a specific file) Selects the file to watch either by listing available files or specifying a path.
Watch For Specifies the event type to trigger on. Depending on context, options include:
- For a specific file: "File Updated"
- For a specific folder: "File Created", "File Deleted", "File Updated", "Folder Created", "Folder Deleted", "Folder Updated", "Watch Folder Updated"
- For any file/folder in the drive: "File Created", "File Updated", "Folder Created", "Folder Updated"
Folder (Shown if "Trigger On" is set to monitor a specific folder) Specifies the folder to watch by path.
Notice Informational notice shown when watching a specific folder except when the event is "watchFolderUpdated": "Changes within subfolders won't trigger this node".

Output

The node outputs JSON data representing the change event detected on the SMB share. Each output item contains a json field with details about the change, including at least:

  • changeType: Numeric code representing the type of change.
  • Other metadata about the changed file or folder (e.g., name, path).

The node does not output binary data.

Dependencies

  • Requires access to a Samba (SMB2) server.
  • Needs credentials for authenticating to the SMB2 share (configured in n8n as an API key credential).
  • Uses an internal helper module to connect and watch directories on the SMB server.

Troubleshooting

  • Connection errors: If the node fails to connect to the SMB server, ensure the credentials are correct and the server is reachable from the n8n instance.
  • Permission issues: The user account used must have sufficient permissions to watch the specified folder or file.
  • Event filtering: Make sure the selected event matches the actual changes occurring; otherwise, the node will not trigger.
  • Recursive watching: If recursive watching is enabled but changes in subfolders do not trigger the node, verify the SMB server supports recursive directory watching.

Common error message:

  • "Failed to connect to SMB server: <error message>" — Indicates connection or authentication failure. Check network connectivity and credentials.

Links and References

Discussion