# n8n Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services. ## Description n8n (pronounced "n-eight-n") is a workflow automation tool that helps you connect different services and automate tasks without writing code. It features a visual node-based editor for creating workflows with hundreds of integrations. ## Features - 🎨 **Visual Workflow Editor**: Drag-and-drop interface for creating workflows - 🔗 **Hundreds of Integrations**: Connect to popular services (Slack, GitHub, Google, etc.) - 🔄 **Webhook Support**: Trigger workflows via HTTP requests - 📝 **Code Node**: Execute JavaScript/TypeScript code within workflows - 🚀 **Cloud & Self-Hosted**: Use n8n Cloud or self-host on your own infrastructure - 📊 **Data Transformation**: Map and transform data between services - ⏰ **Scheduling**: Run workflows on schedules (cron-like) - 🔒 **Security**: Credential management and secure data handling - 🎯 **Fair-Code License**: Source available with usage restrictions for commercial use ## Installation ### Via Overlay ```nix {pkgs, ...}: { environment.systemPackages = with pkgs; [ n8n ]; } ``` ### Direct Reference ```nix {pkgs, ...}: { environment.systemPackages = with pkgs; [ inputs.m3ta-nixpkgs.packages.${pkgs.system}.n8n ]; } ``` ### Run Directly ```bash nix run git+https://code.m3ta.dev/m3tam3re/nixpkgs#n8n ``` ## Usage ### Basic Usage ```bash # Start n8n (default configuration) n8n start # Start with custom configuration file n8n start --config /path/to/config # Run in worker mode (for production with queue) n8n worker # Execute a workflow from file n8n execute /path/to/workflow.json ``` ### Development Mode ```bash # Start with tunnel (external access) n8n start --tunnel # Disable telemetry n8n start --no-telemetry # Specify workflow directory n8n start --workflows /path/to/workflows # Enable/disable features n8n start --enable-editor n8n start --disable-metrics ``` ### Workflow Management ```bash # Export workflow to file n8n export:workflow --id=123 --output=workflow.json # Import workflow from file n8n import:workflow --input=workflow.json # Execute workflow n8n execute:workflow --id=123 ``` ## Configuration ### Environment Variables - `N8N_BASIC_AUTH_ACTIVE`: Enable basic authentication (default: false) - `N8N_BASIC_AUTH_USER`: Basic auth username - `N8N_BASIC_AUTH_PASSWORD`: Basic auth password - `N8N_ENCRYPTION_KEY`: Encryption key for credentials - `N8N_HOST`: Host URL for web UI (default: localhost) - `N8N_PORT`: Port for web UI (default: 5678) - `N8N_PROTOCOL`: Protocol (http or https) - `N8N_PATH`: Path to mount n8n (default: /) - `N8N_EDITOR_BASE_URL`: Base URL for editor - `N8N_WEBHOOK_URL`: URL for webhook endpoints - `N8N_TIMEZONE`: Timezone for execution (default: UTC) - `N8N_LOG_LEVEL`: Logging level (output, warn, error, verbose) - `N8N_LOG_OUTPUT`: Log output destination (console, file) - `N8N_METRICS`: Enable metrics collection (default: true) - `DB_TYPE`: Database type (sqlite3db, postgresdb, mysqldb) - `DB_SQLITE_VACUUM_ON_STARTUP`: Vacuum SQLite on startup ### Database Configuration By default, n8n uses SQLite for simplicity. For production, use PostgreSQL or MySQL: ```bash # PostgreSQL export DB_TYPE=postgresdb export DB_POSTGRESDB_HOST=localhost export DB_POSTGRESDB_PORT=5432 export DB_POSTGRESDB_DATABASE=n8n export DB_POSTGRESDB_USER=n8n export DB_POSTGRESDB_PASSWORD=yourpassword # MySQL/MariaDB export DB_TYPE=mysqldb export DB_MYSQLDB_HOST=localhost export DB_MYSQLDB_PORT=3306 export DB_MYSQLDB_DATABASE=n8n export DB_MYSQLDB_USER=n8n export DB_MYSQLDB_PASSWORD=yourpassword ``` ### Security Set up encryption for credentials: ```bash # Generate encryption key export N8N_ENCRYPTION_KEY=$(openssl rand -base64 32) # Use in production export N8N_ENCRYPTION_KEY="your-32-char-encryption-key" ``` ## NixOS Module For NixOS, use the n8n module from nixpkgs for a complete service configuration: ```nix services.n8n = { enable = true; settings = { host = "0.0.0.0"; port = 5678; timezone = "UTC"; }; environment = { N8N_ENCRYPTION_KEY = "your-encryption-key"; DB_TYPE = "postgresdb"; DB_POSTGRESDB_HOST = "/var/run/postgresql"; DB_POSTGRESDB_DATABASE = "n8n"; }; }; ``` ## Use Cases ### Webhook Automation Trigger workflows via HTTP requests: ```bash # Start n8n with tunnel for public URL n8n start --tunnel # Create webhook workflow in UI # Workflow receives data from external service # Process and send to another service ``` ### Scheduled Tasks Run tasks on a schedule: ```javascript // In workflow editor, use Schedule Trigger // Set cron expression: "0 9 * * *" (daily at 9 AM) // Connect to nodes that perform tasks ``` ### Data Sync Between Services Keep data synchronized: ```bash # Create workflow with: # 1. Webhook trigger (service A) # 2. Data transformation node # 3. HTTP request node (service B) # 4. Response back to service A ``` ### Automated Reporting Generate and send reports: ```javascript // Workflow steps: // 1. Schedule trigger (daily/weekly) // 2. Database query node // 3. Data formatting // 4. Email or Slack notification ``` ## Integration Examples ### Slack Integration ```javascript // Create Slack notification workflow // 1. Trigger (webhook or schedule) // 2. Process data // 3. Send message to Slack channel ``` ### GitHub Integration ```javascript // GitHub repository automation // 1. GitHub webhook trigger (push, PR, issue) // 2. Conditional logic // 3. Actions (create issue, comment, etc.) ``` ### Email Automation ```javascript // Email processing workflow // 1. Email trigger (IMAP) // 2. Parse email content // 3. Process data // 4. Send response or forward ``` ## Performance Optimization ### Production Tips - Use PostgreSQL or MySQL instead of SQLite - Enable queue mode with Redis - Use worker nodes for scaling - Configure proper resource limits - Set up load balancing for web UI ### Queue Mode ```bash # Start main n8n process export QUEUE_BULL_REDIS_HOST=redis-server export QUEUE_BULL_REDIS_PORT=6379 n8n start # Start worker processes n8n worker ``` ## Build Information - **Version**: 2.4.1 - **Language**: TypeScript/JavaScript (Node.js) - **Package Manager**: pnpm - **License**: Sustainable Use (Fair-Code) - **Source**: [GitHub](https://github.com/n8n-io/n8n) ## Dependencies - `nodejs` - JavaScript runtime - `pnpm` - Package manager (build-time) - `python3` - Required for SQLite bindings - `node-gyp` - Node.js native addon build tool - `libkrb5` - Kerberos authentication - `libmongocrypt` - MongoDB encryption - `libpq` - PostgreSQL client library ## Platform Support - Linux - macOS ## Notes - Package has ~80,000 files, so stripping and ELF patching are disabled for performance - SQLite3 bindings are rebuilt during build phase - TypeScript files and source maps are removed in preInstall phase - Non-deterministic files (.turbo, .modules.yaml, types) are removed - Node modules are pruned to production dependencies only ## Related - [Adding Packages](../guides/adding-packages.md) - How to add new packages - [Quick Start](../QUICKSTART.md) - Getting started guide - [n8n Documentation](https://docs.n8n.io) - Official documentation - [n8n Community](https://community.n8n.io) - Community forum