This workflow corresponds to n8n.io template #3169 — we link there as the canonical source.
This workflow follows the Chainllm → Chainsummarization 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 →
{
"id": "MCzA5RzvO83kNJi7",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "AI Email Analyzer: Process PDFs, Images",
"tags": [],
"nodes": [
{
"id": "0526c603-2c35-4f65-88ee-e143f7aa3ca4",
"name": "Email Trigger (IMAP)",
"type": "n8n-nodes-base.emailReadImap",
"position": [
-80,
500
],
"parameters": {
"options": {},
"downloadAttachments": true
},
"credentials": {
"imap": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "9b0b83d1-7d7c-4858-aedc-4816e2f02276",
"name": "DeepSeek R1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1320,
980
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "deepseek/deepseek-r1:free",
"cachedResultName": "deepseek/deepseek-r1:free"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "2e8ad64a-d767-441e-9e12-7a75f5ed4c1c",
"name": "Email Summarization Chain",
"type": "@n8n/n8n-nodes-langchain.chainSummarization",
"position": [
1360,
800
],
"parameters": {
"options": {
"binaryDataKey": "={{ $json.data }}",
"summarizationMethodAndPrompts": {
"values": {
"prompt": "=Write a concise summary of the following in max 100 words :\n\n\"{{ $json.data }}\"\n\nDo not enter the total number of words used.",
"combineMapPrompt": "=## Email Summarization System Prompt\n\nYou are a specialized AI assistant focused exclusively on creating precise, concise summaries of emails. Your task is to analyze the complete email text provided as input and produce a clear, comprehensive summary that captures all essential information in a cohesive narrative format.\n\n### Your responsibilities:\n\n1. Extract and summarize the main topic and purpose of the email\n2. Identify key points, requests, deadlines, or action items mentioned\n3. Preserve critical details like dates, times, locations, and names\n4. Maintain the original tone and urgency level of the message\n5. Organize information in order of importance\n6. Remove unnecessary pleasantries, redundancies, and filler content\n\n### Summary format:\n\n- Begin with a one-sentence overview of the email's main purpose\n- Present all key information in a cohesive paragraph format (no bullet points)\n- Follow a logical flow from most to least important information\n- Include any critical deadlines, requests, or action items within the narrative\n- Keep the summary to 3-5 sentences total\n- Use clear, straightforward language with appropriate transitions between ideas\n- Preserve the original intent and meaning without introducing new information\n\n### What to exclude:\n\n- Greetings and sign-offs\n- Redundant information\n- Minor details that don't affect the main message\n- Your own opinions or interpretations\n- Information not explicitly stated in the email\n\nThe email text to summarize is:\n{{$json.data}}"
}
}
},
"operationMode": "nodeInputBinary"
},
"typeVersion": 2
},
{
"id": "97f2b5f8-b2ba-4bd5-a951-c97e64e6f833",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-140,
-280
],
"parameters": {
"color": 3,
"width": 580,
"height": 400,
"content": "# AI Email Analyzer: Process PDFs, Images \n\nThis is a powerful tool for automating email analysis and summarization, saving time and ensuring that important information is easily accessible and actionable.\n\nAll summaries are saved on a Google Sheet and identified by a numeric ID referring to the single email.\n\n## Preliminary step:\n- Clone this [Google Drive Sheet](https://docs.google.com/spreadsheets/d/1rBa0RI6XFfMerylVCV0dlKhJT_f4UAd8S6jyYX4aRRo/edit?usp=sharing)\n- Insert your Chat_ID in Telegram node\n- Choose the AI model you prefer\n"
},
"typeVersion": 1
},
{
"id": "d2012cbc-0e79-4579-ac3d-e5e84ad56dc1",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
960,
120
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "pdf",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "31b7fb0b-3149-479e-852a-52c1ec8935ca",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $binary.data.fileExtension }}",
"rightValue": "pdf"
}
]
},
"renameOutput": true
},
{
"outputKey": "image",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "9fe6411d-cf35-4fdd-a9ad-8c96f0a5cf66",
"operator": {
"type": "string",
"operation": "regex"
},
"leftValue": "={{ $binary.data.fileExtension }}",
"rightValue": "=/^(jpg|png)$/i"
}
]
},
"renameOutput": true
}
]
},
"options": {},
"looseTypeValidation": true
},
"typeVersion": 3.2
},
{
"id": "8a9d55b8-9ba5-4a6f-ae13-9c529875a2a4",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
2040,
-320
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"content\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
},
"typeVersion": 1.2
},
{
"id": "658696f5-08e0-4d51-89bc-2a1c31576700",
"name": "Split Out",
"type": "n8n-nodes-base.splitOut",
"position": [
2540,
-420
],
"parameters": {
"options": {},
"fieldToSplitOut": "=output"
},
"typeVersion": 1
},
{
"id": "d2ba57c3-9e0e-4a7d-957d-216763e357c3",
"name": "Aggregate",
"type": "n8n-nodes-base.aggregate",
"position": [
3660,
220
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "data.output"
}
]
}
},
"typeVersion": 1
},
{
"id": "10e6d3c6-10f6-4fea-be37-b5ee50e0b529",
"name": "OpenRouter Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
3920,
400
],
"parameters": {
"model": "google/gemini-2.0-flash-exp:free",
"options": {}
},
"credentials": {
"openRouterApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "dcdcb7f2-669d-4e1b-a3f2-49a5b6c760b1",
"name": "Contain attachments?",
"type": "n8n-nodes-base.if",
"position": [
260,
500
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "5cf96104-c887-44fe-b528-30171943dd15",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $binary.isNotEmpty() }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "6280db8e-42e4-4f88-bbe7-4e65eff3a34f",
"name": "Get PDF and images attachments",
"type": "n8n-nodes-base.code",
"position": [
600,
300
],
"parameters": {
"jsCode": "let results = [];\n\nfor (const item of $input.all()) {\n for (key of Object.keys(item.binary)) {\n results.push({\n json: {},\n binary: {\n data: item.binary[key],\n }\n });\n }\n}\n\nreturn results;"
},
"typeVersion": 2
},
{
"id": "53a7333d-fb49-46d4-9e3b-d186a5e416ca",
"name": "Extract from PDF",
"type": "n8n-nodes-base.extractFromFile",
"position": [
1460,
-540
],
"parameters": {
"options": {},
"operation": "pdf"
},
"typeVersion": 1
},
{
"id": "9d5c3b14-a3b0-4d2b-88d5-5a2c21a6907f",
"name": "PDF Analyzer",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
1780,
-540
],
"parameters": {
"text": "=## PDF Summarization System Prompt\n\nYou are a specialized AI assistant tasked with creating concise, accurate summaries of documents. Your goal is to extract and distill the most important information from the content provided as input and present it in a clear, precise plain text summary.\n\n### Your responsibilities:\n\n1. Identify the main topic and purpose of the document\n2. Extract key points, arguments, findings, or conclusions\n3. Preserve essential data points, statistics, dates, and figures\n4. Recognize and highlight critical information and takeaways\n5. Maintain the original document's logical structure in your summary\n6. Prioritize information based on its significance to the document's purpose\n\n### Summary format:\n\n- Provide your summary in plain text only (no formatting)\n- Begin with a concise overview of the document's main topic and purpose\n- Present important points in a logical, sequential narrative\n- Use clear, direct language that accurately represents the original content\n- Maintain appropriate context for all extracted information\n- Keep the summary concise while including all crucial information\n- Use proper transitions between topics to maintain readability\n\n### What to exclude:\n\n- Minor details that don't contribute to the main points\n- Repetitive information\n- Extensive examples unless they're critical to understanding\n- Citations, references, and bibliographic details unless specifically important\n- Decorative or non-essential images (describe important visualized data if relevant)\n- Your own interpretations or opinions not supported by the document\n\n{{ $json.text }}",
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.5
},
{
"id": "ba6f6d2f-9a13-4bb4-80fb-72f5c4124473",
"name": "Save summary PDF",
"type": "n8n-nodes-base.googleSheets",
"position": [
2580,
-800
],
"parameters": {
"columns": {
"value": {
"ID": "={{ $('Email Trigger (IMAP)').item.json.metadata[\"x-message-id\"] }}",
"DATE": "={{ $now.format('dd/LL/yyyy') }}",
"TYPE": "pdf",
"EMAIL": "={{ $('Email Trigger (IMAP)').item.json.from }}",
"SUBJECT": "={{ $('Email Trigger (IMAP)').item.json.subject }}",
"SUMMARY": "={{ $json.output.content }}"
},
"schema": [
{
"id": "DATE",
"type": "string",
"display": true,
"required": false,
"displayName": "DATE",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "EMAIL",
"type": "string",
"display": true,
"required": false,
"displayName": "EMAIL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ID",
"type": "string",
"display": true,
"required": false,
"displayName": "ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "SUBJECT",
"type": "string",
"display": true,
"required": false,
"displayName": "SUBJECT",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "TYPE",
"type": "string",
"display": true,
"required": false,
"displayName": "TYPE",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "SUMMARY",
"type": "string",
"display": true,
"required": false,
"displayName": "SUMMARY",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rBa0RI6XFfMerylVCV0dlKhJT_f4UAd8S6jyYX4aRRo/edit#gid=0",
"cachedResultName": "Foglio1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1rBa0RI6XFfMerylVCV0dlKhJT_f4UAd8S6jyYX4aRRo",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rBa0RI6XFfMerylVCV0dlKhJT_f4UAd8S6jyYX4aRRo/edit?usp=drivesdk",
"cachedResultName": "Analyze Email + Attachments"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.5
},
{
"id": "4c7ff16e-8649-4364-9aa6-c06670f4c36a",
"name": "All summaries",
"type": "n8n-nodes-base.merge",
"position": [
3080,
220
],
"parameters": {
"numberInputs": 3
},
"typeVersion": 3
},
{
"id": "46af5694-6b28-45e7-8b1b-d77482b326e7",
"name": "Map image summaries",
"type": "n8n-nodes-base.set",
"position": [
2020,
280
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "11592bed-7555-4e61-a692-d71b1a733fd4",
"name": "content",
"type": "string",
"value": "={{ $json.content }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "dc5858b7-c30b-413b-a1d0-143a068f2c87",
"name": "Upload attachments",
"type": "n8n-nodes-base.googleDrive",
"position": [
1440,
480
],
"parameters": {
"name": "={{$now.format('yyyyLLddhhiiss')}}-{{ $binary.data.fileName }}",
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive"
},
"options": {},
"folderId": {
"__rl": true,
"mode": "list",
"value": "1CV5PgqBQIVFEacmbApdCApjNEtoNPzXQ",
"cachedResultUrl": "https://drive.google.com/drive/folders/1CV5PgqBQIVFEacmbApdCApjNEtoNPzXQ",
"cachedResultName": "Analyze attachments"
}
},
"credentials": {
"googleDriveOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 3
},
{
"id": "9537f678-163c-40de-93f3-9934f4ae2ad0",
"name": "Email summary",
"type": "n8n-nodes-base.set",
"position": [
2000,
800
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "ef348518-a9fb-4ea9-bd70-9dcf3bff092a",
"name": "content",
"type": "string",
"value": "={{ $json.response.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ba0c45d9-7d5a-413e-9034-3e22a79ead77",
"name": "Send final summary",
"type": "n8n-nodes-base.telegram",
"position": [
4340,
220
],
"parameters": {
"text": "={{ $json.text }}",
"chatId": "CHAT_ID",
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "7a97052b-37c5-4754-ac1a-0f1a20569df7",
"name": "Create final summary",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
3940,
220
],
"parameters": {
"text": "=The inputs to synthesize are:\n'''\n{{ $json.output }}\n'''",
"messages": {
"messageValues": [
{
"message": "## Comprehensive Email Analysis System Prompt\n\nYou are a specialized AI assistant tasked with creating a unified, concise summary of an email and all its attachments. Your input includes a summary of the email text, summaries of any images, and summaries of any PDF attachments. Your goal is to synthesize all this information into a single coherent summary that captures the essential message and purpose.\n\n### Your responsibilities:\n\n1. Identify the overarching theme or purpose connecting the email and its attachments\n2. Recognize relationships between the email content and the attached materials\n3. Extract and consolidate the most critical information from all sources\n4. Maintain proper context when combining information from different sources\n5. Prioritize information based on relevance to the email's main purpose\n6. Create a unified narrative that flows logically between email content and attachments\n\n### Input structure:\n- Email summary: A summary of the main email text\n- Image descriptions: Summaries of any images attached to the email\n- PDF summaries: Condensed versions of any PDF documents attached\n\n### Output format:\n\n- Provide your summary in plain text only\n- Begin with a one-sentence statement of the email's overall purpose and theme\n- Present a unified narrative that integrates information from the email and all attachments\n- Organize information by importance and relevance, not by source\n- Keep the final summary concise (5-7 sentences maximum) while including all essential information\n- Use clear transitions to maintain coherence when moving between different information sources\n- Preserve the original intent and tone of the communication\n\n### What to include:\n\n- The main topic and purpose of the communication\n- Key points from both the email and attachments\n- Critical requests, deadlines, or action items\n- Essential details like dates, figures, or specific references\n- Contextual information that clarifies the purpose of attachments\n\n### What to exclude:\n\n- Redundant information repeated across multiple sources\n- Minor details that don't contribute to understanding the main message\n- Excessive descriptions of attachments beyond their relevance to the email's purpose\n- Your own interpretations beyond what's supported by the input materials"
}
]
},
"promptType": "define"
},
"typeVersion": 1.5
},
{
"id": "99b4c22c-a29b-4b72-bc4a-bed5c1320386",
"name": "Save summary image",
"type": "n8n-nodes-base.googleSheets",
"position": [
2020,
20
],
"parameters": {
"columns": {
"value": {
"ID": "={{ $('Email Trigger (IMAP)').item.json.metadata[\"x-message-id\"] }}",
"DATE": "={{ $now.format('dd/LL/yyyy') }}",
"TYPE": "image",
"EMAIL": "={{ $('Email Trigger (IMAP)').item.json.from }}",
"SUBJECT": "={{ $('Email Trigger (IMAP)').item.json.subject }}",
"SUMMARY": "={{ $json.content }}"
},
"schema": [
{
"id": "DATE",
"type": "string",
"display": true,
"required": false,
"displayName": "DATE",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "EMAIL",
"type": "string",
"display": true,
"required": false,
"displayName": "EMAIL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ID",
"type": "string",
"display": true,
"required": false,
"displayName": "ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "SUBJECT",
"type": "string",
"display": true,
"required": false,
"displayName": "SUBJECT",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "TYPE",
"type": "string",
"display": true,
"required": false,
"displayName": "TYPE",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "SUMMARY",
"type": "string",
"display": true,
"required": false,
"displayName": "SUMMARY",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rBa0RI6XFfMerylVCV0dlKhJT_f4UAd8S6jyYX4aRRo/edit#gid=0",
"cachedResultName": "Foglio1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1rBa0RI6XFfMerylVCV0dlKhJT_f4UAd8S6jyYX4aRRo",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rBa0RI6XFfMerylVCV0dlKhJT_f4UAd8S6jyYX4aRRo/edit?usp=drivesdk",
"cachedResultName": "Analyze Email + Attachments"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.5
},
{
"id": "2b32c086-c436-436e-93c3-da88e6f08247",
"name": "Save summary text",
"type": "n8n-nodes-base.googleSheets",
"position": [
2020,
1040
],
"parameters": {
"columns": {
"value": {
"ID": "={{ $('Email Trigger (IMAP)').item.json.metadata[\"x-message-id\"] }}",
"DATE": "={{ $now.format('dd/LL/yyyy') }}",
"TYPE": "email",
"EMAIL": "={{ $('Email Trigger (IMAP)').item.json.from }}",
"SUBJECT": "={{ $('Email Trigger (IMAP)').item.json.subject }}",
"SUMMARY": "={{ $json.response.text }}"
},
"schema": [
{
"id": "DATE",
"type": "string",
"display": true,
"required": false,
"displayName": "DATE",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "EMAIL",
"type": "string",
"display": true,
"required": false,
"displayName": "EMAIL",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "ID",
"type": "string",
"display": true,
"required": false,
"displayName": "ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "SUBJECT",
"type": "string",
"display": true,
"required": false,
"displayName": "SUBJECT",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "TYPE",
"type": "string",
"display": true,
"required": false,
"displayName": "TYPE",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "SUMMARY",
"type": "string",
"display": true,
"required": false,
"displayName": "SUMMARY",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rBa0RI6XFfMerylVCV0dlKhJT_f4UAd8S6jyYX4aRRo/edit#gid=0",
"cachedResultName": "Foglio1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1rBa0RI6XFfMerylVCV0dlKhJT_f4UAd8S6jyYX4aRRo",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1rBa0RI6XFfMerylVCV0dlKhJT_f4UAd8S6jyYX4aRRo/edit?usp=drivesdk",
"cachedResultName": "Analyze Email + Attachments"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 4.5
},
{
"id": "135bf3c3-e45f-4363-857b-2345e0bc7964",
"name": "Convert text",
"type": "n8n-nodes-base.markdown",
"position": [
860,
940
],
"parameters": {
"html": "={{ $json.textHtml }}",
"options": {}
},
"typeVersion": 1
},
{
"id": "0c2cf33a-d7bb-438d-a9c9-06a77f91b56e",
"name": "Gemini 2.0 Flash",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
1700,
-320
],
"parameters": {
"model": "google/gemini-2.0-flash-exp:free",
"options": {}
},
"credentials": {
"openRouterApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "50d5fd05-db5f-451c-92ce-e0f42d8322f9",
"name": "Parsing",
"type": "n8n-nodes-base.code",
"position": [
3360,
220
],
"parameters": {
"jsCode": "const inputData = $input.all();\n\nconst outputData = inputData.map(item => {\n \n const outputValue = item.json.output || item.json.content;\n\n return {\n data: {\n output: outputValue \n }\n };\n});\n\nreturn outputData;"
},
"typeVersion": 2
},
{
"id": "801659a1-cc9d-4014-9403-d6d0952e856a",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
520,
220
],
"parameters": {
"width": 260,
"height": 240,
"content": "Get all attachments present in the email (in this WF only PDFs and images are considered)"
},
"typeVersion": 1
},
{
"id": "15dc13b9-b35c-43d3-8af9-a8793382a2b6",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1740,
-600
],
"parameters": {
"width": 340,
"height": 200,
"content": "Analyze the content of PDF files and make a summary for each one"
},
"typeVersion": 1
},
{
"id": "6c68ce17-13f1-4aba-9f43-e4003e5cd723",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1380,
120
],
"parameters": {
"height": 200,
"content": "Analyze the content of the image and describe it accurately"
},
"typeVersion": 1
},
{
"id": "ff746258-dc11-43aa-afe9-06c9dfb3708b",
"name": "Analyze image",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
1440,
180
],
"parameters": {
"text": "## Image Analysis System Prompt\n\nYou are a specialized AI assistant focused on analyzing images. Your task is to carefully examine the image provided as input and produce a detailed, accurate description in plain text format.\n\n### Your responsibilities:\n\n1. Observe and describe the main subject(s) or focal point(s) of the image\n2. Identify notable objects, people, animals, or other elements present\n3. Describe the setting, background, and environment if applicable\n4. Note any text visible in the image, transcribing it accurately\n5. Recognize any actions, activities, or events taking place\n6. Identify relevant contextual information (time of day, weather, season, etc.)\n7. Describe colors, lighting, composition, and other visual elements when relevant\n\n### Response format:\n\n- Provide your analysis in plain text only (no HTML, markdown, or other formatting)\n- Begin with a concise overview of what the image depicts\n- Follow with a detailed description covering all significant elements\n- Organize information logically, typically moving from main subjects to background details\n- Use clear, descriptive language that accurately represents what is actually visible\n- Keep descriptions objective and factual\n\n### What to exclude:\n\n- Speculation about elements not clearly visible in the image\n- Subjective judgments or interpretations beyond what is objectively present\n- Personal opinions about the quality or purpose of the image\n- Complex technical analysis unless specifically relevant\n- Any formatting beyond plain text\n\nThe image to analyze is the one provided in the input.",
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "GPT-4O-MINI"
},
"options": {},
"resource": "image",
"inputType": "base64",
"operation": "analyze"
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.8
},
{
"id": "ce353f02-72ff-49bf-9297-5a2b3229fa49",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1340,
740
],
"parameters": {
"width": 320,
"height": 180,
"content": "Analyze the content of the email and summarize it"
},
"typeVersion": 1
},
{
"id": "01ee4c00-5993-47ce-af04-320cd3319593",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
3060,
100
],
"parameters": {
"width": 720,
"height": 80,
"content": "All the summaries of the email components (text, PDF, images) are aggregated and a final summary is generated"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "30310971-f23c-4761-823c-36ddad8bc8dd",
"connections": {
"Switch": {
"main": [
[
{
"node": "Upload attachments",
"type": "main",
"index": 0
},
{
"node": "Extract from PDF",
"type": "main",
"index": 0
}
],
[
{
"node": "Upload attachments",
"type": "main",
"index": 0
},
{
"node": "Analyze image",
"type": "main",
"index": 0
}
]
]
},
"Parsing": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Create final summary",
"type": "main",
"index": 0
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "All summaries",
"type": "main",
"index": 0
}
]
]
},
"DeepSeek R1": {
"ai_languageModel": [
[
{
"node": "Email Summarization Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Convert text": {
"main": [
[
{
"node": "Email Summarization Chain",
"type": "main",
"index": 0
}
]
]
},
"PDF Analyzer": {
"main": [
[
{
"node": "Save summary PDF",
"type": "main",
"index": 0
},
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
},
"All summaries": {
"main": [
[
{
"node": "Parsing",
"type": "main",
"index": 0
}
]
]
},
"Analyze image": {
"main": [
[
{
"node": "Save summary image",
"type": "main",
"index": 0
},
{
"node": "Map image summaries",
"type": "main",
"index": 0
}
]
]
},
"Email summary": {
"main": [
[
{
"node": "All summaries",
"type": "main",
"index": 2
}
]
]
},
"Extract from PDF": {
"main": [
[
{
"node": "PDF Analyzer",
"type": "main",
"index": 0
}
]
]
},
"Gemini 2.0 Flash": {
"ai_languageModel": [
[
{
"node": "PDF Analyzer",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Save summary PDF": {
"main": [
[]
]
},
"Save summary text": {
"main": [
[]
]
},
"Save summary image": {
"main": [
[]
]
},
"Upload attachments": {
"main": [
[]
]
},
"Map image summaries": {
"main": [
[
{
"node": "All summaries",
"type": "main",
"index": 1
}
]
]
},
"Contain attachments?": {
"main": [
[
{
"node": "Get PDF and images attachments",
"type": "main",
"index": 0
},
{
"node": "Convert text",
"type": "main",
"index": 0
}
],
[
{
"node": "Convert text",
"type": "main",
"index": 0
}
]
]
},
"Create final summary": {
"main": [
[
{
"node": "Send final summary",
"type": "main",
"index": 0
}
]
]
},
"Email Trigger (IMAP)": {
"main": [
[
{
"node": "Contain attachments?",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model1": {
"ai_languageModel": [
[
{
"node": "Create final summary",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "PDF Analyzer",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Email Summarization Chain": {
"main": [
[
{
"node": "Save summary text",
"type": "main",
"index": 0
},
{
"node": "Email summary",
"type": "main",
"index": 0
}
]
]
},
"Get PDF and images attachments": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
}
}
}
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.
googleDriveOAuth2ApigoogleSheetsOAuth2ApiimapopenAiApiopenRouterApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automates the process of analyzing emails and their attachments (PDFs and images) using AI models (DeepSeek, Gemini, and OpenRouter). It extracts and summarizes the content of emails and attachments, saves the summaries to Google Sheets, and sends a final…
Source: https://n8n.io/workflows/3169/ — 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.
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.
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 workflow automates the creation, rendering, approval, and posting of TikTok-style POV (Point of View) videos to Instagram, with cross-posting to Facebook and YouTube. It eliminates manual video p
This automation is designed to help you generate AI-powered music tracks, cover art, and fully rendered music videos — all triggered from a simple Telegram chat and managed via Google Sheets.
This end-to-end AI-powered recruitment automation workflow helps HR and talent acquisition teams automate the complete hiring pipeline—from resume intake and parsing to GPT-4-based evaluation, TA appr