Use this powerful n8n workflow to automatically monitor Outlook for invoices, classify attachments using Google Gemini AI, extract critical data, and append structured output to Microsoft Excel 365.
Download this n8n workflow template and start using it instantly.
Finance and Accounting teams looking to automate Accounts Payable (AP) data entry.
Businesses receiving large volumes of invoices via email.
Automation Specialists seeking advanced examples of using the n8n node ecosystem for document understanding.
Users looking for ready-made n8n templates for Microsoft 365 and AI integration.
This automation solves the tedious and error-prone process of manually handling incoming supplier invoices via email. By leveraging the power of an n8n workflow combined with advanced AI capabilities from Google Gemini, the solution can intelligently classify incoming emails and attachments. This saves hundreds of hours of manual labor by filtering out non-invoice attachments, performing Optical Character Recognition (OCR) style extraction, and outputting clean, structured data.
This specific n8n template provides a robust, scheduled mechanism that monitors your designated Accounts Receivable Outlook mailbox. It ensures that only validated invoice documents are processed, drastically reducing resource consumption and improving data accuracy before appending the extracted data to a Microsoft Excel spreadsheet for reconciliation.
This comprehensive n8n workflow begins execution via a Schedule Trigger, running every hour to check for new messages.
To deploy this powerful n8n workflow, follow these steps:
filtersUI configuration points to the correct foldersToInclude (your Accounts Payable mailbox ID). Schedule Trigger (n8n trigger): The entry point, set to run every hour to check for new invoices.
Microsoft Outlook (Get Recent Messages, Download Attachments): This n8n node connects to Microsoft 365 to retrieve emails filtered by received time and the presence of attachments. It also handles the secure download of the binary file data for processing.
Code (Split Attachments): A custom scripting n8n node essential for iterating over multiple binary files attached to a single email, ensuring each file is processed individually.
Langchain Text Classifier (Message Classifier): Uses an AI language model (Gemini) to determine the intent of the email based on text analysis, allowing the n8n workflow to filter out irrelevant messages early.
HTTP Request (Invoice Classifier With Gemini 2.0 & File-Based OCR with Gemini 2.0): These are critical n8n nodes that interact directly with the Gemini API for document vision tasks. They are configured using specific JSON schemas (response_schema) to force structured output, enabling highly accurate extraction of invoice details (dates, amounts, services).
Filter (Filter Invoices): A core logic n8n node that uses the boolean output from the AI classification step to ensure only positively identified invoices continue through the data extraction flow.
Set (Parse Output, Empty Response): Used to map the final extracted data into a clean JSON structure, ensuring the output is standardized before being sent to the spreadsheet.
Microsoft Excel 365: The final sink n8n node, configured to append the structured invoice information to a specified Excel Workbook, ready for review.
Use this powerful n8n workflow to convert unread or starred Gmail messages into structured Todoist tasks. Leverage AI to summarize content, propose actions, and draft replies automatically.

Master data extraction using a custom n8n node. This n8n workflow template uses RegEx in a Function node to parse unstructured email bodies into clean JSON objects, ideal for automation.

Automate DMARC report processing using this robust n8n workflow. It monitors a dedicated mailbox, parses zipped XML reports, stores data in MySQL, and triggers immediate alerts via Slack or email upon detecting DKIM or SPF failures. This n8n template ensures continuous email security monitoring.

Automate data extraction from uploaded PDFs, images, and CSVs using an n8n workflow powered by Google Gemini AI and OCR. Save structured invoice or report data directly to Google Sheets.


Freelance consultant based in the UK specialising in AI-powered automations. I work with select clients tackling their most challenging projects. For business enquiries, send me an email at [email protected] LinkedIn: https://www.linkedin.com/in/jimleuk/ X/Twitter: https://x.com/jimle_uk







































