{ "name": "Add rows to Google Sheets from a CSV a supplier emails to a Pidgeon address", "nodes": [ { "id": "6f0c1d2e-0003-4a00-8000-000000000001", "name": "About this workflow", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [-860, -380], "parameters": { "width": 520, "height": 740, "content": "## Add rows to Google Sheets from a CSV a supplier emails\n\n**Self-hosted n8n only** until the Pidgeon node is verified: it is a community node, `@pidgeon-ai/n8n-nodes-pidgeon`.\n\n### Who it is for\nAnybody with a supplier, portal or tool that can only send its data by email.\n\n### How it works\nThe workflow owns an address, and every email to it is an item. Only mail from the sender you expect, which passed DMARC so its From is not forged, and which carries an attachment goes on. The first attachment is downloaded, read as CSV, and appended to a sheet. Nothing here reads the email with a model: Pidgeon gives you the sender, its authentication and the attachments, and parsing the file is n8n's job.\n\n### How to set up\n1. In Pidgeon, create an address that keeps mail, such as `supplier-exports@yourcompany.pidgeon.email`, and give it to the supplier. An address without an inbox stores nothing, so there would be no file to download.\n2. Make a key with **read** on that one address and add it as a Pidgeon API credential.\n3. Pick the address in the trigger, put the supplier's address in **Your settings**, and choose the spreadsheet and sheet.\n\n### Requirements\nA Pidgeon account, n8n on a public HTTPS URL, and Google Sheets.\n\n### How to customise\nFor XLSX, set **Read the CSV** to XLSX. To keep every file, add a Google Drive upload after the download.\n\nMore: https://pidgeon.ai/docs/n8n?utm_source=n8n" } }, { "id": "6f0c1d2e-0003-4a00-8000-000000000002", "name": "When the export arrives", "type": "@pidgeon-ai/n8n-nodes-pidgeon.pidgeonTrigger", "typeVersion": 1, "position": [-240, 0], "webhookId": "6f0c1d2e-0003-4a00-8000-0000000000a1", "parameters": { "event": "messageReceived", "address": "", "includeSpam": false, "fetchMessage": true, "body": "clean" } }, { "id": "6f0c1d2e-0003-4a00-8000-000000000003", "name": "Your settings", "type": "n8n-nodes-base.set", "typeVersion": 3.4, "position": [-20, 0], "parameters": { "assignments": { "assignments": [ { "id": "expected-sender", "name": "expected_sender", "value": "exports@supplier.com", "type": "string" } ] }, "includeOtherFields": true, "options": {} } }, { "id": "6f0c1d2e-0003-4a00-8000-000000000004", "name": "From the supplier, signed, with a file", "type": "n8n-nodes-base.if", "typeVersion": 2.2, "position": [200, 0], "parameters": { "conditions": { "options": { "caseSensitive": false, "leftValue": "", "typeValidation": "strict", "version": 2 }, "conditions": [ { "id": "expected-sender", "leftValue": "={{ $json.from }}", "rightValue": "={{ $json.expected_sender }}", "operator": { "type": "string", "operation": "equals" } }, { "id": "dmarc-pass", "leftValue": "={{ $json.auth_dmarc }}", "rightValue": "pass", "operator": { "type": "string", "operation": "equals" } }, { "id": "has-attachment", "leftValue": "={{ $json.attachments.length > 0 }}", "rightValue": "", "operator": { "type": "boolean", "operation": "true", "singleValue": true } } ], "combinator": "and" }, "options": {} } }, { "id": "6f0c1d2e-0003-4a00-8000-000000000005", "name": "Download the file", "type": "@pidgeon-ai/n8n-nodes-pidgeon.pidgeon", "typeVersion": 1, "position": [440, -20], "parameters": { "resource": "attachment", "operation": "download", "attachmentId": "={{ $json.attachments[0].id }}", "binaryPropertyName": "data" } }, { "id": "6f0c1d2e-0003-4a00-8000-000000000006", "name": "Read the CSV", "type": "n8n-nodes-base.extractFromFile", "typeVersion": 1, "position": [660, -20], "parameters": { "operation": "csv", "binaryPropertyName": "data", "options": { "headerRow": true } } }, { "id": "6f0c1d2e-0003-4a00-8000-000000000007", "name": "Add the rows", "type": "n8n-nodes-base.googleSheets", "typeVersion": 4.6, "position": [880, -20], "parameters": { "operation": "append", "documentId": { "__rl": true, "mode": "list", "value": "" }, "sheetName": { "__rl": true, "mode": "list", "value": "" }, "columns": { "mappingMode": "autoMapInputData", "value": {}, "matchingColumns": [], "schema": [] }, "options": {} } } ], "connections": { "When the export arrives": { "main": [[{ "node": "Your settings", "type": "main", "index": 0 }]] }, "Your settings": { "main": [[{ "node": "From the supplier, signed, with a file", "type": "main", "index": 0 }]] }, "From the supplier, signed, with a file": { "main": [[{ "node": "Download the file", "type": "main", "index": 0 }], []] }, "Download the file": { "main": [[{ "node": "Read the CSV", "type": "main", "index": 0 }]] }, "Read the CSV": { "main": [[{ "node": "Add the rows", "type": "main", "index": 0 }]] } }, "settings": { "executionOrder": "v1" }, "pinData": {} }