Use this advanced n8n workflow to automatically process incoming emails, extract, summarize PDFs and images using various AI models (GPT-4o, DeepSeek, Gemini), save data to Google Sheets, and send a final report via Telegram. This is a crucial n8n templates solution for managing complex email data.
Download this n8n workflow template and start using it instantly.
Managing high-volume inboxes where key information is buried across email bodies, attached PDF documents, and embedded images is highly time-consuming. This powerful n8n workflow solves this by providing an end-to-end AI-driven solution.
Upon receiving an email via the IMAP n8n trigger, the n8n workflow intelligently breaks down the message into its core components. It leverages specialized LLMs (like DeepSeek, GPT-4o-mini, and Gemini) for tasks such as email summarization, image analysis, and PDF text extraction. This ensures high accuracy for each data type. All partial results are saved to Google Sheets for structured data logging, and files are archived in Google Drive. The ultimate value of this n8n workflow lies in its final step: synthesizing these individual summaries into one cohesive report, which is instantly delivered via Telegram, giving the user immediate, actionable insight without manually opening files.
This comprehensive n8n workflow is activated by the Email Trigger (IMAP) n8n trigger whenever a new email is detected. The flow immediately checks if the email contains attachments using an If n8n node.
To deploy this complex n8n workflow, follow these steps:
CHAT_ID in the Send final summary n8n node with your specific Telegram Chat ID and configure the necessary Telegram API credentials. Email Trigger (IMAP) n8n trigger: The starting point of this automation. It checks the specified IMAP mailbox and is configured to download all incoming attachments.
If (Contain attachments?) n8n node: A crucial control flow node that checks for the presence of binary data (attachments) to decide whether to execute the attachment processing branch of the n8n workflow.
Code (Get PDF and images attachments) n8n node: Custom JavaScript logic used to iterate through all downloaded binary items and prepare them for individual processing by subsequent nodes.
Switch n8n node: Directs attachments based on the file extension, routing PDFs to the document extraction path and JPG/PNGs to the image analysis path.
Analyze image n8n node (OpenAI): Uses GPT-4o-mini's multimodal feature to generate a textual description of the image content. Configuration: Resource: image, Input Type: base64.
Email Summarization Chain n8n node: A Langchain n8n node that summarizes the cleaned email text using the DeepSeek R1 model. It is configured with a detailed system prompt for concise summarization.
PDF Analyzer n8n node (Langchain): Processes the extracted text from PDF files using the Gemini 2.0 Flash model and a dedicated summarization prompt. It is linked to a Structured Output Parser n8n node to ensure predictable JSON output.
Google Sheets n8n node (multiple instances): Used for persistence. Multiple instances append rows to a specified Google Sheet, recording the email ID, date, summary type (pdf, image, email), and the generated summary content.
Create final summary n8n node (Langchain): The culmination of the analysis. It takes all individual summaries and uses the Gemini 2.0 Flash model with a sophisticated synthesis prompt to generate one unified, comprehensive report.
Telegram n8n node: The final action, sending the synthesized report to a defined CHAT_ID, effectively completing the automated n8n workflow cycle.
This powerful n8n workflow template enables dynamic AI data extraction from PDF files uploaded to Baserow. Use custom field descriptions as LLM prompts for seamless automation.

Use this powerful n8n workflow to automate AI data extraction from PDFs uploaded to Airtable. It supports dynamic, user-defined prompts and complex flow control.

Use this powerful n8n workflow to instantly convert a text prompt into a curated Spotify playlist. Leverage OpenAI agents and Linkup web search for perfect music curation.

Use this powerful n8n workflow template to automatically summarize and prioritize urgent Gmail messages using GPT-4o-mini, send real-time Slack alerts, and compile a daily digest.

Automate your inbox efficiently using this advanced n8n workflow. It utilizes Retrieval-Augmented Generation (RAG) with Pinecone and OpenAI to automatically answer complex emails based on your knowledge base.

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at [email protected] or add me on Linkedin.com/in/davideboizza







































