Use this powerful n8n workflow to triage Gmail messages, auto-reply using AI, extract structured data from PDF invoices, and send alerts via Telegram. Great for technical teams and accounts payable.
Download this n8n workflow template and start using it instantly.
Accounts Payable or Finance Teams receiving invoices via email.
Engineering firms (like the example 'Zenith Engineering') needing automated triage for technical documents.
Business owners seeking to implement advanced AI-driven auto-responders.
Users looking for sophisticated examples of how to combine multiple n8n node types for complex data processing.
This specialized n8n workflow template addresses the critical need for efficient email management and structured document processing in technical organizations. The automation starts with a Gmail n8n trigger, constantly monitoring for new messages, especially those containing attachments. The core value of this n8n template lies in its dual-path processing: first, an AI agent rapidly analyzes the email subject and body to categorize it ('Important,' 'Fishy,' 'Meeting') and formulate a polite, professional reply, which is sent immediately via a Gmail n8n node. Second, if the email contains a PDF identified as an invoice, a sophisticated chain of n8n nodes performs optical character recognition (OCR), extracts key financial metadata (invoice number, total amount, vendor name) using a large language model, and instantly forwards these structured details, along with the original document, to the relevant engineering or finance team via Telegram. This robust n8n workflow minimizes response lag, ensures critical documents are processed quickly, and significantly reduces the manual effort required for data extraction.
The n8n workflow operates through the following steps:
invoicenumber, vendorname, and total_amount based on a predefined schema.To deploy this comprehensive n8n template, follow these steps:
Gmail Trigger: This n8n node initiates the n8n workflow upon receiving a new email. Key Configuration: Set to download attachments immediately (downloadAttachments: true).
Get a message (Gmail): Fetches the full context of the email, crucial for retrieving both text and binary data accurately.
Code (Debugged code to find attachment): A custom scripting n8n node that iterates through binary attachments and uses regular expressions (/invoice/i.test) to specifically detect and flag invoice files, appending hasInvoiceAttachment flag to the data.
AI Agent (LangChain): The central decision-making n8n node. Function: Categorizes email priority and drafts a contextual reply based on extensive system instructions tailored for professional correspondence. Key Configuration: Uses OpenRouter/Gemini and enforces strict JSON output using a Structured Output Parser.
Reply to same thread (Gmail): Sends the AI-generated Response back to the sender, maintaining the conversation thread via the threadId provided by the original Gmail Trigger n8n node.
Filter: Filters processed attachments to ensure only files with the fileType equal to pdf proceed to the extraction path.
Extract from File: Performs text extraction (OCR) on the binary PDF data, making the document content readable by the downstream AI n8n nodes.
Information Extractor (LangChain): An advanced n8n node that utilizes a large language model (Gemini/OpenRouter) to analyze the raw PDF text and extract predefined structured data fields (invoice number, vendor name, currency, items, etc.).
Convert Names to download files (Code): Restructures the binary data received from the Merge n8n node into a format suitable for the Telegram Send Document n8n node.
Send important details (Telegram): Sends a concise message containing the final, structured extracted invoice data to the operational Telegram channel.
Use this powerful n8n workflow to automate image segmentation and object detection using VLM Run, then automatically upload results to Google Drive and share via Telegram. A robust n8n automation.

Use this powerful n8n workflow to automatically remove backgrounds from uploaded images using AI services, track results, and manage temporary download links in Google Sheets.

Implement a robust n8n workflow for Retrieval-Augmented Generation (RAG) using recursive chunking. Integrate Google Drive, OpenAI, and Supabase Vector Store for powerful knowledge base automation.

Securely automate Ko-fi payments using this robust n8n workflow. Route donations, subscriptions, and shop orders through a verified n8n trigger webhook, ensuring data integrity before processing.

Automate large document processing with this specialized n8n workflow. It uses SubworkflowAI to handle file splitting and polling, then utilizes the Google Gemini VLM for accurate OCR transcription.

An investment banker from India who's recently been diving deep into the world of AI and tech. While finance was the starting point, curiosity led into exploring artificial intelligence, digital trends, and the future of innovation. Always learning, always evolving , blending my finance background with a growing passion for tech.







































