Package Information
Available Nodes
Documentation
n8n File System Nodes
A collection of n8n community nodes for comprehensive file system operations. This package provides multiple specialized nodes for handling files and directories efficiently within your n8n workflows.
Features
This package includes the following nodes:
š ReadFile Node
- Read file contents as text or binary
- Support for various encodings (UTF-8, ASCII, Base64, etc.)
- Error handling for non-existent files
āļø WriteFile Node
- Write text or binary content to files
- Create parent directories automatically
- Append or overwrite modes
- Multiple encoding support
š ListFiles Node
- List files and directories in a specified path
- Recursive directory traversal option
- File filtering by extension or pattern
- Include/exclude hidden files
ā¹ļø FileInfo Node
- Get detailed file/directory information
- File size, creation/modification dates
- File permissions and ownership
- MIME type detection
šļø DeleteFile Node
- Delete files or directories
- Recursive directory deletion
- Safe deletion with confirmation options
š CreateDirectory Node
- Create single or nested directories
- Set directory permissions
- Skip if directory already exists
š CopyFile Node
- Copy files or directories
- Preserve file metadata and permissions
- Recursive directory copying
š MoveFile Node
- Move/rename files and directories
- Cross-filesystem move support
- Automatic directory creation
š FileExists Node
- Check if files or directories exist
- Support for different path types (file, directory, any)
- Access permission checking (read, write, execute)
- Detailed file information retrieval
- Symbolic link resolution
Installation
In n8n
- Go to Settings > Community Nodes
- Install
n8n-nodes-fs
Manual Installation
# In your n8n installation directory
cd ~/.n8n/custom
npm install n8n-nodes-fs
Development Setup
For development and testing, you can use the provided registration scripts to link the package locally with n8n:
Windows (PowerShell)
.\local_n8n_register.ps1
macOS/Linux (Bash)
# Make the script executable
chmod +x local_n8n_register.sh
# Run the script
./local_n8n_register.sh
These scripts will:
- Clean the build directory
- Install dependencies
- Build the project
- Link the package to your local n8n installation
- Set up development environment variables
- Start n8n with debug logging
Usage
After installation, you'll find all the file system nodes in your n8n editor under the "File System" category. Each node provides intuitive configuration options and comprehensive error handling.
Security Considerations
ā ļø Important: These nodes have direct access to the file system where n8n is running. Ensure you:
- Run n8n with appropriate user permissions
- Validate file paths to prevent directory traversal attacks
- Use absolute paths when possible
- Be cautious with user-provided file paths in production
Examples
Basic File Reading
{
"filePath": "/path/to/your/file.txt",
"encoding": "utf8"
}
Directory Listing with Filtering
{
"directoryPath": "/path/to/directory",
"recursive": true,
"filter": "*.js",
"includeHidden": false
}
File Information Retrieval
{
"path": "/path/to/file",
"includeStats": true,
"detectMimeType": true
}
Check File Existence
{
"filePath": "/path/to/file.txt",
"checkOptions": {
"checkType": "file",
"includeDetails": true,
"checkAccess": ["readable", "writable"]
}
}
Example Workflow
The package includes a complete example workflow (example-workflow.json) that demonstrates all file system operations:
- Initialize Variables: Set up test directory path
- Create Directory: Create a test directory
- Write File: Create a text file with content
- Get File Info: Retrieve detailed file information
- Move File: Move the file to a new location
- Read File: Read the moved file content
- Delete File: Remove the file
- Check File Exists: Verify file deletion
- List Files: Show remaining directory contents
Using the Example Workflow
- Import
example-workflow.jsoninto your n8n instance - Update the test directory path in the "Vars" node
- Execute the workflow to see all nodes in action
The workflow uses expressions to pass data between nodes, demonstrating real-world usage patterns.
Error Handling
All nodes include comprehensive error handling:
- File not found errors
- Permission denied errors
- Invalid path errors
- Disk space errors
Compatibility
- n8n version: 1.0.0+
- Node.js version: 18+
- Supports: Windows, macOS, Linux
Project Files
This project includes several helpful scripts and configuration files:
local_n8n_register.ps1- Windows PowerShell script for development setuplocal_n8n_register.sh- macOS/Linux Bash script for development setupexample-workflow.json- Complete workflow example demonstrating all nodespackage.json- Node.js package configurationtsconfig.json- TypeScript configuration
Contributing
This package is part of the Mira project. Contributions are welcome!
License
MIT License - see LICENSE file for details
Support
For issues and questions:
- GitHub Issues: Project Repository
- n8n Community: n8n Community Forum
Note: Always test file operations in a safe environment before using in production workflows.