{ "name": "Email a Summary of a Drive PDF", "tags": [ { "id": "USkRpjRpntFcI8VH", "name": "working", "createdAt": "2025-03-09T00:24:01.723Z", "updatedAt": "2025-03-09T00:24:01.723Z" } ], "nodes": [ { "id": "680f9002-94fa-48c1-af5f-d2a5305b6291", "name": "When clicking ‘Test workflow’", "type": "n8n-nodes-base.manualTrigger", "position": [ 0, 0 ], "parameters": {}, "typeVersion": 1 }, { "id": "3fa4ad1a-ce87-44db-b016-bd172c2318eb", "name": "Mistral Cloud Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud", "position": [ 500, 240 ], "parameters": { "options": {} }, "typeVersion": 1 }, { "id": "124d62ae-3b46-4e75-a04e-155849fe280d", "name": "Download uploaded File from Google Drive", "type": "n8n-nodes-base.googleDrive", "position": [ 220, 0 ], "parameters": { "fileId": { "__rl": true, "mode": "id", "value": "YOUR_DRIVE_FILE_ID" }, "options": {}, "operation": "download" }, "typeVersion": 3 }, { "id": "69b7621b-a273-4b0a-be61-4d45bf87618d", "name": "Summarization Chain to summarize a file", "type": "@n8n/n8n-nodes-langchain.chainSummarization", "position": [ 480, 0 ], "parameters": { "options": { "binaryDataKey": "data" }, "chunkSize": 800, "chunkOverlap": 0, "operationMode": "nodeInputBinary" }, "typeVersion": 2 }, { "id": "573194cd-5f37-422f-b3fa-957187ac3538", "name": "Send Summarized text to Gmail", "type": "n8n-nodes-base.gmail", "position": [ 840, 0 ], "parameters": { "sendTo": "recipient@example.com", "message": "={{ $json.body }}", "options": { "appendAttribution": false }, "subject": "Here is Your Summarized Response", "emailType": "text" }, "typeVersion": 2.1 }, { "id": "email-a-summary-of-a-drive-pdf-mail", "name": "Prepare the email", "type": "n8n-nodes-base.code", "typeVersion": 2, "parameters": { "mode": "runOnceForAllItems", "jsCode": "function mail({summary}){if(typeof summary!=='string'||!summary.trim())throw Error('Summary is empty');const date=new Date().toLocaleString('en-GB',{timeZone:'Africa/Lagos'});return{body:'Quick summary of your document\\n\\n'+summary+'\\n\\nDate processed (Africa/Lagos): '+date}}\n\nreturn [{json:mail({summary:$input.first().json.response?.text})}];" } } ], "active": false, "pinData": {}, "settings": { "callerPolicy": "workflowsFromSameOwner", "executionOrder": "v1" }, "connections": { "Mistral Cloud Chat Model": { "ai_languageModel": [ [ { "node": "Summarization Chain to summarize a file", "type": "ai_languageModel", "index": 0 } ] ] }, "When clicking ‘Test workflow’": { "main": [ [ { "node": "Download uploaded File from Google Drive", "type": "main", "index": 0 } ] ] }, "Summarization Chain to summarize a file": { "main": [ [ { "node": "Prepare the email", "type": "main", "index": 0 } ] ] }, "Download uploaded File from Google Drive": { "main": [ [ { "node": "Summarization Chain to summarize a file", "type": "main", "index": 0 } ] ] }, "Prepare the email": { "main": [ [ { "node": "Send Summarized text to Gmail", "type": "main", "index": 0 } ] ] } } }