This workflow follows the Google Drive → Google Sheets 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 →
{
"name": "CLEAN Agent - Manual Trigger",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
320,
-384
],
"id": "manual_trigger_clean",
"name": "Manual Trigger"
},
{
"parameters": {
"resource": "fileFolder",
"searchMethod": "query",
"queryString": "='YOUR_ID' in parents",
"returnAll": true,
"filter": {},
"options": {}
},
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 3,
"position": [
576,
-384
],
"id": "YOUR_ID",
"name": "Google Drive \u2014 List Files (RAW folder)",
"executeOnce": true,
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
848,
-384
],
"id": "YOUR_ID",
"name": "Split In Batches \u2014 FOR EACH RAW FILE"
},
{
"parameters": {
"operation": "download",
"fileId": {
"__rl": true,
"value": "YOUR_GOOGLE_DRIVE_FOLDER_ID",
"mode": "id"
},
"options": {}
},
"type": "n8n-nodes-base.googleDrive",
"typeVersion": 3,
"position": [
1120,
-208
],
"id": "YOUR_ID",
"name": "Google Drive \u2014 Download RAW file",
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"id": "YOUR_ID",
"leftValue": "={{ $binary.data.mimeType }}",
"rightValue": "application/vnd.openxmlformats-officedocument.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": [
1344,
-208
],
"id": "YOUR_ID",
"name": "IF Node \u2014 Check MIME TYPE"
},
{
"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": [
1584,
-96
],
"id": "YOUR_ID",
"name": "Google Sheets \u2014 Append (EVENT_LOG) - unsupported_file",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"conditions": [
{
"leftValue": "={{ $binary.data.mimeType }}",
"rightValue": "application/vnd.openxmlformats-officedocument.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": [
1808,
-288
],
"id": "YOUR_ID",
"name": "Switch \u2014 Route MIME TYPE"
},
{
"parameters": {
"operation": "xlsx",
"options": {}
},
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
2160,
-960
],
"id": "YOUR_ID",
"name": "Extract from XLSX File"
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [
2496,
-960
],
"id": "YOUR_ID",
"name": "Convert to CSV from XLSX"
},
{
"parameters": {
"operation": "xls",
"options": {}
},
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
2176,
-768
],
"id": "YOUR_ID",
"name": "Extract from XLS File"
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [
2480,
-768
],
"id": "YOUR_ID",
"name": "Convert to CSV from XLS"
},
{
"parameters": {
"operation": "toJson",
"options": {}
},
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [
2160,
-576
],
"id": "YOUR_ID",
"name": "Spreadsheet File \u2014 Convert to JSON"
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.convertToFile",
"typeVersion": 1.1,
"position": [
2640,
-576
],
"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": [
2400,
-576
],
"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 };\n}\n\nreturn items;\n"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
2208,
208
],
"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": [
2560,
208
],
"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": [
2176,
-16
],
"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": [
2432,
-16
],
"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": [
2672,
-16
],
"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": [
2928,
-960
],
"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": [
2928,
-768
],
"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": [
2928,
-208
],
"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": [
2928,
-576
],
"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": [
2928,
-16
],
"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": [
2928,
208
],
"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": [
3184,
-960
],
"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": [
3184,
-768
],
"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": [
3184,
-576
],
"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": [
3184,
-208
],
"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": [
3184,
-16
],
"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": [
3200,
208
],
"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": "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": "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": [
3424,
-768
],
"id": "YOUR_ID",
"name": "Google Sheets \u2014 Append EVENT_LOG 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": "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": "success",
"notes": "Text extracted and normalized. Converted to CSV and saved to CLEAN folder.",
"output": "={{$node[\"Google Drive \u2014 Upload normalized CSV file (to CLEAN folder)\"].json[\"webViewLink\"]}}",
"input": "={{$node[\"Google Drive \u2014 Upload normalized CSV file (to CLEAN folder)\"].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": [
3424,
-576
],
"id": "YOUR_ID",
"name": "Google Sheets \u2014 Append EVENT_LOG CSV (clean_success)",
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "YOUR_SPREADSHEET_ID",
"mode"
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.
googleDriveOAuth2ApigoogleSheetsOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
CLEAN Agent - Manual Trigger. Uses googleDrive, googleSheets, httpRequest. Event-driven trigger; 49 nodes.
Source: https://github.com/anshwysmcbel2710/anis-personal-ai-factory-controller/blob/main/workflows/agents/clean_agent.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
🎯 Create viral TikToks, Shorts, Reels, podcasts, and ASMR videos in minutes — all on autopilot.
Generate AI viral videos with NanoBanana & VEO3, shared on socials via Blotato 2. Uses @blotato/n8n-nodes-blotato, googleSheets, lmChatOpenAi, toolThink. Event-driven trigger; 94 nodes.
> Note: This workflow uses sticky notes extensively to document each logical section of the automation. Sticky notes are mandatory and already included to explain OCR, AI parsing, folder logic, dup
This template is designed for marketers, content creators, and e-commerce brands who want to automate the creation of professional ad videos at scale. It’s ideal for teams looking to generate consiste
This comprehensive n8n workflow automates the entire Meta (Facebook/Instagram) advertising process, from asset analysis to ad creation. It combines AI-powered content analysis with automated ad deploy