AutomationFlowsGeneral › Automated FTP File Migration with Smart Cleanup and Email Notifications

Automated FTP File Migration with Smart Cleanup and Email Notifications

ByDariusz Koryto @dako on n8n.io

This n8n workflow automates the secure transfer of files between FTP servers on a scheduled basis, providing enterprise-grade reliability with comprehensive error handling and dual notification systems (email + webhook). Perfect for data migrations, automated backups, and…

Cron / scheduled trigger★★★★☆ complexity15 nodesFtpEmail Send
General Trigger: Cron / scheduled Nodes: 15 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #8161 — we link there as the canonical source.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "DaJFVETQef5qJMmB",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "My workflow 2",
  "tags": [],
  "nodes": [
    {
      "id": "dafe14b7-7719-41b7-b1a4-cf6765aa3db9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -144
      ],
      "parameters": {
        "width": 400,
        "height": 712,
        "content": "# \ud83d\ude80 FTP FILE MIGRATION WORKFLOW\n\n## Overview:\nAutomated file transfer between FTP servers with comprehensive error handling and notifications.\n\n## Key Features:\n\u2705 Scheduled execution (daily at 2 AM)\n\u2705 Smart file filtering\n\u2705 Secure transfer with validation\n\u2705 Source cleanup after success\n\u2705 Email notifications (success + error)\n\u2705 Comprehensive logging\n\n## Quick Start:\n1. Configure FTP credentials\n2. Adjust schedule and filters\n3. Set up email notifications\n4. Test with small files first\n5. Monitor execution logs\n\n\u26a0\ufe0f **IMPORTANT**: Test thoroughly before production!"
      },
      "typeVersion": 1
    },
    {
      "id": "f460e190-0e9f-4fb9-b023-2b4d37988a37",
      "name": "File Processing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        144
      ],
      "parameters": {
        "width": 380,
        "height": 280,
        "content": "## \ud83d\udcc1 FILE PROCESSING PIPELINE\n\n### Current Filter: \n**Text & Data Files Only**\n- .txt, .csv, .json, .xml\n\n### Common Alternatives:\n\ud83d\udcc4 **Documents**: `\\.(pdf|doc|docx)$`\n\ud83d\uddbc\ufe0f **Images**: `\\.(jpg|jpeg|png|gif)$`\n\ud83d\udcca **Data**: `\\.(csv|json|xml|xlsx)$`\n\ud83d\udce6 **Archives**: `\\.(zip|rar|7z|tar)$`\n\ud83c\udfb5 **Media**: `\\.(mp4|mp3|avi|mov)$`\n\n### Size Limits:\n- Small: < 10MB\n- Medium: 10MB - 100MB  \n- Large: > 100MB (adjust timeouts)\n\n### Processing Order:\n1\ufe0f\u20e3 List files from source\n2\ufe0f\u20e3 Filter by criteria\n3\ufe0f\u20e3 Download to temp storage\n4\ufe0f\u20e3 Upload to destination\n5\ufe0f\u20e3 Validate transfer\n6\ufe0f\u20e3 Clean up source\n\n\ud83d\udd04 **Remove Filter node to transfer ALL files**"
      },
      "typeVersion": 1
    },
    {
      "id": "d92ebb39-8697-4137-8770-dddf0cc3412a",
      "name": "Security",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        592
      ],
      "parameters": {
        "width": 382,
        "height": 792,
        "content": "## \ud83d\udd12 SECURITY BEST PRACTICES\n\n### Connection Security:\n\ud83d\udd10 **Use SFTP** instead of FTP (port 22)\n\ud83d\udd11 **SSH Keys** preferred over passwords\n\ud83c\udf10 **IP Whitelisting** on FTP servers\n\ud83d\udd12 **VPN/Tunnel** for sensitive data\n\n### Credential Management:\n\ud83d\udddd\ufe0f **Dedicated Service Accounts**\n\ud83d\udd04 **Regular Rotation** (monthly/quarterly)\n\ud83d\udcdd **Minimum Permissions** (read source, write dest)\n\ud83d\udeab **No Shared Accounts**\n\n### Data Protection:\n\ud83d\udd10 **Encryption in Transit** (TLS/SSL)\n\ud83d\uddc2\ufe0f **File Integrity Checks** (checksums)\n\ud83d\udccb **Audit Logging** (all operations)\n\ud83d\udd50 **Retention Policies** (log cleanup)\n\n### Access Control:\n\ud83d\udc64 **Role-Based Access**\n\ud83d\udeaa **Principle of Least Privilege**\n\ud83d\udcca **Access Reviews** (quarterly)\n\ud83d\udd0d **Activity Monitoring**\n\n### Compliance:\n\ud83d\udcdc **GDPR/CCPA** considerations\n\ud83d\udccb **SOX/HIPAA** requirements\n\ud83c\udfe2 **Corporate Policies**\n\ud83d\udcdd **Documentation Requirements**"
      },
      "typeVersion": 1
    },
    {
      "id": "42886faa-e0ec-4ccc-9bcf-fa289f27fea7",
      "name": "Performance",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -144
      ],
      "parameters": {
        "width": 444,
        "height": 568,
        "content": "## \u26a1 PERFORMANCE OPTIMIZATION\n\n### File Size Considerations:\n\ud83d\udcc4 **Small Files** (< 10MB): Default settings\n\ud83d\udcca **Medium Files** (10-100MB): Increase timeouts\n\ud83d\udce6 **Large Files** (> 100MB): Extended timeouts + monitoring\n\ud83c\udfac **Huge Files** (> 1GB): Consider alternative methods\n\n### Timeout Settings:\n\u23f0 **Connection**: 30 seconds\n\u23f0 **Download**: 300 seconds (5 min)\n\u23f0 **Upload**: 300 seconds (5 min)\n\u23f0 **Large Files**: 600+ seconds (10+ min)\n\n### Network Optimization:\n\ud83c\udf10 **Peak Hours**: Schedule during off-peak\n\ud83d\udcca **Bandwidth**: Monitor usage patterns\n\ud83d\udd04 **Parallel Processing**: For multiple files\n\ud83d\udcc8 **Resume Support**: For interrupted transfers\n\n\n\n\ud83c\udfaf **Target**: < 5 min per 100MB file"
      },
      "typeVersion": 1
    },
    {
      "id": "51afbebf-2431-4d08-bd8e-74c0a9072eb1",
      "name": "Troubleshooting",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2304,
        -128
      ],
      "parameters": {
        "width": 480,
        "height": 912,
        "content": "## \ud83d\udd27 TROUBLESHOOTING GUIDE\n\n### Common Issues & Solutions:\n\n\ud83d\udd0c **Connection Failures:**\n- Check server status & firewall\n- Verify credentials & permissions\n- Test network connectivity\n- Review SSL/TLS settings\n\n\u23f1\ufe0f **Timeout Errors:**\n- Increase timeout values\n- Check file sizes vs. settings\n- Monitor network speed\n- Split large transfers\n\n\ud83d\udd11 **Authentication Issues:**\n- Verify username/password\n- Check account lockouts\n- Test credential expiration\n- Review permission changes\n\n\ud83d\udcc1 **File Operation Errors:**\n- Confirm file existence\n- Check read/write permissions\n- Verify disk space availability\n- Test file locking status\n\n\ud83d\udcbe **Memory/Performance:**\n- Monitor n8n server resources\n- Adjust concurrent executions\n- Implement file size limits\n- Consider batch processing\n\n### Debug Steps:\n1\ufe0f\u20e3 **Check Logs**: Execution history\n2\ufe0f\u20e3 **Test Credentials**: Manual FTP connection\n3\ufe0f\u20e3 **Verify Paths**: Directory structure\n4\ufe0f\u20e3 **Network Test**: Ping/telnet servers\n5\ufe0f\u20e3 **Resource Check**: CPU/Memory/Disk\n\n\ud83d\udcde **Escalation**: Contact system administrators"
      },
      "typeVersion": 1
    },
    {
      "id": "d57222c3-5f3b-45ec-8410-3f49675bdf9b",
      "name": "Configuration",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        96
      ],
      "parameters": {
        "width": 380,
        "height": 320,
        "content": "## \u2699\ufe0f CONFIGURATION CHECKLIST\n\n### Pre-Deployment:\n\u2610 **FTP Credentials**: Source & destination tested\n\u2610 **SMTP Settings**: Email notifications configured\n\u2610 **File Filters**: Appropriate patterns set\n\u2610 **Paths**: Source & destination directories verified\n\u2610 **Schedule**: Cron expression configured\n\u2610 **Timeouts**: Adjusted for expected file sizes\n\u2610 **Permissions**: Read source, write destination\n\u2610 **Network**: Connectivity between all systems\n\n### Testing Phase:\n\u2610 **Disable Cleanup**: Comment out source deletion\n\u2610 **Small Files**: Test with 1-2 small files first\n\u2610 **Error Scenarios**: Test failure conditions\n\u2610 **Email Alerts**: Verify notifications work\n\u2610 **Logs Review**: Check execution history\n\u2610 **Performance**: Monitor transfer speeds\n\n### Production Deployment:\n\u2610 **Enable Cleanup**: Activate source deletion\n\u2610 **Monitor First Run**: Watch initial execution\n\u2610 **Set Alerts**: Configure monitoring thresholds\n\u2610 **Document Config**: Save settings & passwords\n\u2610 **Schedule Review**: Confirm timing works\n\u2610 **Backup Strategy**: Plan for rollback\n\n### Post-Deployment:\n\u2610 **Daily Monitoring**: Check success rates\n\u2610 **Weekly Reviews**: Analyze performance\n\u2610 **Monthly Audits**: Security & compliance\n\u2610 **Quarterly Updates**: Credential rotation"
      },
      "typeVersion": 1
    },
    {
      "id": "fd89ccc8-f083-4241-a869-dca7690bc591",
      "name": "Daily Schedule (2 AM)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "notes": "SCHEDULE TRIGGER CONFIGURATION:\n\n\ud83d\udcc5 CURRENT SCHEDULE: Daily at 2:00 AM (server time)\n\n\u23f0 SCHEDULE EXAMPLES:\n- Daily at specific time: 0 2 * * *\n- Every 6 hours: 0 */6 * * *\n- Weekdays at 8 AM: 0 8 * * 1-5\n- Weekly on Sunday 2 AM: 0 2 * * 0\n- Monthly on 1st at midnight: 0 0 1 * *\n\n\ud83d\udd27 CONFIGURATION STEPS:\n1. Click on this node to edit\n2. Modify 'Cron Expression' field\n3. Use cron expression generator if needed\n4. Test with 'Execute Node' button\n\n\u26a0\ufe0f IMPORTANT CONSIDERATIONS:\n- Server timezone affects execution time\n- Consider maintenance windows\n- Avoid peak business hours\n- Account for server load and resources\n- Plan for daylight saving time changes\n\n\ud83d\udca1 TESTING TIP:\n- Use '*/5 * * * *' for every 5 minutes during testing\n- Change back to production schedule after validation\n\n\ud83c\udf0d TIMEZONE SETTINGS:\n- Current: Europe/Warsaw (GMT+1/+2)\n- Modify in workflow settings if needed\n- Ensure consistency across all environments",
      "position": [
        288,
        512
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 2 * * *"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0be802db-9255-45b5-8c93-ca85087969e5",
      "name": "List Files - Source FTP",
      "type": "n8n-nodes-base.ftp",
      "notes": "SOURCE FTP SERVER CONFIGURATION:\n\n\ud83d\udd11 CREDENTIALS SETUP:\n1. Navigate to: Settings \u2192 Credentials \u2192 Create New\n2. Select 'FTP' credential type\n3. Name: 'Source FTP Server'\n4. Enter connection details:\n   - Host: source-ftp-server.com\n   - Port: 21 (FTP) or 22 (SFTP)\n   - Username: your_username\n   - Password: your_password\n5. Test connection before saving\n\n\ud83d\udcc1 PATH CONFIGURATION:\n- Absolute path: /home/user/files/\n- Relative path: files/folder/\n- Root directory: /\n- Current example: /source/directory/\n\n\ud83d\udd0d OPERATION SETTINGS:\n- Operation: 'List' (to discover files)\n- Recursive: true (includes subdirectories)\n- Returns file metadata: name, size, date, permissions\n\n\u2699\ufe0f ADVANCED OPTIONS:\n- Connection timeout: 30 seconds (default)\n- Data timeout: 60 seconds\n- Keep connection alive: true\n- Passive mode: true (recommended)\n\n\ud83d\udee1\ufe0f SECURITY RECOMMENDATIONS:\n- Use SFTP (port 22) when possible\n- Enable key-based authentication\n- Implement IP whitelisting\n- Use dedicated service accounts\n- Regular credential rotation\n\n\ud83d\udc1b TROUBLESHOOTING:\n- Connection timeout: Check firewall settings\n- Permission denied: Verify user permissions\n- Path not found: Ensure directory exists\n- Authentication failed: Check credentials\n\n\ud83d\udcca EXPECTED OUTPUT:\n- Array of file objects\n- Each object contains: name, size, date, type\n- Empty array if no files found",
      "position": [
        512,
        512
      ],
      "parameters": {
        "path": "/source/directory/",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "0915fba4-e8a7-4070-bfe6-03d594163495",
      "name": "Filter Files",
      "type": "n8n-nodes-base.filter",
      "notes": "FILE FILTERING & SELECTION:\n\n\ud83d\udd0d CURRENT FILTER LOGIC:\n- File Extension Match: \\.(txt|csv|json|xml)$\n- Case-sensitive matching enabled\n- Regex pattern matching\n\n\ud83d\udcdd COMMON FILTER PATTERNS:\n\n\ud83d\udcc4 DOCUMENTS:\n- Office files: \\.(doc|docx|xls|xlsx|ppt|pptx)$\n- PDF files: \\.pdf$\n- Text files: \\.(txt|rtf|md)$\n\n\ud83d\uddbc\ufe0f IMAGES:\n- Common formats: \\.(jpg|jpeg|png|gif|bmp)$\n- High-res images: \\.(tiff|tga|raw)$\n- Vector graphics: \\.(svg|eps|ai)$\n\n\ud83d\udcca DATA FILES:\n- Structured data: \\.(csv|json|xml|yaml)$\n- Database files: \\.(sql|db|sqlite)$\n- Log files: \\.(log|txt)$\n\n\ud83d\udce6 ARCHIVES:\n- Compressed files: \\.(zip|rar|7z|tar|gz)$\n\n\ud83d\udd27 ADVANCED FILTERING OPTIONS:\n\n\ud83d\udccf SIZE-BASED FILTERING:\n- Add condition: {{ $json.size > 1048576 }} (> 1MB)\n- Small files only: {{ $json.size < 10240 }} (< 10KB)\n- Size range: {{ $json.size >= 1024 && $json.size <= 5242880 }}\n\n\ud83d\udcc5 DATE-BASED FILTERING:\n- Recent files: {{ $json.date > $now.minus({days: 7}) }}\n- Older files: {{ $json.date < $now.minus({months: 1}) }}\n- Specific date range: Use date comparisons\n\n\ud83d\udcdb NAME PATTERN FILTERING:\n- Starts with: ^report_.*\n- Ends with: .*_backup$\n- Contains: .*important.*\n- Exclude pattern: ^(?!temp_).*\n\n\u26a0\ufe0f FILTER BYPASS:\n- Remove this node to transfer ALL files\n- Be cautious with unrestricted transfers\n- Consider disk space and bandwidth\n\n\ud83c\udfaf TESTING FILTERS:\n1. Use 'Execute Node' to test filter logic\n2. Check output to verify correct files selected\n3. Adjust regex patterns as needed\n4. Validate with different file types\n\n\ud83d\udca1 PERFORMANCE TIP:\n- Specific filters reduce processing time\n- Avoid overly complex regex patterns\n- Test filters with representative data",
      "position": [
        736,
        512
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "file-filter-condition",
              "operator": {
                "type": "string",
                "operation": "regex"
              },
              "leftValue": "={{ $json.name }}",
              "rightValue": "\\.(txt|csv|json|xml)$"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "76837f02-91d3-47f9-aa45-4814c8fd32d1",
      "name": "Download File",
      "type": "n8n-nodes-base.ftp",
      "notes": "FILE DOWNLOAD OPERATION:\n\n\ud83d\udce5 DOWNLOAD CONFIGURATION:\n- Operation: 'Download File'\n- Binary Property: 'file_data' (stores file content)\n- Dynamic path: {{ $json.name }} (from previous node)\n- Uses same credentials as listing operation\n\n\ud83c\udfaf IMPORTANT SETTINGS:\n- Path Expression: {{ $json.name }}\n- Binary Data Property: file_data\n- Timeout: 300 seconds (5 minutes)\n- Auto-retry: 3 attempts on failure\n\n\ud83d\udcca PERFORMANCE CONSIDERATIONS:\n\n\u23f1\ufe0f TIMEOUT SETTINGS:\n- Small files (<10MB): Default timeout (60s)\n- Medium files (10MB-100MB): 300 seconds\n- Large files (>100MB): 600+ seconds\n- Adjust based on network speed\n\n\ud83d\uddc2\ufe0f FILE SIZE LIMITS:\n- n8n default: 150MB per execution\n- Large files may cause memory issues\n- Consider file size filtering\n- Split large transfers into batches\n\n\ud83d\udd04 RETRY LOGIC:\n- Automatic retry on network errors\n- 3 attempts with exponential backoff\n- Preserves original file on failure\n- Error details logged for debugging\n\n\ud83d\udcbe MEMORY MANAGEMENT:\n- Files stored in n8n temporary memory\n- Automatic cleanup after workflow completion\n- Monitor server RAM usage for large files\n- Consider streaming for very large files\n\n\u26a0\ufe0f ERROR SCENARIOS:\n- Network interruption: Auto-retry enabled\n- File permissions: Check source server access\n- File locked: Retry after delay\n- Disk space: Monitor n8n server storage\n- Timeout: Increase timeout for large files\n\n\ud83d\udd0d MONITORING:\n- Check execution logs for download times\n- Monitor network bandwidth usage\n- Track success/failure rates\n- Set up alerts for repeated failures\n\n\ud83d\udee0\ufe0f TROUBLESHOOTING:\n- Download fails: Check file permissions\n- Slow downloads: Verify network speed\n- Timeout errors: Increase timeout setting\n- Memory errors: Reduce batch size or file size limit\n\n\ud83d\udcc8 OUTPUT DATA:\n- Binary data stored in 'file_data' property\n- Original filename preserved\n- File metadata available for next nodes\n- Ready for upload to destination server",
      "position": [
        960,
        512
      ],
      "parameters": {
        "path": "={{ $json.name }}",
        "options": {},
        "binaryPropertyName": "file_data"
      },
      "typeVersion": 1
    },
    {
      "id": "cee66200-dd84-4a31-b00b-81935cff7e86",
      "name": "Upload to Destination",
      "type": "n8n-nodes-base.ftp",
      "notes": "DESTINATION FTP UPLOAD:\n\n\ud83c\udfaf UPLOAD CONFIGURATION:\n- Operation: 'Upload File'\n- Source: Binary data from 'file_data' property\n- Dynamic destination path with filename preservation\n- Automatic directory creation enabled\n\n\ud83d\udd11 CREDENTIALS SETUP:\n1. Create separate FTP credential: 'Destination FTP Server'\n2. Verify write permissions on target server\n3. Test connectivity before production use\n4. Use different credentials than source for security\n\n\ud83d\udcc1 PATH STRUCTURE EXAMPLES:\n\n\ud83d\uddc2\ufe0f PRESERVE ORIGINAL STRUCTURE:\n/destination/directory/{{ $json.name }}\n\n\ud83d\udcc5 DATE-BASED ORGANIZATION:\n/files/{{ $now.format('YYYY/MM/DD') }}/{{ $json.name }}\n\n\ud83d\udcca TYPE-BASED ORGANIZATION:\n/files/{{ $json.name.split('.').pop() }}/{{ $json.name }}\n\n\ud83d\udc64 USER-BASED ORGANIZATION:\n/users/{{ $json.owner || 'system' }}/{{ $json.name }}\n\n\u2699\ufe0f UPLOAD OPTIONS:\n\n\u2705 ENABLED FEATURES:\n- createDirectories: true (auto-create missing folders)\n- preserveTimestamp: true (maintain original dates)\n- overwriteExisting: false (prevent accidental overwrites)\n\n\ud83d\udd04 ADDITIONAL OPTIONS:\n- Resume broken uploads: true\n- Verify after upload: true\n- Atomic upload: true (temp file \u2192 rename)\n- Permission setting: 644 (read/write owner, read others)\n\n\ud83d\udee1\ufe0f SECURITY MEASURES:\n- Separate credentials for source/destination\n- Write-only permissions where possible\n- Regular credential rotation\n- Audit trail maintenance\n\n\u26a1 PERFORMANCE OPTIMIZATION:\n- Parallel uploads for multiple files\n- Compression for large text files\n- Resume capability for interrupted transfers\n- Bandwidth limiting for peak hours\n\n\ud83c\udfaf SUCCESS VALIDATION:\n- File existence check after upload\n- Size comparison (source vs destination)\n- Checksum verification (optional)\n- Timestamp preservation validation\n\n\u26a0\ufe0f ERROR SCENARIOS & SOLUTIONS:\n- Disk full: Monitor destination storage\n- Permission denied: Verify write access\n- Connection lost: Auto-retry with backoff\n- Filename conflicts: Use unique naming\n\n\ud83d\udcca MONITORING METRICS:\n- Upload speed (MB/s)\n- Success rate percentage\n- Average file size\n- Total data transferred\n- Error frequency and types\n\n\ud83d\udd27 TROUBLESHOOTING GUIDE:\n- Upload fails: Check destination permissions\n- Slow uploads: Verify network connectivity\n- Directory errors: Ensure path format is correct\n- Authentication issues: Validate credentials\n- File corruption: Enable checksum verification\n\n\ud83d\udcc8 OUTPUT INFORMATION:\n- Upload success status\n- Destination file path\n- Transfer duration\n- File size confirmation\n- Any warnings or errors",
      "position": [
        1184,
        512
      ],
      "parameters": {
        "path": "/destination/directory/{{ $json.name }}",
        "options": {},
        "binaryPropertyName": "file_data"
      },
      "typeVersion": 1
    },
    {
      "id": "df6e949f-839e-4ab5-80c8-243b16409720",
      "name": "Upload Success?",
      "type": "n8n-nodes-base.filter",
      "notes": "SUCCESS VALIDATION:\n\nCHECKS PERFORMED:\n- Upload operation success status\n- File transfer completion\n- No error conditions\n\nNEXT STEPS:\n- TRUE: Proceed to cleanup (delete source)\n- FALSE: Route to error handling\n\nADDITIONAL VALIDATIONS:\n- File size comparison\n- Checksum verification\n- Timestamp validation\n\nCONFIGURATION:\n- Adjust condition based on FTP node output\n- May need to check different properties\n- Test with actual transfer results",
      "position": [
        1408,
        512
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 1,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "success-condition",
              "operator": {
                "type": "boolean",
                "operation": "equal"
              },
              "leftValue": "={{ $json.success }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "8e3a057f-f21c-4129-a43d-17960b58b26a",
      "name": "Delete Source File",
      "type": "n8n-nodes-base.ftp",
      "notes": "SOURCE FILE CLEANUP:\n\nOPERATION: DELETE\n- Removes file from source server\n- Only after successful upload\n- Prevents duplicate processing\n\nSAFETY MEASURES:\n- Only runs after upload verification\n- Maintains transfer logs\n- Consider backup retention period\n\nALTERNATIVE STRATEGIES:\n1. MOVE to 'processed' folder instead of delete\n2. RENAME with timestamp suffix\n3. ARCHIVE to compressed format\n\nRISK MITIGATION:\n- Test thoroughly before production\n- Implement rollback procedures\n- Monitor deletion operations\n\nIMPORTANT: Disable this step for testing!",
      "position": [
        1632,
        512
      ],
      "parameters": {
        "path": "={{ $json.name }}",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "4c15a875-60ab-462e-a780-1e50337f7ca3",
      "name": "Log Success",
      "type": "n8n-nodes-base.set",
      "notes": "SUCCESS LOGGING:\n\nLOG FIELDS:\n- Timestamp: ISO format with timezone\n- Filename: Original file name\n- Status: SUCCESS indicator\n- File Size: In bytes for monitoring\n- Operation: Type of migration performed\n\nLOGGING ENHANCEMENTS:\n- Add source/destination server info\n- Include transfer duration\n- Record file checksums\n- Track user/process info\n\nOUTPUT OPTIONS:\n1. Database logging (add database node)\n2. File logging (append to CSV/JSON)\n3. External API (webhook notification)\n4. Email notifications\n\nMONITORING:\n- Use for operational dashboards\n- Generate migration reports\n- Track performance metrics",
      "position": [
        1856,
        512
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "log-timestamp",
              "name": "timestamp",
              "type": "string",
              "value": "={{ $now.format('YYYY-MM-DD HH:mm:ss') }}"
            },
            {
              "id": "log-filename",
              "name": "filename",
              "type": "string",
              "value": "={{ $json.name }}"
            },
            {
              "id": "log-status",
              "name": "status",
              "type": "string",
              "value": "SUCCESS"
            },
            {
              "id": "log-filesize",
              "name": "file_size_bytes",
              "type": "number",
              "value": "={{ $json.size }}"
            },
            {
              "id": "log-operation",
              "name": "operation",
              "type": "string",
              "value": "MIGRATE_AND_DELETE"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "18f4a55b-d5d5-4c44-8116-70614e4b01c6",
      "name": "Send Email Success Alert",
      "type": "n8n-nodes-base.emailSend",
      "notes": "EMAIL SUCCESS NOTIFICATION:\n\n\ud83d\udce7 SUCCESS NOTIFICATION SETTINGS:\n- Sends confirmation email for successful transfers\n- Includes transfer details and file information\n- Uses same SMTP credentials as error notifications\n- Helps maintain audit trail of all operations\n\n\u2705 EMAIL CONTENT:\n- Timestamp of successful completion\n- Filename and size of transferred file\n- Operation type and status confirmation\n- Summary of all workflow steps completed\n\n\ud83d\udcec NOTIFICATION FREQUENCY:\n- One email per successful file transfer\n- Can be modified to send daily/weekly summaries\n- Consider batch notifications for high-volume transfers\n\n\u2699\ufe0f CUSTOMIZATION OPTIONS:\n\n\ud83d\udcca SUMMARY REPORTS:\n- Change to HTML format for better presentation\n- Include charts or statistics\n- Add file thumbnails for images\n- Include transfer speed metrics\n\n\ud83d\udcdd CONTENT MODIFICATIONS:\n- Add recipient-specific information\n- Include business context or next steps\n- Add links to file locations\n- Include compliance or audit information\n\n\ud83d\udc65 RECIPIENT MANAGEMENT:\n- Multiple recipients with CC/BCC\n- Different notifications for different teams\n- Role-based notification content\n- Escalation for VIP files or large transfers\n\n\ud83d\udd15 NOTIFICATION CONTROL:\n- Add conditions to skip notifications for certain files\n- Time-based notification suppression (e.g., only during business hours)\n- File size thresholds for notifications\n- Success rate thresholds (only notify if multiple successes)\n\n\ud83d\udcc8 REPORTING INTEGRATION:\n- Can feed into business intelligence systems\n- Generate compliance reports\n- Track SLA compliance\n- Monitor operational efficiency\n\nNOTE: For high-volume environments, consider implementing batch notifications to avoid email flooding",
      "position": [
        2080,
        512
      ],
      "parameters": {
        "options": {
          "allowUnauthorizedCerts": false
        },
        "subject": "\u2705 FTP Migration Success - {{ $now.format('YYYY-MM-DD HH:mm') }}",
        "toEmail": "user@example.com",
        "fromEmail": "user@example.com"
      },
      "typeVersion": 2.1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ff89656f-95ee-4c16-a998-16763e6a5b23",
  "connections": {
    "Log Success": {
      "main": [
        [
          {
            "node": "Send Email Success Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Files": {
      "main": [
        [
          {
            "node": "Download File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File": {
      "main": [
        [
          {
            "node": "Upload to Destination",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Success?": {
      "main": [
        [
          {
            "node": "Delete Source File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Source File": {
      "main": [
        [
          {
            "node": "Log Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Schedule (2 AM)": {
      "main": [
        [
          {
            "node": "List Files - Source FTP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Destination": {
      "main": [
        [
          {
            "node": "Upload Success?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List Files - Source FTP": {
      "main": [
        [
          {
            "node": "Filter Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email Success Alert": {
      "main": [
        []
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This n8n workflow automates the secure transfer of files between FTP servers on a scheduled basis, providing enterprise-grade reliability with comprehensive error handling and dual notification systems (email + webhook). Perfect for data migrations, automated backups, and…

Source: https://n8n.io/workflows/8161/ — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

General

Complete backup solution that saves both workflows and credentials to local/server disk with optional FTP upload for off-site redundancy.

Read Write File, Email Send, Execute Command +3
General

Perfect for content publishing with organic scheduling patterns, social media automation, API systems that need to avoid rate limiting, or any automation requiring randomised timing control across mul

n8n, Read Write File, Stop And Error +1
General

Perfect for disaster recovery or migrating between environments, this workflow automatically identifies your most recent FTP backup and provides a manual restore capability that intelligently excludes

Email Send, Ftp, Read Write File +2
General

This workflow automatically monitors government regulatory changes and provides comprehensive compliance tracking and executive alerts. Scheduled Monitoring - Runs daily at 9 AM to check for new regul

N8N Nodes Scrapegraphai, Email Send
General

⚠️ Important: This workflow uses the Autype community node and requires a self-hosted n8n instance.

Noco Db, N8N Nodes Autype, Email Send