Overview
This node enables interaction with a Samba (SMB2) file server, specifically allowing users to list the contents of folders on the SMB share. It connects to an SMB server and retrieves directory listings, returning detailed information about each item in the specified folder.
Common scenarios where this node is useful include:
- Automating file management workflows that require reading directory contents from a networked SMB share.
- Integrating SMB file shares into broader automation pipelines, such as monitoring folder contents or triggering actions based on files present.
- Gathering metadata about files and folders stored on SMB servers for reporting or processing.
For example, you could use this node to list all files in a shared company folder /public/reports and then process those files further in your workflow.
Properties
| Name | Meaning |
|---|---|
| Folder | The path of the folder on the SMB server whose contents you want to list. For example: /public/folder. This property is required when performing the "List" operation. |
Output
The output is an array of JSON objects, each representing an item (file or folder) found in the specified directory. Each object contains the following fields:
type:"d"if the item is a directory,"l"if it is a file (link).name: The base name of the item (file or folder name).path: The full path to the item within the SMB share.attributes: File attributes as provided by the SMB server.createTime: Creation timestamp of the item (if available).accessTime: Last access timestamp (if available).modifyTime: Last modification timestamp (if available).changeTime: Last change timestamp (if available).size: Size of the file in bytes (folders typically have size 0).
No binary data is output for the "List" operation; only metadata about the directory contents is returned.
Dependencies
- Requires connection credentials to an SMB2 server (an API key or authentication token configured in n8n).
- Uses the SMB2 protocol client library internally to communicate with the SMB server.
- No additional external services are needed beyond the SMB server itself.
Troubleshooting
- Connection errors: If the node cannot connect to the SMB server, verify the server address, credentials, and network accessibility.
- Permission errors: Ensure the authenticated user has read permissions on the target folder.
- Invalid folder path: Providing a non-existent or inaccessible folder path will cause errors. Double-check the folder path syntax and existence.
- Empty results: If the folder is empty, the node returns an empty array without error.
- Error messages: Errors during listing will be reported with details. If "Continue On Fail" is enabled, the node will return partial results with error info per item.