Overview
This node enables interaction with a Samba (SMB2) file server, allowing users to perform common file operations such as listing folder contents, downloading files, uploading files, deleting files or folders, and renaming/moving files or folders. It is particularly useful in scenarios where automated workflows need to integrate with SMB network shares for file management tasks.
For the List operation specifically, the node lists the contents of a specified folder on the SMB server, returning metadata about each item within that folder. This can be used to monitor directory contents, trigger actions based on files present, or gather information about files stored on the SMB share.
Practical example:
- Automatically list files in a shared network folder every hour to check for new documents.
- Use the list output to filter and process specific files in subsequent workflow steps.
Properties
| Name | Meaning |
|---|---|
| Folder | The path of the folder on the SMB server whose contents you want to list. For example: /public/folder. |
Output
The output is an array of JSON objects, each representing one item (file or directory) found in the specified folder. Each object contains the following fields:
type:"d"for directories,"l"for files (symbolic links are treated as files).name: The base name of the file or directory.path: The full path combining the folder path and the item's filename.attributes: File attributes as provided by the SMB server.createTime: Creation timestamp as a JavaScript Date object (if available).accessTime: Last access timestamp as a JavaScript Date object (if available).modifyTime: Last modification timestamp as a JavaScript Date object (if available).changeTime: Last change timestamp as a JavaScript Date object (if available).size: Size of the file in bytes.
No binary data is output for the List operation.
Dependencies
- Requires connection credentials to an SMB2-compatible server (an API key or authentication token configured in n8n).
- Uses internal helper functions to establish the SMB connection and read directory contents.
- No additional external services beyond the SMB server itself.
Troubleshooting
Common issues:
- Incorrect folder path or permissions may cause errors when listing directory contents.
- Network connectivity problems to the SMB server.
- Insufficient permissions to read the target folder.
Error messages:
- Errors related to connection failure or permission denied will be thrown if the node cannot access the folder.
- If the folder does not exist, the node will throw an error indicating the path could not be found.
Resolution tips:
- Verify the folder path is correct and accessible via SMB client tools.
- Check user permissions on the SMB server.
- Ensure network connectivity and correct SMB credentials are configured in n8n.
Links and References
- Samba (SMB) official documentation
- SMB protocol overview
- n8n documentation on creating custom nodes