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 within SMB shares, such as syncing files, monitoring logs, or reacting to configuration changes.

Common scenarios include:

  • Triggering a workflow when a new file is created in a specific folder.
  • Reacting to updates or deletions of files or folders inside an SMB share.
  • Monitoring a particular folder recursively for any changes.

For example, you could use this node to automatically process newly uploaded documents in a shared network folder or to alert a team when critical configuration files are modified.

Properties

Name Meaning
Trigger On Defines the scope of monitoring. Currently supports "Changes Involving a Specific Folder".
Recursive Boolean flag indicating whether to watch subfolders recursively within the specified folder.
File (Shown only if "Trigger On" is set to monitor a specific file) Selects the specific file to watch, either by listing available files or specifying a path.
Watch For (File) (Shown only if watching a specific file) Specifies the event type to trigger on. Only "File Updated" is supported here.
Folder (Shown only if "Trigger On" is set to monitor a specific folder) Specifies the folder path to watch.
Watch For (Folder) (Shown only if watching a specific folder) Specifies which folder or file events to trigger on, including creation, deletion, update of files or folders, and modification of the watched folder itself.
Notice Informational notice shown when watching a specific folder, clarifying that changes within subfolders won't trigger the node unless recursive watching is enabled.
Watch For (Any File/Folder) (Shown if monitoring any file or folder) Specifies events like file/folder creation or update across the entire watched drive.

Output

The node outputs JSON data representing the detected change event. The structure includes details about the change, such as:

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

The output is emitted only when the detected change matches the selected event type.

No binary data output is produced by this node.

Dependencies

  • Requires access to a Samba (SMB2) server.
  • Needs credentials for authenticating with the SMB server (an API key or authentication token).
  • Uses an internal helper module to connect and watch directories on the SMB server.
  • No additional external services are required beyond 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.
  • No triggers firing: Verify that the selected folder or file path exists and that the chosen event type matches actual changes occurring on the SMB share.
  • Recursive watching: By default, changes in subfolders do not trigger the node unless the "Recursive" option is enabled.
  • Error messages: Errors during connection or watching will be wrapped and reported with a message like "Failed to connect to SMB server: [error details]". Check network connectivity and permissions.

Links and References

Discussion