Skip to main content

Automated Google Drive to FTP transfer with JSON logging & reports

Workflow preview

Workflow preview
100%
Automated Google Drive to FTP transfer with JSON logging & reports preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Google Drive to FTP Transfer Workflow Setup Guide Overview This n8n workflow automatically transfers files from Google Drive to an FTP server on a scheduled basis. It includes comprehensive logging...

Best for

  • File Management automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.googledrive, n8n-nodes-base.code, n8n-nodes-base.splitinbatches, n8n-nodes-base.ftp, n8n-nodes-base.if, n8n-nodes-base.writebinaryfile

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Dariusz Koryto.

Original n8n.io source

1.1 Workflow description

Title
Automated Google Drive to FTP transfer with JSON logging & reports
Workflow name
Automated Google Drive to FTP transfer with JSON logging & reports

Google Drive to FTP Transfer Workflow - Setup Guide

Overview

This n8n workflow automatically transfers files from Google Drive to an FTP server on a scheduled basis. It includes comprehensive logging, email notifications, and error handling.

Features

  • Automated Scheduling: Runs every 6 hours (customizable)
  • Manual Trigger: Webhook endpoint for on-demand transfers
  • File Filtering: Supports specific file types and size limits
  • Comprehensive Logging: Detailed transfer reports saved to Google Drive
  • Email Notifications: HTML reports sent after each run
  • Error Handling: Graceful handling of failed transfers
  • Batch Processing: Files processed individually to prevent rate limits

Prerequisites

Before setting up this workflow, ensure you have:

  1. n8n instance running (self-hosted or cloud)
  2. Google Drive account with files to transfer
  3. FTP server with upload permissions
  4. Email service for sending reports (SMTP)

Step-by-Step Setup Instructions

1. Google Drive API Setup

1.1 Create Google Cloud Project
  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Enable the Google Drive API:
    • Navigate to "APIs & Services" → "Library"
    • Search for "Google Drive API"
    • Click "Enable"
1.2 Create OAuth2 Credentials
  1. Go to "APIs & Services" → "Credentials"
  2. Click "Create Credentials" → "OAuth client ID"
  3. Configure consent screen if prompted
  4. Choose "Web application" as application type
  5. Add your n8n instance URL to authorized redirect URIs:
    https://your-n8n-instance.com/rest/oauth2-credential/callback
    
  6. Note down the Client ID and Client Secret
1.3 Configure n8n Credential
  1. In n8n, go to "Credentials" → "Add Credential"
  2. Select "Google Drive OAuth2 API"
  3. Enter your Client ID and Client Secret
  4. Complete OAuth flow by clicking "Connect my account"
  5. Set credential ID as: your-google-drive-credentials-id

2. FTP Server Setup

2.1 FTP Server Requirements
  • Ensure FTP server is accessible from your n8n instance
  • Verify you have upload permissions
  • Note the server details:
    • Host/IP address
    • Port (usually 21 for FTP)
    • Username and password
    • Destination directory path
2.2 Configure n8n FTP Credential
  1. In n8n, go to "Credentials" → "Add Credential"
  2. Select "FTP"
  3. Enter your FTP server details:
    • Host: your-ftp-server.com
    • Port: 21 (or your custom port)
    • Username: your-ftp-username
    • Password: your-ftp-password
  4. Set credential ID as: your-ftp-credentials-id

3. Email Setup (SMTP)

3.1 Choose Email Provider

Configure SMTP settings for one of these providers:

  • Gmail: smtp.gmail.com, port 587, use App Password
  • Outlook: smtp-mail.outlook.com, port 587
  • Custom SMTP: Your organization's SMTP server
3.2 Configure n8n Email Credential
  1. In n8n, go to "Credentials" → "Add Credential"
  2. Select "SMTP"
  3. Enter your SMTP details:
    • Host: smtp.gmail.com (or your provider)
    • Port: 587
    • Security: STARTTLS
    • Username: [email protected]
    • Password: your-app-password
  4. Set credential ID as: your-email-credentials-id

4. Workflow Configuration

4.1 Import Workflow
  1. Copy the workflow JSON from the artifact above
  2. In n8n, click "Import from JSON"
  3. Paste the workflow JSON and import
4.2 Update Credential References
  1. Google Drive nodes: Verify credential ID matches your-google-drive-credentials-id
  2. FTP node: Verify credential ID matches your-ftp-credentials-id
  3. Email node: Verify credential ID matches your-email-credentials-id
4.3 Customize Parameters
FTP Server Settings (Upload to FTP node)
{
  "host": "your-ftp-server.com",           // Replace with your FTP host
  "username": "your-ftp-username",         // Replace with your FTP username
  "password": "your-ftp-password",         // Replace with your FTP password
  "path": "/remote/directory/{{ $json.validFiles[$json.batchIndex].name }}", // Update destination path
  "port": 21                               // Change if using different port
}
Email Settings (Send Report Email node)
{
  "sendTo": "[email protected]",       // Replace with your email address
  "subject": "Google Drive to FTP File Transfer - Report"
}
File Filter Settings (Filter & Validate Files node)

In the JavaScript code, update these settings:

const transferNotes = {
  settings: {
    maxFileSizeMB: 50,                     // Change maximum file size
    allowedExtensions: [                   // Add/remove allowed file types
      '.pdf', '.doc', '.docx', '.txt', 
      '.jpg', '.png', '.zip', '.xlsx'
    ],
    autoDeleteAfterTransfer: false,        // Set to true to delete from Drive after transfer
    verifyTransfer: true                   // Keep true for verification
  }
};
Google Drive Notes Storage (Upload Notes to Drive node)
{
  "parents": {
    "parentId": "your-notes-folder-id"     // Replace with actual folder ID from Google Drive
  }
}

5. Schedule Configuration

5.1 Modify Schedule Trigger

In the "Schedule Trigger" node, adjust the interval:

{
  "rule": {
    "interval": [
      {
        "field": "hours",
        "hoursInterval": 6               // Change to desired interval (hours)
      }
    ]
  }
}

Alternative schedule options:

  • Daily: "field": "days", "daysInterval": 1
  • Weekly: "field": "weeks", "weeksInterval": 1
  • Custom cron: Use cron expression for complex schedules
5.2 Webhook Configuration

The webhook trigger is available at:

POST https://your-n8n-instance.com/webhook/webhook-transfer-status

Use this for manual triggers or external integrations.

6. Testing and Validation

6.1 Test Connections
  1. Test Google Drive: Run "Get Drive Files" node manually
  2. Test FTP: Upload a test file using "Upload to FTP" node
  3. Test Email: Send a test email using "Send Report Email" node
6.2 Run Test Transfer
  1. Activate the workflow
  2. Click "Execute Workflow" to run manually
  3. Monitor execution in the workflow editor
  4. Check for any error messages or failed nodes
6.3 Verify Results
  • FTP Server: Confirm files appear in destination directory
  • Email: Check you receive the transfer report
  • Google Drive: Verify transfer notes are saved to specified folder

7. Monitoring and Maintenance

7.1 Workflow Monitoring
  • Execution History: Review past runs in n8n interface
  • Error Logs: Check failed executions for issues
  • Performance: Monitor execution times and resource usage
7.2 Regular Maintenance
  • Credential Renewal: Google OAuth tokens may need periodic renewal
  • Storage Cleanup: Consider archiving old transfer notes
  • Performance Tuning: Adjust batch sizes or schedules based on usage

8. Troubleshooting

8.1 Common Issues

Google Drive Authentication Errors:

  • Verify OAuth2 credentials are correctly configured
  • Check if Google Drive API is enabled
  • Ensure redirect URI matches n8n instance URL

FTP Connection Failures:

  • Verify FTP server credentials and connectivity
  • Check firewall settings allow FTP connections
  • Confirm destination directory exists and has write permissions

Email Delivery Issues:

  • Verify SMTP credentials and server settings
  • Check if email provider requires app-specific passwords
  • Ensure sender email is authorized

File Transfer Failures:

  • Check file size limits in filter settings
  • Verify allowed file extensions include your file types
  • Monitor FTP server disk space
8.2 Debug Mode

Enable debug mode by:

  1. Adding console.log statements in code nodes
  2. Using "Execute Workflow" with step-by-step execution
  3. Checking node outputs for data validation

9. Advanced Customizations

9.1 Additional File Filters

Add custom filtering logic in the "Filter & Validate Files" node:

// Example: Filter by modification date
const isRecentFile = new Date(file.modifiedTime) > new Date(Date.now() - 7 * 24 * 60 * 60 * 1000); // Last 7 days

// Example: Filter by folder location
const isInSpecificFolder = file.parents && file.parents.includes('specific-folder-id');
9.2 Enhanced Reporting

Customize the email report template in "Send Report Email" node:

<h2>📊 File Transfer Report</h2>
<div>
  <h3>Summary</h3>
  <ul>
    <li><strong>Date:</strong> {{ new Date().toLocaleString('en-US') }}</li>
    <li><strong>Success Rate:</strong> {{ Math.round((successfulTransfers / totalFiles) * 100) }}%</li>
    
  </ul>
</div>
9.3 Integration with Other Services

Add nodes to integrate with:

  • Slack: Send notifications to team channels
  • Discord: Post updates to Discord servers
  • Webhook: Trigger other workflows or systems
  • Database: Log transfers to MySQL, PostgreSQL, etc.

10. Security Considerations

10.1 Credential Security
  • Use environment variables for sensitive data
  • Regularly rotate FTP and email passwords
  • Implement least-privilege access for service accounts
10.2 Network Security
  • Use SFTP instead of FTP when possible
  • Implement VPN connections for sensitive transfers
  • Monitor network traffic for unusual patterns
10.3 Data Privacy
  • Ensure compliance with data protection regulations
  • Implement data retention policies for transfer logs
  • Consider encryption for sensitive file transfers

Support and Resources

Documentation Links

Getting Help

If you encounter issues:

  1. Check the troubleshooting section above
  2. Review n8n execution logs for error details
  3. Search the n8n community forum for similar issues
  4. Create a support ticket with detailed error information

Note: Replace all placeholder values (URLs, credentials, IDs) with your actual configuration before running the workflow.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.1

Block 3 - Get Drive Files

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 4 - Filter & Validate Files

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Process One by One

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 6 - Download from Drive

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 7 - Upload to FTP

Type / Role
n8n-nodes-base.ftp - ftp
Config choices
Version 1

Block 8 - Update Notes - Success

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Update Notes - Error

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Check if More Files

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 11 - Save Notes JSON

Type / Role
n8n-nodes-base.writeBinaryFile - writeBinaryFile
Config choices
Version 1

Block 12 - Upload Notes to Drive

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 13 - Send Report Email

Type / Role
n8n-nodes-base.emailSend - emailSend
Config choices
Version 2.1

Block 14 - Webhook Trigger

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 15 - Create Final Report

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

3. Summary Table

Workflow Automated Google Drive to FTP transfer with JSON logging & reports
Complexity advanced
Nodes 15
Categories File Management
Author Dariusz Koryto
Published 30 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8072/8072.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Automated Google Drive to FTP transfer with JSON logging & reports do?

Google Drive to FTP Transfer Workflow Setup Guide Overview This n8n workflow automatically transfers files from Google Drive to an FTP server on a scheduled basis. It includes comprehensive logging...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your File Management use case.