AutomationFlowsAI & RAG › Automate Gmail Attachments to Google Drive

Automate Gmail Attachments to Google Drive

Original n8n title: Anis_hub 1

ANIS_HUB 1. Uses gmail, googleDrive, googleSheets, httpRequest. Webhook trigger; 89 nodes.

Webhook trigger★★★★★ complexityAI-powered89 nodesGmailGoogle DriveGoogle SheetsHTTP RequestGoogle Gemini ChatChain Llm
AI & RAG Trigger: Webhook Nodes: 89 Complexity: ★★★★★ AI nodes: yes Added:

This workflow follows the Chainllm → Gmail recipe pattern — see all workflows that pair these two integrations.

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
{
  "name": "ANIS_HUB 1",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "anis",
        "responseMode": "responseNode",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2.1,
      "position": [
        -96,
        -32
      ],
      "id": "YOUR_ID",
      "name": "Webhook"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{$json.body.agent}}",
                    "rightValue": "ingest",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "YOUR_ID"
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "YOUR_ID",
                    "leftValue": "={{$json.body.agent}}",
                    "rightValue": "clean",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "YOUR_ID",
                    "leftValue": "={{$json.body.agent}}",
                    "rightValue": "analyze",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "YOUR_ID",
                    "leftValue": "={{$json.body.agent}}",
                    "rightValue": "report",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        176,
        -64
      ],
      "id": "YOUR_ID",
      "name": "Switch \u2014 Router / Traffic Controller"
    },
    {
      "parameters": {
        "operation": "getAll",
        "limit": 10,
        "filters": {
          "q": "has:attachment newer_than:1d"
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        560,
        -1392
      ],
      "id": "YOUR_ID",
      "name": "Gmail \u2014 Get many messages",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "get",
        "messageId": "={{$json.id}}",
        "simple": false,
        "options": {
          "downloadAttachments": true
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        800,
        -1392
      ],
      "id": "YOUR_ID",
      "name": "Gmail \u2014 (Get Message + Download Attachments)",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "inputDataFieldName": "={{ Object.keys($binary)[0] }}",
        "name": "={{ $binary[Object.keys($binary)[0]].fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        1632,
        -1472
      ],
      "id": "YOUR_ID",
      "name": "Google Drive \u2014 Upload file to RAW folder",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "YOUR_ID",
              "leftValue": "={{ Object.keys($binary ?? {}).length }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1328,
        -1392
      ],
      "id": "YOUR_ID",
      "name": "IF Node \u2014 Condition: Item has $binary"
    },
    {
      "parameters": {
        "fieldToSplitOut": "$binary",
        "include": "allOtherFields",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        1056,
        -1392
      ],
      "id": "YOUR_ID",
      "name": "Split Out \u2014 (1 attachment = 1 item)"
    },
    {
      "parameters": {
        "operation": "download",
        "fileId": {
          "__rl": true,
          "value": "={{ $json[\"id\"] }}",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        1056,
        -320
      ],
      "id": "YOUR_ID",
      "name": "Google Drive \u2014 Download RAW file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "list",
          "cachedResultName": "AI_Factory_Control",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_ID",
          "mode": "list",
          "cachedResultName": "EVENT_LOG",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit#gid=2072862873"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ts": "={{ $now }}",
            "agent": "clean",
            "action": "unsupported_file",
            "notes": "Unsupported MIME type detected",
            "status": "error",
            "output": "unsupported",
            "input": "={{ $json[\"id\"] || $json[\"name\"] }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ts",
              "displayName": "ts",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "agent",
              "displayName": "agent",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "action",
              "displayName": "action",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "input",
              "displayName": "input",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "output",
              "displayName": "output",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "notes",
              "displayName": "notes",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        1504,
        -192
      ],
      "id": "YOUR_ID",
      "name": "Google Sheets \u2014 Append (EVENT_LOG) - unsupported_file",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "YOUR_ID",
              "leftValue": "={{ $binary.data.mimeType }}",
              "rightValue": "application/vnd.YOUR_ID.spreadsheetml.sheet",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            },
            {
              "id": "YOUR_ID",
              "leftValue": "={{ $binary.data.mimeType }}",
              "rightValue": "application/vnd.ms-excel",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            },
            {
              "id": "YOUR_ID",
              "leftValue": "={{ $binary.data.mimeType }}",
              "rightValue": "text/csv",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            },
            {
              "id": "YOUR_ID",
              "leftValue": "={{ $binary.data.mimeType }}",
              "rightValue": "application/pdf",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            },
            {
              "id": "YOUR_ID",
              "leftValue": "={{ $binary.data.mimeType }}",
              "rightValue": "text/plain",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            },
            {
              "id": "YOUR_ID",
              "leftValue": "={{ $binary.data.mimeType }}",
              "rightValue": "application/json",
              "operator": {
                "type": "string",
                "operation": "equals",
                "name": "filter.operator.equals"
              }
            }
          ],
          "combinator": "or"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1264,
        -320
      ],
      "id": "YOUR_ID",
      "name": "IF Node \u2014 Check MIME TYPE"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $binary.data.mimeType }}",
                    "rightValue": "application/vnd.YOUR_ID.spreadsheetml.sheet",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "YOUR_ID"
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "YOUR_ID",
                    "leftValue": "={{ $binary.data.mimeType }}",
                    "rightValue": "application/vnd.ms-excel",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "YOUR_ID",
                    "leftValue": "={{ $binary.data.mimeType }}",
                    "rightValue": "text/csv",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "YOUR_ID",
                    "leftValue": "={{ $binary.data.mimeType }}",
                    "rightValue": "application/json",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "YOUR_ID",
                    "leftValue": "={{ $binary.data.mimeType }}",
                    "rightValue": "application/pdf",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "YOUR_ID",
                    "leftValue": "={{ $binary.data.mimeType }}",
                    "rightValue": "text/plain",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.3,
      "position": [
        1728,
        -400
      ],
      "id": "YOUR_ID",
      "name": "Switch \u2014 Route MIME TYPE"
    },
    {
      "parameters": {
        "operation": "xlsx",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        2096,
        -992
      ],
      "id": "YOUR_ID",
      "name": "Extract from XLSX File"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        2400,
        -992
      ],
      "id": "YOUR_ID",
      "name": "Convert to CSV from XLSX"
    },
    {
      "parameters": {
        "operation": "xls",
        "options": {}
      },
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        2096,
        -816
      ],
      "id": "YOUR_ID",
      "name": "Extract from XLS File"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        2400,
        -816
      ],
      "id": "YOUR_ID",
      "name": "Convert to CSV from XLS"
    },
    {
      "parameters": {
        "operation": "toJson",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        2080,
        -640
      ],
      "id": "YOUR_ID",
      "name": "Spreadsheet File \u2014 Convert to JSON"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        2528,
        -640
      ],
      "id": "YOUR_ID",
      "name": "Spreadsheet File \u2014 Convert to CSV"
    },
    {
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// ===== Smart Normalization (optimized) =====\n\n// Column name mapping rules\nconst columnMap = {\n  \"full name\": \"name\",\n  \"email address\": \"email\",\n  \"phone no\": \"phone\",\n  \"amount ($)\": \"amount\",\n};\n\n// Default schema template\nconst defaultSchema = {\n  name: null,\n  email: null,\n  phone: null,\n  amount: null,\n  source_file: $json.filename || null,\n  processed_at: new Date().toISOString(),\n};\n\nlet normalized = {};\n\n// Normalize each key/value\nfor (let [key, value] of Object.entries($json)) {\n\n  // Key normalization: trim \u2192 lowercase \u2192 strip symbols \u2192 replace spaces with _\n  let cleanKey = key.trim().toLowerCase()\n    .replace(/[^a-z0-9 ]/g, \"\")\n    .replace(/\\s+/g, \"_\");\n\n  // Apply mapping\n  cleanKey = columnMap[cleanKey] || cleanKey;\n\n  // Value normalization\n  value = (value === \"\" || value === undefined || value === null)\n    ? null\n    : String(value).trim();\n\n  normalized[cleanKey] = value;\n}\n\n// Merge with schema defaults\nreturn { ...defaultSchema, ...normalized };\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2304,
        -640
      ],
      "id": "YOUR_ID",
      "name": "Function Node \u2014 Smart Normalization"
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\n\nfor (const item of items) {\n    let text = item.binary.data.toString('utf8');\n\n    text = text.replace(/\\r\\n|\\r/g, \"\\n\");\n    text = text.replace(/[ \\t]+/g, \" \");\n    text = text.replace(/\\n{3,}/g, \"\\n\\n\");\n    text = text.replace(/[\u201c\u201d]/g, '\"').replace(/[\u2018\u2019]/g, \"'\");\n    text = text.replace(/[^\\x09\\x0A\\x0D\\x20-\\x7E]/g, \"\");\n    text = text.split(\"\\n\").map(line => line.trim()).join(\"\\n\");\n\n    item.json = { content: text };      // <-- FIXED field name\n}\n\nreturn items;\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2144,
        48
      ],
      "id": "YOUR_ID",
      "name": "Function Node \u2014 Smart TXT Normalization"
    },
    {
      "parameters": {
        "operation": "toText",
        "sourceProperty": "content",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        2464,
        48
      ],
      "id": "YOUR_ID",
      "name": "Convert to Text File"
    },
    {
      "parameters": {
        "url": "YOUR_VERCEL_OCR_API_ENDPOINT",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={ \"fileURL\": \"https://drive.google.com/uc?export=download&id={{$json[\"id\"]}}\" }",
        "options": {
          "response": {}
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.3,
      "position": [
        2112,
        -144
      ],
      "id": "YOUR_ID",
      "name": "HTTP Request \u2014 Call Vercel OCR endpoint) (/api/ocr-summarize)"
    },
    {
      "parameters": {
        "jsCode": "// Smart TXT Normalization for OCR Extracted Text (Personal AI Factory v1)\n\nconst raw = $json.text || \"\";\n\n// Normalize, clean and format text\nconst normalized = raw\n  .replace(/\\r\\n/g, \"\\n\")        // Convert CRLF to LF\n  .replace(/[ \\t]+/g, \" \")       // Normalize extra spaces\n  .replace(/\\n{3,}/g, \"\\n\\n\")    // Reduce >2 blank lines to max 1\n  .replace(/[^\\S\\r\\n]+/g, \" \")   // Trim odd spacing without removing line breaks\n  .replace(/\\u00A0/g, \" \")       // Replace non-breaking spaces\n  .trim();\n\n// Optional: remove repeating headers/footer patterns if needed\n// Example cleanup for page artifacts:\nconst finalText = normalized\n  .replace(/Page \\d+ of \\d+/gi, \"\")\n  .replace(/Confidential/gi, \"\")\n  .trim();\n\nreturn [\n  {\n    json: {\n      text: finalText\n    }\n  }\n];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2336,
        -144
      ],
      "id": "YOUR_ID",
      "name": "Function \u2014 Smart TXT Normalization from Extracted text"
    },
    {
      "parameters": {
        "operation": "toText",
        "sourceProperty": "text",
        "options": {}
      },
      "type": "n8n-nodes-base.convertToFile",
      "typeVersion": 1.1,
      "position": [
        2576,
        -144
      ],
      "id": "YOUR_ID",
      "name": "Convert to Text File (.txt)"
    },
    {
      "parameters": {
        "name": "={{ $node[\"Switch \u2014 Route MIME TYPE\"].binary.data.fileName.replace(\".xlsx\", \".csv\") }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        2832,
        -992
      ],
      "id": "YOUR_ID",
      "name": "Google Drive \u2014 Upload file (to CLEAN folder) from XLSX to CSV",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "name": "={{ $node[\"Switch \u2014 Route MIME TYPE\"].binary.data.fileName.replace(\".xls\", \".csv\") }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        2832,
        -816
      ],
      "id": "YOUR_ID",
      "name": "Google Drive \u2014 Upload file (to CLEAN folder) from XLS to CSV",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "name": "={{ $node[\"Switch \u2014 Route MIME TYPE\"].binary.data.fileName}}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        2832,
        -320
      ],
      "id": "YOUR_ID",
      "name": "Google Drive \u2014 Upload JSON file (to CLEAN folder)",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "name": "={{ $node[\"Switch \u2014 Route MIME TYPE\"].binary.data.fileName}}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        2832,
        -640
      ],
      "id": "YOUR_ID",
      "name": "Google Drive \u2014 Upload normalized CSV file (to CLEAN folder)",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "name": "={{ $node[\"Switch \u2014 Route MIME TYPE\"].binary.data.fileName.replace(\".pdf\", \".txt\") }}",
        "driveId": {
          "__rl": true,
          "value": "My Drive",
          "mode": "list",
          "cachedResultName": "My Drive",
          "cachedResultUrl": "https://drive.google.com/drive/my-drive"
        },
        "folderId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        2832,
        -144
      ],
      "id": "YOUR_ID",
      "name": "Google Drive \u2014 Upload file (to CLEAN folder) from PDF to TXT",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "name": "={{ $node[\"Switch \u2014 Route MIME TYPE\"].binary.data.fileName }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "YOUR_GOOGLE_DRIVE_FOLDER_ID",
          "mode": "id"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        2832,
        48
      ],
      "id": "YOUR_ID",
      "name": "Google Drive \u2014 Upload normalized TXT file (to CLEAN folder)",
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "list",
          "cachedResultName": "AI_Factory_Control",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_ID",
          "mode": "list",
          "cachedResultName": "DATA_CATALOG",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "status": "clean_success",
            "added_at": "={{$now}}",
            "source": "=gdrive",
            "email_id": "={{ $json[\"owners\"][0][\"emailAddress\"] }}",
            "id": "={{$json.id}}",
            "clean_path": "={{$node[\"Google Drive \u2014 Upload file (to CLEAN folder) from XLSX to CSV\"].json[\"webViewLink\"]}}",
            "mime": "={{ $json[\"mimeType\"] }}",
            "filename": "={{$json[\"name\"]}}",
            "size": "={{ (Number($json[\"size\"]) / 1024).toFixed(2) }} KB"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "source",
              "displayName": "source",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "email_id",
              "displayName": "email_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "filename",
              "displayName": "filename",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "mime",
              "displayName": "mime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "size",
              "displayName": "size",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "raw_path",
              "displayName": "raw_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "clean_path",
              "displayName": "clean_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "gold_path",
              "displayName": "gold_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "added_at",
              "displayName": "added_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        3088,
        -992
      ],
      "id": "YOUR_ID",
      "name": "Google Sheets \u2014 Append DATA_CATALOG for XLSX (clean_success)",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "list",
          "cachedResultName": "AI_Factory_Control",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_ID",
          "mode": "list",
          "cachedResultName": "DATA_CATALOG",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "status": "clean_success",
            "added_at": "={{$now}}",
            "source": "gdrive",
            "email_id": "={{ $json[\"owners\"][0][\"emailAddress\"] }}",
            "id": "={{$json[\"id\"]}}",
            "clean_path": "={{$node[\"Google Drive \u2014 Upload file (to CLEAN folder) from XLS to CSV\"].json[\"webViewLink\"]}}",
            "mime": "={{ $json[\"mimeType\"] }}",
            "filename": "={{$json[\"name\"]}}",
            "size": "={{ (Number($json[\"size\"]) / 1024).toFixed(2) }} KB"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "source",
              "displayName": "source",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "email_id",
              "displayName": "email_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "filename",
              "displayName": "filename",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "mime",
              "displayName": "mime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "size",
              "displayName": "size",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "raw_path",
              "displayName": "raw_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "clean_path",
              "displayName": "clean_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "gold_path",
              "displayName": "gold_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "added_at",
              "displayName": "added_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        3088,
        -816
      ],
      "id": "YOUR_ID",
      "name": "Google Sheets \u2014 Append DATA_CATALOG for XLS (clean_success)",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "list",
          "cachedResultName": "AI_Factory_Control",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_ID",
          "mode": "list",
          "cachedResultName": "DATA_CATALOG",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "status": "clean_success",
            "added_at": "={{$now}}",
            "source": "gdrive",
            "email_id": "={{ $json[\"owners\"][0][\"emailAddress\"] }}",
            "id": "={{$json[\"id\"]}}",
            "clean_path": "={{$node[\"Google Drive \u2014 Upload normalized CSV file (to CLEAN folder)\"].json[\"webViewLink\"]}}",
            "mime": "={{ $json[\"mimeType\"] }}",
            "filename": "={{$json[\"name\"]}}",
            "size": "={{ (Number($json[\"size\"]) / 1024).toFixed(2) }} KB"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "source",
              "displayName": "source",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "email_id",
              "displayName": "email_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "filename",
              "displayName": "filename",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "mime",
              "displayName": "mime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "size",
              "displayName": "size",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "raw_path",
              "displayName": "raw_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "clean_path",
              "displayName": "clean_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "gold_path",
              "displayName": "gold_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "added_at",
              "displayName": "added_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        3088,
        -640
      ],
      "id": "YOUR_ID",
      "name": "Google Sheets \u2014 Append DATA_CATALOG for CSV (clean_success)",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "list",
          "cachedResultName": "AI_Factory_Control",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_ID",
          "mode": "list",
          "cachedResultName": "DATA_CATALOG",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "status": "clean_success",
            "added_at": "={{$now}}",
            "source": "gdrive",
            "email_id": "={{ $json[\"owners\"][0][\"emailAddress\"] }}",
            "id": "={{$json[\"id\"]}}",
            "clean_path": "={{$node[\"Google Drive \u2014 Upload JSON file (to CLEAN folder)\"].json[\"webViewLink\"]}}",
            "mime": "={{ $json[\"mimeType\"] }}",
            "filename": "={{$json[\"name\"]}}",
            "size": "={{ (Number($json[\"size\"]) / 1024).toFixed(2) }} KB"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "source",
              "displayName": "source",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "email_id",
              "displayName": "email_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "filename",
              "displayName": "filename",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "mime",
              "displayName": "mime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "size",
              "displayName": "size",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "raw_path",
              "displayName": "raw_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "clean_path",
              "displayName": "clean_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "gold_path",
              "displayName": "gold_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "added_at",
              "displayName": "added_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        3088,
        -320
      ],
      "id": "YOUR_ID",
      "name": "Google Sheets \u2014 Append DATA_CATALOG for JSON (clean_success)",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "list",
          "cachedResultName": "AI_Factory_Control",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_ID",
          "mode": "list",
          "cachedResultName": "DATA_CATALOG",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "status": "clean_success",
            "added_at": "={{$now}}",
            "source": "gdrive",
            "id": "={{$json[\"id\"]}}",
            "email_id": "={{ $json[\"owners\"][0][\"emailAddress\"] }}",
            "filename": "={{$json[\"name\"]}}",
            "mime": "={{ $json[\"mimeType\"] }}",
            "size": "={{ (Number($json[\"size\"]) / 1024).toFixed(2) }} KB",
            "clean_path": "={{$node[\"Google Drive \u2014 Upload file (to CLEAN folder) from PDF to TXT\"].json[\"webViewLink\"]}}"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "source",
              "displayName": "source",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "email_id",
              "displayName": "email_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "filename",
              "displayName": "filename",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "mime",
              "displayName": "mime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "size",
              "displayName": "size",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "raw_path",
              "displayName": "raw_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "clean_path",
              "displayName": "clean_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "gold_path",
              "displayName": "gold_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "added_at",
              "displayName": "added_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        3088,
        -144
      ],
      "id": "YOUR_ID",
      "name": "Google Sheets \u2014 Append DATA_CATALOG for PDF (clean_success)",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "list",
          "cachedResultName": "AI_Factory_Control",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_ID",
          "mode": "list",
          "cachedResultName": "DATA_CATALOG",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "status": "clean_success",
            "added_at": "={{$now}}",
            "source": "gdrive",
            "email_id": "={{ $json[\"owners\"][0][\"emailAddress\"] }}",
            "id": "={{$json[\"id\"]}}",
            "clean_path": "={{$node[\"Google Drive \u2014 Upload normalized TXT file (to CLEAN folder)\"].json[\"webViewLink\"]}}",
            "mime": "={{ $json[\"mimeType\"] }}",
            "filename": "={{$json[\"name\"]}}",
            "size": "={{ (Number($json[\"size\"]) / 1024).toFixed(2) }} KB"
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true,
              "removed": false
            },
            {
              "id": "source",
              "displayName": "source",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "email_id",
              "displayName": "email_id",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "filename",
              "displayName": "filename",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "mime",
              "displayName": "mime",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "size",
              "displayName": "size",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "raw_path",
              "displayName": "raw_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "clean_path",
              "displayName": "clean_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "gold_path",
              "displayName": "gold_path",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "displayName": "status",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "added_at",
              "displayName": "added_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        3088,
        48
      ],
      "id": "YOUR_ID",
      "name": "Google Sheets \u2014 Append DATA_CATALOG for TXT (clean_success)",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "YOUR_SPREADSHEET_ID",
          "mode": "list",
          "cachedResultName": "AI_Factory_Control",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "YOUR_SHEET_ID",
          "mode": "list",
          "cachedResultName": "EVENT_LOG",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1G4x50V3uHSy-jCFt_pf-ZDpvlJN9HPX018-ju8PHdNY/edit#gid=2072862873"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "agent": "clean",
            "ts": "={{ $now }}",
            "action": "YOUR_ID",
            "status": "clean_success",
            "notes": "Text extracted and normalized. Converted to CSV and saved to CLEAN folder.",
            "output": "={{$node[\"Google Drive \u2014 Upload file (to CLEAN folder) from XLS to CSV\"].json[\"webViewLink\"]}}",
            "input": "={{$node[\"Google Drive \u2014 Upload file (to CLEAN folder) from XLS to CSV\"].json[\"name\"]}}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "ts",
              "displayName": "ts",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "agent",
              "displayName": "agent",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "action",
              "displayName": "action",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "inpu

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

How this works

Streamline your email-driven document management by automatically processing Gmail attachments and organising them in Google Drive, saving hours of manual filing for busy professionals handling client submissions or reports. This workflow captures incoming emails via a webhook trigger, extracts attachments from messages, and uploads them to a designated 'RAW' folder in Google Drive before further processing with Google Sheets for logging or analysis. The key step involves intelligently routing traffic through a switch node to handle multiple attachments efficiently, ensuring seamless integration between Gmail and Google Drive without custom coding.

Use this workflow when you receive frequent emails with attachments needing immediate storage and metadata tracking, such as in legal firms or project teams relying on Google Workspace. Avoid it for high-volume scenarios exceeding thousands of emails daily, where simpler filters in Gmail might suffice instead. Common variations include adding AI nodes like Google Gemini for content summarisation of downloaded files or chaining LLM tools to categorise attachments automatically before archiving.

About this workflow

ANIS_HUB 1. Uses gmail, googleDrive, googleSheets, httpRequest. Webhook trigger; 89 nodes.

Source: https://github.com/anshwysmcbel2710/anis-personal-ai-factory-controller/blob/main/workflows/interactive/ANIS_HUB_gpt_webhook.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

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

AI & RAG

This workflow is designed for business professionals and sales teams who receive business card images via LINE and want to quickly digitize contact information with minimal manual work.

Google Gemini Chat, HTTP Request, Chain Llm +3
AI & RAG

Resume Screening & Behavioral Interviews with Gemini, Elevenlabs, & Notion ATS copy. Uses outputParserStructured, chainLlm, googleDrive, stickyNote. Webhook trigger; 67 nodes.

Output Parser Structured, Chain Llm, Google Drive +9
AI & RAG

Candidate Engagement | Resume Screening | AI Voice Interviews | Applicant Insights

Output Parser Structured, Chain Llm, Google Drive +9
AI & RAG

This workflow automates document processing using LlamaParse to extract and analyze text from various file formats. It intelligently processes documents, extracts structured data, and delivers actiona

Gmail, Gmail Trigger, HTTP Request +6
AI & RAG

Categories Content Creation AI Automation Publishing Social Media

Google Docs, HTTP Request, Slack +7