Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Documents, PDF & OCR

Documents, PDF & OCR

Parse Outlook Invoice Emails with Gemini Document Understanding

On a schedule, it checks an Outlook mailbox for invoices, has Gemini read the attached documents, and saves the extracted data to Excel.

What it does

## Try it out ### This n8n template monitors an Outlook mailbox for invoices, automatically parses/extracts data from them and then uploads the output to an Excel Workbook. One of my top workflow requests, this template can save in order of 100s of hours of manual labour for you or your finance team. ### How it works * A scheduled trigger is set to fetch recent Outlook messages to the Accounts receivable mailbox. * Each message is analysed to determine whether or not it from a supplier and is issuing/contains an invoice. * For each valid message, the attachments are downloaded and non-invoice documents are filtered out via AI Vision classification. * Invoices are then processed through a AI vision model again to extract the details. * The extracted data can then be used for reconciliation or otherwise. For this demonstration, we'll just append the row to an Excel sheet for now. ### How to use * Ensure your Microsoft365 credential points to the correct mailbox. If a shared folder is used, toggle "shared folder" option to "on" and for the principal ID, use the email address. * If you receive lots of other types of messages such as replies and forwards, you may want to implement additional checks to prevent processing invoices twice. The "remove duplicates" node can help with this. ### Need Help? Join the Discord or ask in the Forum! Happy Hacking!

The steps

  1. Split Attachments
  2. Download Attachments
  3. Parse Output
  4. For Each Message
  5. Message Ref
  6. Message Classifier
  7. Extract from File
  8. Markdown
  9. Empty Response
  10. Wait
  11. Filter Invoices
  12. Has Invoice?
  13. Schedule Trigger
  14. Get Recent Messages

18 steps in total.

Similar automations