workflows.fit
Back to n8n workflows
n8n template$35By AI Solutions

Extract and log Outlook invoices to OneDrive Excel with GPT-4.1-mini

Invoice Processor – Microsoft 365 > Automatically extract, log, and archive invoices from your Outlook inbox using GPT-4.1-mini, OneDrive, and Excel — no manual data entry required. Who It's For This workflow is bu...

DevelopmentCore NodesData & StorageProductivityCommunicationHITLAILangchain
Open checkout
Loading interactive preview...

Template notes

Invoice Processor – Microsoft 365

> Automatically extract, log, and archive invoices from your Outlook inbox using GPT-4.1-mini, OneDrive, and Excel — no manual data entry required.

Who It's For

This workflow is built for small business owners, finance teams, and operations managers who receive invoices via email and need a hands-free way to capture, organize, and track them. It works entirely within the Microsoft 365 ecosystem — no third-party apps required.

How It Works

The workflow runs on a daily schedule (default: 7 AM) and fetches all unread emails from a specified Outlook folder. Each email body is cleaned from HTML to plain text and passed to GPT-4.1-mini, which extracts 14 structured invoice fields — including vendor name, invoice number, issue date, due date, and total amount due. If the email includes a PDF attachment, the workflow fetches it via the Microsoft Graph API, checks whether a dated subfolder exists in OneDrive (Invoices/YYYY-MM-DD), creates one if needed, and uploads the file as VENDOR-YYYY-MM.pdf, capturing the shareable link. All extracted data is appended to an Excel table for record-keeping. Finally, processed emails are marked as read and a formatted HTML digest summarizing all invoices is sent via Outlook.

How to Set Up

1. Add your Microsoft Outlook OAuth2 credential — used to fetch emails and send the digest. 2. Add your Microsoft Graph OAuth2 credential — used for OneDrive folder creation, PDF upload, and Excel append. 3. In Outlook — Get Unread Emails, update foldersToInclude to your target Outlook folder ID (find it via Graph Explorer). 4. In Excel — Append Invoice Row, update the workbook, worksheet, and table IDs to match your tblInvoices tracker file in OneDrive. 5. In Code — Build Digest Email, replace YOURONEDRIVEFOLDERURL with a direct link to your Invoices folder. 6. In Outlook — Send Daily Digest, replace YOUREMAIL@example.com with your recipient address.