{
  "workflow": {
    "id": 5425,
    "name": "AI-powered file management automation for Google Drive with MCP",
    "views": 4167,
    "recentViews": 1,
    "totalViews": 4167,
    "createdAt": "2025-06-28T03:58:19.167Z",
    "description": "*This workflow contains community nodes that are only compatible with the self-hosted version of n8n.* \n\n## 📁 Google Drive MCP Workflow – AI-Powered File Management Automation 🚀\n\n## 🧠 Overview\nA secure and intelligent n8n workflow that connects with Google Drive via MCP (Model Control Protocol). Ideal for AI agent tasks, compliance-driven storage, and document automation.\n\n## 🌟 Key Features\n🔒 Built-In Safety\n\nBacks up files before edits (timestamped)\nSupports rollback using file history\nValidates file size, type, and permissions\n📁 Smart Organization\n\nAutomatically converts file types (PDF, DOCX, etc.)\nMoves files to structured folders\nAuto-archives old files based on age or rules\n## 🔄 MCP Integration\n\nAccepts standardized JSON via webhook\nReal-time execution for AI agents\nFully customizable input (action, fileId, format, etc.)\n## ✅ AI Callable MCP Actions\nThese are the commands AI agents can perform via MCP:\n\nDownload a file (with optional format conversion)\nUpload a new file to Google Drive\nCopy a file for backup\nMove a file to a specific folder\nArchive old or inactive files\nOrganize documents into folders\nConvert files to a new format (PDF, DOCX, etc.)\nRetrieve and review file history for rollback\n📝 Example Input\n{\n  \"action\": \"download\",\n  \"fileId\": \"abc123\",\n  \"folderPath\": \"/projects/clientA\",\n  \"convertFormat\": \"pdf\"\n}\n## 🔐 Security & Performance\nOAuth2 secured access to Google Drive API\nNo sensitive data stored in transit\nReal-time audit logs and alerts\nBatch-friendly with built-in rate limiting\n📌 Ideal For\nBusinesses automating file management\nAI Agents retrieving, sorting, converting, or archiving files\nCompliance teams needing file versioning and backups\n⚙️ Requirements\nn8n + Google Drive API v3\nMCP server + Webhook integration\nGoogle OAuth2 Credentials\n",
    "workflow": {
      "id": "jmF1lTCcJ7Sz44XB",
      "meta": {
        "instanceId": "2000c64071c20843606b95c63795bb0797c41036047055a6586498e855b96efc",
        "templateCredsSetupCompleted": true
      },
      "name": "Google Drive MCP",
      "tags": [],
      "nodes": [
        {
          "id": "0e364a8b-0c13-44d6-9b97-3b979450f30d",
          "name": "MCP Server Trigger",
          "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
          "notes": "Entry point for the workflow - triggers when MCP server receives a request",
          "position": [
            1400,
            420
          ],
          "webhookId": "ab3b0e89-c55b-4d86-a9a7-73b7ebdb99da",
          "parameters": {
            "path": "ab3b0e89-c55b-4d86-a9a7-73b7ebdb99da"
          },
          "typeVersion": 1.1
        },
        {
          "id": "f3bd2712-a9e9-4058-be2e-b958cecca7f4",
          "name": "Create Backup",
          "type": "n8n-nodes-base.googleDriveTool",
          "notes": "Creates timestamped backup copy in dedicated Backups folder before any modifications",
          "position": [
            1060,
            420
          ],
          "parameters": {
            "name": "={{ $json.name }}_backup_{{ $now.format('YYYY-MM-DD_HH-mm-ss') }}",
            "fileId": {
              "__rl": true,
              "mode": "list",
              "value": ""
            },
            "options": {},
            "operation": "copy"
          },
          "credentials": {
            "googleDriveOAuth2Api": {
              "id": "credential-id",
              "name": "googleDriveOAuth2Api Credential"
            }
          },
          "typeVersion": 3
        },
        {
          "id": "0ad52d69-2582-489e-b7a7-1691227eb23d",
          "name": "Move to Processed",
          "type": "n8n-nodes-base.googleDriveTool",
          "notes": "Moves processed files to organized folder structure",
          "position": [
            1060,
            1140
          ],
          "parameters": {
            "fileId": {
              "__rl": true,
              "mode": "list",
              "value": ""
            },
            "driveId": {
              "__rl": true,
              "mode": "list",
              "value": "My Drive"
            },
            "folderId": {
              "__rl": true,
              "mode": "list",
              "value": "processed_folder_id",
              "cachedResultName": "Processed"
            },
            "operation": "move"
          },
          "credentials": {
            "googleDriveOAuth2Api": {
              "id": "credential-id",
              "name": "googleDriveOAuth2Api Credential"
            }
          },
          "typeVersion": 3
        },
        {
          "id": "505f47e5-9351-4737-98bf-4b9b2c4461d1",
          "name": "Archive Old Files",
          "type": "n8n-nodes-base.googleDriveTool",
          "notes": "Archives files older than specified threshold to maintain clean workspace",
          "position": [
            1060,
            900
          ],
          "parameters": {
            "fileId": {
              "__rl": true,
              "mode": "list",
              "value": ""
            },
            "driveId": {
              "__rl": true,
              "mode": "list",
              "value": "My Drive"
            },
            "folderId": {
              "__rl": true,
              "mode": "list",
              "value": "archive_folder_id",
              "cachedResultName": "Archive"
            },
            "operation": "move"
          },
          "credentials": {
            "googleDriveOAuth2Api": {
              "id": "credential-id",
              "name": "googleDriveOAuth2Api Credential"
            }
          },
          "typeVersion": 3
        },
        {
          "id": "79730ea8-cbe3-4edb-a0cf-b1519d625e8a",
          "name": "Workflow Overview",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            600,
            180
          ],
          "parameters": {
            "color": 4,
            "width": 350,
            "height": 520,
            "content": "## Google Drive File Management Workflow\n\nThis workflow provides comprehensive file management capabilities for Google Drive:\n\n### Key Features:\n- **Smart Processing**: Downloads with format conversion\n- **Safety First**: Creates backups before modifications\n- **Organization**: Moves files to appropriate folders\n- **Audit Trail**: Logs all activities\n\n### Workflow Path:\n1. MCP Trigger receives request\n2. List files or download specific file\n3. Create backup if modifying\n4. Process based on file type/size\n5. Move to organized folders\n6. Log all activities"
          },
          "typeVersion": 1
        },
        {
          "id": "aae3f651-0334-4856-83fa-fb9d038ec504",
          "name": "Input Parameters",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            640,
            760
          ],
          "parameters": {
            "color": 3,
            "width": 300,
            "height": 480,
            "content": "=### Input Parameters\n\n**MCP Trigger accepts:**\n- `action`:  download, move, archive\n- `fileId`: specific file identifier\n- `folderPath`: target folder path\n- `filters`: file type, size, date filters\n\n**Example payload:**\n```json\n{\n  \"action\": \"download\",\n  \"fileId\": \"1a2b3c4d5e6f\",\n  \"convertFormat\": \"pdf\"\n}\n```"
          },
          "typeVersion": 1
        },
        {
          "id": "36deeaac-5bfb-4040-b46d-1ceb8251f6c5",
          "name": "Safety & Best Practices",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            1800,
            180
          ],
          "parameters": {
            "color": 6,
            "width": 380,
            "height": 380,
            "content": "## Error Handling & Safety\n\n**Built-in Safeguards:**\n- Backup creation before modifications\n- File size and type validation\n- Detailed error logging\n- Rollback capabilities\n\n**Best Practices:**\n- Test with non-critical files first\n- Monitor processing logs regularly\n- Set up folder permissions properly\n- Use version control for important docs"
          },
          "typeVersion": 1
        },
        {
          "id": "25c70e4f-0f4b-4c34-9a62-9ff6840d3289",
          "name": "Performance Tips",
          "type": "n8n-nodes-base.stickyNote",
          "position": [
            1820,
            620
          ],
          "parameters": {
            "color": 5,
            "width": 300,
            "height": 280,
            "content": "## Performance Optimization\n\n**Recommendations:**\n- Use batch operations for multiple files\n- Implement rate limiting for API calls\n- Cache frequently accessed file metadata\n- Set up webhooks for real-time updates\n\n**Monitoring:**\n- Track API quota usage\n- Monitor workflow execution time\n- Set up alerts for failures\n- Regular cleanup of old logs"
          },
          "typeVersion": 1
        },
        {
          "id": "43feec90-091a-4614-b741-0544b5d12342",
          "name": "Google Drive",
          "type": "n8n-nodes-base.googleDriveTool",
          "position": [
            1280,
            1120
          ],
          "parameters": {
            "fileId": {
              "__rl": true,
              "mode": "list",
              "value": ""
            },
            "options": {},
            "operation": "download"
          },
          "credentials": {
            "googleDriveOAuth2Api": {
              "id": "credential-id",
              "name": "googleDriveOAuth2Api Credential"
            }
          },
          "typeVersion": 3
        },
        {
          "id": "25967a87-b6d6-4abf-be03-7a360d79cb10",
          "name": "Drive upload",
          "type": "n8n-nodes-base.googleDriveTool",
          "position": [
            1060,
            660
          ],
          "parameters": {
            "driveId": {
              "__rl": true,
              "mode": "list",
              "value": "My Drive"
            },
            "options": {},
            "folderId": {
              "__rl": true,
              "mode": "list",
              "value": "root",
              "cachedResultName": "/ (Root folder)"
            }
          },
          "credentials": {
            "googleDriveOAuth2Api": {
              "id": "credential-id",
              "name": "googleDriveOAuth2Api Credential"
            }
          },
          "typeVersion": 3
        }
      ],
      "active": false,
      "pinData": {},
      "settings": {
        "executionOrder": "v1"
      },
      "versionId": "9eb46725-afe3-4411-8b28-7c9b39ad8b77",
      "connections": {
        "Drive upload": {
          "ai_tool": [
            [
              {
                "node": "MCP Server Trigger",
                "type": "ai_tool",
                "index": 0
              }
            ]
          ]
        },
        "Google Drive": {
          "ai_tool": [
            [
              {
                "node": "MCP Server Trigger",
                "type": "ai_tool",
                "index": 0
              }
            ]
          ]
        },
        "Create Backup": {
          "ai_tool": [
            [
              {
                "node": "MCP Server Trigger",
                "type": "ai_tool",
                "index": 0
              }
            ]
          ]
        },
        "Archive Old Files": {
          "ai_tool": [
            [
              {
                "node": "MCP Server Trigger",
                "type": "ai_tool",
                "index": 0
              }
            ]
          ]
        },
        "Move to Processed": {
          "ai_tool": [
            [
              {
                "node": "MCP Server Trigger",
                "type": "ai_tool",
                "index": 0
              }
            ]
          ]
        }
      }
    },
    "lastUpdatedBy": 51,
    "workflowInfo": {
      "nodeCount": 10,
      "nodeTypes": {
        "n8n-nodes-base.stickyNote": {
          "count": 4
        },
        "n8n-nodes-base.googleDriveTool": {
          "count": 5
        },
        "@n8n/n8n-nodes-langchain.mcpTrigger": {
          "count": 1
        }
      }
    },
    "status": "published",
    "user": {
      "name": "David Olusola",
      "username": "dae221",
      "bio": "I design enterprise-grade automation systems that eliminate bottlenecks, cut manual work by 70%+, and unlock millions in lost revenue opportunities. My clients — typically achieve 5–10x ROI within the first 90 days. Currently partnering with select high-growth companies ready to scale faster with AI automation.  david@daexai.com",
      "verified": true,
      "links": [
        ""
      ],
      "avatar": "https://gravatar.com/avatar/2abbc4c9e828c54a8d8838beda1382e8e4a66684ef9fa8451dbeb3e72b0c9f9c?r=pg&d=retro&size=200"
    },
    "nodes": [
      {
        "id": 565,
        "icon": "fa:sticky-note",
        "name": "n8n-nodes-base.stickyNote",
        "codex": {
          "data": {
            "alias": [
              "Comments",
              "Notes",
              "Sticky"
            ],
            "categories": [
              "Core Nodes"
            ],
            "nodeVersion": "1.0",
            "codexVersion": "1.0",
            "subcategories": {
              "Core Nodes": [
                "Helpers"
              ]
            }
          }
        },
        "group": "[\"input\"]",
        "defaults": {
          "name": "Sticky Note",
          "color": "#FFD233"
        },
        "iconData": {
          "icon": "sticky-note",
          "type": "icon"
        },
        "displayName": "Sticky Note",
        "typeVersion": 1,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          }
        ]
      },
      {
        "id": 1293,
        "icon": "file:../mcp.svg",
        "name": "@n8n/n8n-nodes-langchain.mcpTrigger",
        "codex": {
          "data": {
            "alias": [
              "Model Context Protocol",
              "MCP Server"
            ],
            "resources": {
              "primaryDocumentation": [
                {
                  "url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger/"
                }
              ]
            },
            "categories": [
              "AI",
              "Core Nodes",
              "Langchain"
            ],
            "subcategories": {
              "AI": [
                "Root Nodes",
                "Model Context Protocol"
              ],
              "Core Nodes": [
                "Other Trigger Nodes"
              ]
            }
          }
        },
        "group": "[\"trigger\"]",
        "defaults": {
          "name": "MCP Server Trigger"
        },
        "iconData": {
          "type": "file",
          "fileBuffer": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgwIiBoZWlnaHQ9IjE4MCIgdmlld0JveD0iMCAwIDE5NSAxOTUiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+Cgk8ZyBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMTIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+CgkJPHBhdGggZD0iTTI1IDk3Ljg1MjhMOTIuODgyMyAyOS45NzA2QzEwMi4yNTUgMjAuNTk4IDExNy40NTEgMjAuNTk4IDEyNi44MjMgMjkuOTcwNlYyOS45NzA2QzEzNi4xOTYgMzkuMzQzMSAxMzYuMTk2IDU0LjUzOTEgMTI2LjgyMyA2My45MTE3TDc1LjU1ODEgMTE1LjE3NyIvPgoJCTxwYXRoIGQ9Ik03Ni4yNjUzIDExNC40N0wxMjYuODIzIDYzLjkxMTdDMTM2LjE5NiA1NC41MzkxIDE1MS4zOTIgNTQuNTM5MSAxNjAuNzY1IDYzLjkxMTdMMTYxLjExOCA2NC4yNjUyQzE3MC40OTEgNzMuNjM3OCAxNzAuNDkxIDg4LjgzMzggMTYxLjExOCA5OC4yMDYzTDk5LjcyNDggMTU5LjZDOTYuNjAwNiAxNjIuNzI0IDk2LjYwMDYgMTY3Ljc4OSA5OS43MjQ4IDE3MC45MTNMMTEyLjMzMSAxODMuNTIiLz4KCQk8cGF0aCBkPSJNMTA5Ljg1MyA0Ni45NDExTDU5LjY0ODIgOTcuMTQ1N0M1MC4yNzU3IDEwNi41MTggNTAuMjc1NyAxMjEuNzE0IDU5LjY0ODIgMTMxLjA4N1YxMzEuMDg3QzY5LjAyMDggMTQwLjQ1OSA4NC4yMTY4IDE0MC40NTkgOTMuNTg5NCAxMzEuMDg3TDE0My43OTQgODAuODgyMiIvPgoJPC9nPgo8L3N2Zz4K"
        },
        "displayName": "MCP Server Trigger",
        "typeVersion": 2,
        "nodeCategories": [
          {
            "id": 9,
            "name": "Core Nodes"
          },
          {
            "id": 25,
            "name": "AI"
          },
          {
            "id": 26,
            "name": "Langchain"
          }
        ]
      }
    ],
    "categories": [
      {
        "id": 36,
        "name": "File Management"
      }
    ],
    "image": []
  }
}