---
title: "How to Automate an AP Inbox So Invoices File Themselves"
description: "Automate an AP inbox: a workflow reads each invoice as it arrives, files it by vendor and year in SharePoint or Drive, and holds big totals for approval."
url: https://thedrive.ai/blog/automate-ap-inbox-invoices
published: 2026-11-02
updated: 2026-11-02
tags: ["accounts payable", "invoices", "email attachments", "sharepoint", "outlook", "workflows"]
author: "Bigyan Karki"
publisher: The Drive AI
---

# How to Automate an AP Inbox So Invoices File Themselves

> **TL;DR:** An AP inbox such as ap@ or invoices@ can be automated so that every invoice is filed into the right vendor folder, named from the invoice itself, without anyone downloading it. Connect the mailbox that receives the invoices to The Drive AI, describe the filing in one sentence, and the workflow reads each attachment, files it in SharePoint, OneDrive, Google Drive or Dropbox, and holds anything over a limit for a person. The one setup question that trips teams up is the Microsoft 365 shared mailbox, which cannot be signed in to; the fix is below.

Disclosure: The Drive AI publishes this guide. Microsoft facts come from Microsoft's own documentation, checked November 2, 2026.

## What arrives in an AP inbox?

Invoices, mostly, and everything that looks like one. A typical week at ap@ brings vendor invoices as PDFs, the same invoice again with "reminder" in the subject, statements that list several invoices, credit notes, remittance confirmations, a W-9 or a certificate of insurance from a new vendor, and photographed receipts forwarded from a phone. Every one is an attachment on an email, and every one has to end up in a folder where the bookkeeper and the auditor can find it.

Done by hand, that is a person opening each message, deciding what it is, downloading it, renaming `INV_88213.pdf` to something that says which vendor and which month, and uploading it to the vendor's folder. It is the most repetitive job in a small finance team, which is why it is the first one to [automate an accounts payable workflow](https://thedrive.ai/blog/accounts-payable-workflow-automation) around.

## Why don't inbox rules or Power Automate solve it?

Because the information that decides where an invoice goes is inside the invoice. A rule or a flow only sees the sender, the subject and the filename.

- **Outlook rules** move messages between mail folders. There is no rule action that saves an attachment anywhere. ([Microsoft Learn](https://learn.microsoft.com/en-us/office/vba/api/outlook.olruleactiontype))
- **Power Automate** can save every attachment that arrives in one mail folder into one SharePoint or OneDrive folder under its original name; a folder per vendor means a condition per vendor, matched on the sender address, which breaks when a vendor's billing address changes. It cannot tell an invoice from a statement or check a total. The full build and its limits are in how to [save email attachments to SharePoint](https://thedrive.ai/blog/save-email-attachments-to-sharepoint).
- **Gmail filters** label and forward; they cannot save a file.

A workflow that reads the invoice can do the three things AP actually needs: tell an invoice from everything else, name and file it by vendor and period, and stop for a person when the total crosses a line.

## How do you connect an AP mailbox?

Connect the account that receives the invoices. The Drive AI connects Gmail and Microsoft-hosted Outlook accounts (Microsoft 365, Outlook.com, custom domains on Microsoft hosting) through the account's own sign-in, with permission to read mail and attachments in that mailbox only. Three setups cover almost every AP inbox:

1. **ap@ is a real user mailbox.** Someone signs in to it. Connect it, and the workflow watches it directly. In a team workspace the person who owns the mailbox connects it with their own consent.
2. **ap@ is a Microsoft 365 shared mailbox.** This is the common case, and it cannot be connected as it is: Microsoft says a shared mailbox "isn't intended for direct sign-in" and its account has "a system-generated password that isn't known or intended for use". ([About shared mailboxes](https://learn.microsoft.com/en-us/microsoft-365/admin/email/about-shared-mailboxes)) The fix is forwarding. An Exchange administrator sets the shared mailbox to forward to a licensed mailbox that is connected, keeping a copy in the shared mailbox so nothing changes for the team. Microsoft documents forwarding in the admin center, including the "keep a copy" option, and notes that only new mail is forwarded from the moment it is set. ([Configure email forwarding](https://learn.microsoft.com/en-us/microsoft-365/admin/email/configure-email-forwarding)) The sender filter on the workflow then uses the original vendor addresses, because a forwarded invoice still carries them in the message.
3. **ap@ is an alias or a group that delivers into someone's Gmail.** Connect that person's Gmail. The workflow's Subject contains or From filter keeps it to the invoice traffic.

Work or school Outlook accounts often need a Microsoft 365 administrator to approve The Drive AI before the first connection; the request comes with the permissions in plain language. Connecting a mailbox needs the Max plan on a personal workspace or any Team plan. See how to [automatically save Outlook attachments](https://thedrive.ai/blog/outlook-attachment-workflows-automate-filing) for the Outlook specifics, or the page on how to [save Outlook attachments](https://thedrive.ai/integrations/outlook).

## What does the AP workflow look like?

One sentence, typed once:

```
When an attachment arrives at ap@, save a copy to the Finance library. Read the vendor, invoice number, invoice date and total. If it is an invoice, rename it "Invoice - Vendor - Date - Total" and file it under Vendors, then the vendor, then the year. If the total is over $5,000, ask Dana to approve before filing. If it is a statement or a credit note, file it under Vendors/Vendor/Statements. If it is anything else, put it in Finance/Review and tell #ap in Slack.
```

The steps drawn from it:

1. **Email Attachment** is the trigger, narrowed with From (for example `@` plus a vendor domain) or Subject contains so personal mail in the same account is ignored.
2. **Save a Copy** gives the attachment a home first: the Finance library in SharePoint, a OneDrive or Google Drive folder, Dropbox, or The Drive AI. The email itself is never saved or changed.
3. **Read Details from File** pulls the vendor, invoice number, date and total off the page, including scanned invoices and photographed receipts.
4. **Ask AI About the File** sorts invoice, statement, credit note, other.
5. **Rename** and **Move** apply the pattern and the vendor-and-year path.
6. **Ask a Person to Approve** holds anything over the limit. The approver sees the planned name and destination, approves or rejects, and the file continues down that branch. Approvals expire after the time you set (three days by default, thirty at most), and an expired file takes the Expired path rather than vanishing.
7. **Send a Message** posts to Slack or sends an email when something lands in Review.

The sender, subject and email text are read as context ("attached is our October invoice, PO 4471") and never as instructions. Every run is in Activity, replayable and retryable from the step that failed.

## How are duplicates and reminders handled?

Reminders that re-attach the same invoice are the AP inbox's special problem. Two controls cover it:

- **Skip duplicate files** on the trigger ignores byte-for-byte copies of a file the workflow has already handled. A vendor's re-sent PDF is usually identical and is skipped.
- **The Move step's conflict setting** decides what happens when a file with the same name already exists in the vendor folder: keep both, skip, or set the new one aside for review. For invoices, review is the safe choice, because an invoice that is the same name but not the same bytes may be a corrected version.

A re-scan or a re-export of the same invoice is a different file and is not caught by the duplicate check; the name conflict catches it instead.

## Where do the invoices end up?

Wherever finance already works. Save a Copy targets a connected SharePoint library, OneDrive or Google Drive folder, or Dropbox, and Move files inside it; or the invoices stay in The Drive AI, where the assistant can answer across them ("total every Northwind invoice this year", "which vendors have no invoice for August?"). The destination is one word in the sentence, so a team that moves from a shared drive to SharePoint changes one step, not the workflow.

The invoices already sitting in the inbox come in with Historical Sync (the last 30, 90 or 180 days, up to a year on Outlook), land at the top level as they are, and a workflow watching new uploads files them by the same sentence. See how to [organize email invoices automatically](https://thedrive.ai/blog/organize-email-invoices-automatically) for the folder and naming patterns that hold up at year end.

## What will it not do?

- **Three-way matching, GL coding and payment.** The workflow files the invoice and can hold it for approval; it does not match it to a purchase order or a receipt, post it to the ledger or pay it. That is AP software's job, and the [accounts payable workflow](https://thedrive.ai/blog/accounts-payable-workflow-automation) guide covers where the two meet. To pull the fields into another system, Send to Another App posts them to a webhook.
- **Chasing missing invoices.** Nothing watches for a vendor whose invoice has not arrived or sends reminders. Ask the assistant instead, after the fact.
- **Connecting a shared mailbox directly.** See the forwarding setup above.
- **Changing the mailbox.** Messages are not moved, labelled or deleted. Attachments are copied out.
- **Messaging Teams.** Send a Message reaches Slack or an email address.
- **Being right every time.** The steps that read a file can occasionally misread a total or a vendor, which is why the approval step shows the plan first and why every run can be replayed.

## Setting it up

1. **Decide which account receives the invoices**, using the three setups above. If it is a shared mailbox, ask the Exchange administrator for forwarding with a copy kept.
2. **Connect the mailbox and the destination** (SharePoint, OneDrive, Google Drive or Dropbox).
3. **Type the sentence** with the vendor-and-year path, the name pattern, the approval limit and the Review branch. Check the drawn steps.
4. **Set Ask a Person to Approve to Always ask** for the first two weeks. Switch it to Only when unsure once the filing is trusted, keeping Always ask on the over-limit branch.
5. **Send a test invoice** and open the run.
6. **Run Historical Sync** for the backlog.

For the wider field, including the AP-specific capture tools, see the roundup of [email attachment management software](https://thedrive.ai/blog/best-email-attachment-management-software); for the general method by inbox and destination, how to [save email attachments to folders](https://thedrive.ai/blog/save-email-attachments-to-folders).

## Frequently Asked Questions

### Can I connect a shared mailbox like ap@ to The Drive AI?

Not directly. A Microsoft 365 shared mailbox has no usable sign-in, by Microsoft's design, so there is nothing to authorise. Have an Exchange administrator forward the shared mailbox to a licensed mailbox that is connected, keeping a copy, or make ap@ a real user mailbox. In a team workspace, a workflow can also watch several members' inboxes.

### How does the workflow know which vendor an invoice is from?

It reads the invoice. Read Details from File pulls the vendor name off the page, so an invoice forwarded by a colleague or sent from a new billing address still files under the right vendor. The sender address is available as a filter and as context, but the folder comes from the document.

### Can it hold invoices over a certain amount for approval?

Yes. Ask a Person to Approve, placed after the total is read, holds any invoice over the limit you name. The approver sees the planned filename and folder, approves or rejects, and expired approvals take their own path so nothing is lost silently.

### Does it file the invoice into SharePoint?

Yes, into a connected SharePoint Online library, filed by vendor and year with a name taken from the invoice. SharePoint needs a one-time tenant administrator approval. OneDrive, Google Drive, Dropbox and The Drive AI's own storage work the same way.

### What happens to the invoices already in the inbox?

Run Historical Sync on the connected account for the last 30, 90 or 180 days (up to a year on Outlook). They land at the top level as they are, and a workflow watching new uploads files them by the same sentence.

### Does it replace AP software?

No. It gets every invoice out of the inbox, named and filed, and holds the ones that need a decision. Matching, coding, approvals tied to purchase orders and payment stay in the AP or accounting system, which can receive the extracted fields through Send to Another App.

## Start with the inbox, not the software

Most AP automation projects start with the accounting system and never reach the inbox, which is where the invoices actually are. Connect the mailbox, write one sentence, approve everything for two weeks, then narrow it. [Build the first workflow](https://thedrive.ai/signup), or see how [file workflows](https://thedrive.ai/file-workflows) fit together first.
