Skip to main content

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

Workflow preview

Workflow preview
100%
Extract and log Outlook invoices to OneDrive Excel with GPT-4.1-mini preview
Open on n8n.io

1. Workflow Overview

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...

Best for

  • Invoice Processing automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.microsoftoutlook, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.set, n8n-nodes-base.if

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by AI Solutions.

Original n8n.io source

1.1 Workflow description

Title
Extract and log Outlook invoices to OneDrive Excel with GPT-4.1-mini
Workflow name
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 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 YOUR_ONEDRIVE_FOLDER_URL with a direct link to your Invoices folder.
  6. In Outlook — Send Daily Digest, replace [email protected] with your recipient address.

Requirements

  • Microsoft Outlook OAuth2 credential
  • Microsoft Graph OAuth2 credential (Generic OAuth2 with https://graph.microsoft.com/.default scope)
  • OpenAI API credential (GPT-4.1-mini)
  • An Excel workbook in OneDrive with a table named tblInvoices containing columns matching the field list
  • A PDF Link column added to your tblInvoices table

How to Customize

  • Change the schedule: Adjust the cron expression in Schedule — Daily Trigger to run more or less frequently.
  • Add more fields: Extend the extraction prompt in AI — Extract Invoice Fields with additional fields and add matching columns to your Excel table.
  • Modify the folder structure: Edit Code — Build Upload Path to change how PDF subfolders are named or organized in OneDrive.
  • Filter by sender or subject: Add a Filter node after Outlook — Get Unread Emails to process only emails matching specific criteria.

Support: [email protected] | Automated Intelligent Solutions

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note Trigger

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note Prepare

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note AI

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note OneDrive

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note Write

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Schedule — Daily Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.3

Block 8 - Outlook — Get Unread Emails

Type / Role
n8n-nodes-base.microsoftOutlook - microsoftOutlook
Config choices
Version 2

Block 9 - Code — Prepare Invoice Text

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - AI — Extract Invoice Fields

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.9

Block 11 - OpenAI — GPT-4.1-mini Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 12 - Code — Parse Invoice JSON

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Set — Format Excel Row

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - IF — Has Attachment?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 15 - HTTP — Get Attachments

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 16 - Code — Build Upload Path

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - HTTP — Check Folder Exists

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 18 - IF — Folder Exists?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 19 - HTTP — Create Folder

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 20 - Merge — After Folder Check

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 21 - Code — Decode PDF Binary

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 22 - HTTP — Upload PDF

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 23 - Code — Capture PDF Link

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 24 - Code — No Attachment Pass-Through

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Showing the first 24 of 30 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Extract and log Outlook invoices to OneDrive Excel with GPT-4.1-mini
Complexity advanced
Nodes 30
Categories Invoice Processing, AI Summarization
Author AI Solutions
Published 14 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15723/15723.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Extract and log Outlook invoices to OneDrive Excel with GPT-4.1-mini do?

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...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Invoice Processing, AI Summarization use case.