AI Document Classification: Invoice, Receipt, or Contract
TL;DR: AI document classification reads a document and decides what kind it is, so a file is routed by its contents rather than its filename or sender. Keyword matching breaks on files named
scan_0041.pdf, and template trained capture breaks when a vendor redesigns their invoice. In The Drive AI, one Ask AI About the File step carries branches named invoice, receipt, and contract, and each leads to its own Move and Rename.
Open any shared inbox folder and the problem is obvious. scan_0041.pdf is a signed lease. Document (3).pdf is a $4,200 invoice. IMG_2298.jpg is a receipt someone photographed in a car park. Each belongs somewhere different, and no filename says where.
This is the decision every filing system gets wrong. Most tools classify on the filename, on the sender, or on a metadata column somebody was supposed to fill in. All three are proxies, and they hold only until a vendor changes their address or somebody keeps the default name.
AI document classification is the practice of deciding what category a document belongs to by reading its contents, then using that decision to route the file. Get it right and the rest of the filing is arithmetic. Get it wrong and every later step compounds the error.
What is AI document classification?
AI document classification assigns a document to one of a set of named categories based on what it contains: invoice, receipt, purchase order, contract, resume, bank statement. The output is a label, and the label decides what happens next.
Classification answers "what kind of document is this?". Extraction answers "what values are inside it?". You want both, in that order, and extracting data without templates is the second half of the job.
A workable taxonomy has three properties. Categories are mutually exclusive. They are defined by what a reader would say, not by what a system stores. And there is a catch-all, because a fourth kind of document always arrives.
How do classifiers actually work? The three approaches
Three families compete here, and they fail in different places.
Keyword and pattern matching. A file goes to the invoice folder because its name contains INV, or its text contains "Invoice Number". Fast, deterministic, free, and the right tool when the signal is reliable: one vendor who always sends ACME-INV-2291.pdf needs nothing cleverer. It falls over on scans, on generic filenames, and on the word "invoice" also appearing on quotes and statements.
Template or zone based capture. You show the tool an example document, draw boxes around the regions that matter, and it learns that layout. Rossum, Docparser, Nanonets, and similar products work this way, and accuracy on a layout they have seen is high. But accuracy is per layout. A new vendor is a new template, and when a vendor redesigns their invoice, which they do without telling anyone, the zones point at white space. The failure is quiet: fields come back empty, and nobody notices until a payment run.
Reading the document with a language model. The model reads the page the way a person would and answers a question about it. No per layout setup, so a vendor you have never seen is handled like any other. It can tell that a document with a total, a due date, and payment terms is an invoice, while one with a card authorization is a receipt. The trade-offs are real: a cost per file, and the occasional confident mistake on an ambiguous page.
Why does invoice vs receipt classification trip everything up?
Because the two share nearly every field and differ on one idea: an invoice requests payment, a receipt proves payment happened. A pattern matcher sees a vendor, a total, a date, and tax on both.
That distinction decides where the file goes, since invoices enter payables and receipts attach to expenses. The same trap appears in signed against unsigned copies of one agreement: identical layout, opposite meaning. That is the honest case for reading the document.
How does classification work in a workflow?
Document routing automation starts with one sentence. You describe the sorting in plain English and the steps appear on a canvas. Two step types make the decision, and choosing between them decides the cost.
Check File Details is free. It decides from what is already recorded about the file, without opening it: Type (PDFs, Documents, Spreadsheets, Slides, Images), Age (older or newer than N days), Location (inside a named folder, at any depth, or in no folder), Name (contains this text), and Size (larger or smaller than N MB). Each named condition you add gets its own branch, and everything else takes a fall-through branch. One node is a gate, or a sorter.
Ask AI About the File opens the file and reads it, and the field asks what you want decided. The part most people miss is that this step is not a yes/no gate. The branches are authored per node, and they are the answers the model is allowed to give. One node can have branches named invoice, receipt, and contract, and each file leaves by the branch that matches. That is classification into named categories in one step, with a path per category.
Cost follows from that. Use the free step when the fact is already recorded, and the ai step when the answer is inside the document. Type, folder, age, and size are known, so never spend an AI read on them. Whether a contract is fully signed is recorded nowhere, so that one needs the file opened.
Each branch leads to its own actions. The invoice branch goes to a Move pointed at Vendors/Pinecone Systems/2026 and a Rename told "with the vendor name and invoice number". The contract branch goes to a different Move and Rename. The complete guide to automated document workflows covers how the pieces fit.
Example workflows
Each is typed as one sentence, and the steps are laid out on the canvas afterwards.
When a file arrives in the Operations Inbox folder, decide whether it is an invoice, a receipt, a contract, or something else. File invoices in Finance/Invoices/2026, renamed with the vendor and invoice number. File receipts in Finance/Receipts/2026. File contracts in Legal/Contracts, renamed with the counterparty. Leave anything else where it is.
When an email attachment arrives from a client, decide which client it belongs to: Northwind, Pinecone Systems, or Halverson. File it under Clients/Northwind/2026, Clients/Pinecone Systems/2026, or Clients/Halverson/2026 to match, renamed with the client name and date. If it belongs to none of them, move it to Inbox/Unsorted.
When a PDF is added to Legal/Incoming, check whether the contract is fully signed by every party. If it is, move it to Clients/Northwind/Contracts/Executed and rename it with the counterparty and the signing date. If a signature is missing, move it to Legal/Awaiting Signature and send a Slack message to legal-ops.
When a file arrives in Field Reports, first check the file details: if it is an image, move it to Field Reports/Photos/2026 and stop. Otherwise decide whether it is an inspection report, a permit, or an invoice, and file it under Projects/Halverson Tower/2026 in the matching folder.
The last one is the pattern worth copying: a free step runs first and sends every photo down its own path before an AI read is spent.
How does this compare to the alternatives?
| Capability | Keyword and filename matching | Template trained capture | Power Automate with AI Builder | Ask AI About the File |
|---|---|---|---|---|
| What the decision reads | Filename, sender, matched text | Zones on a known layout | Metadata and columns; contents via AI Builder | The document contents |
| Vendor redesigns the invoice | Fine if the keyword survives | Zones can miss | Model dependent | Unaffected |
| Setup per category | A keyword list | A trained layout | A flow, plus AI Builder licensed separately | A branch name |
| Invoice vs receipt | Unreliable, fields overlap | Reliable per layout | Possible with AI Builder | Decided by reading the page |
| Cost shape | Free | Per document, plus layout setup | Per run, plus AI Builder licensing | Free for recorded facts, per file when AI reads |
Power Automate is strong where the decision lives in SharePoint itself: a column value, a content type, a library event. It reads what a document says only when AI Builder is added separately. Gmail filters and Outlook rules never see attachment contents.
Limits and what it will not do
Classification is a decision, not a label written onto the file. There is no tag step and no OCR configuration step in a workflow. The result is the path the file takes, and what the steps on that path do.
AI steps can be wrong, and the cost of a bad call is a file in the wrong folder. Where that matters, put Ask a Person to Approve after the classification, with When to ask? set to Only when unsure and a caution preset of Careful, Balanced, or Relaxed. Approvals expire after the Wait up to window of 24 hours, 3 days, or 1 week, and the file then takes the Expired exit. Human review in a document workflow covers the configuration.
Author a catch-all branch. A taxonomy of invoice, receipt, and contract meets a delivery note eventually, and "other" gives it a named destination.
Files stay where they live. A workflow watching a folder in Google Drive, OneDrive, SharePoint, or Dropbox renames and moves files in place inside that storage. Nothing is imported unless you add a Save a Copy step, and then only to the place you name. Email and chat attachments have no storage home, so those need one. Every run is recorded, replayable on the canvas exactly as it happened, and retried from the step that failed.
Workflows on files uploaded to The Drive AI work on every plan. Connecting Gmail, Outlook, Slack, Teams, Google Drive, OneDrive, SharePoint, or Dropbox needs the Max plan on a personal workspace, or any Team plan. Every file a workflow processes counts once against a monthly allowance.
Setting it up
- Pick where the mixed files arrive: a shared folder, a SharePoint document library, or a Gmail account whose attachments you file by hand.
- Write your categories down first. Three or four, mutually exclusive, plus other. If you cannot name the destination folder for a category, it is not a category yet.
- Describe the sorting in one sentence, naming each category and where its files go. The steps appear on the canvas.
- Check the cost badges. Anything decided on type, folder, age, name, or size belongs in a free Check File Details step, placed before the AI step.
- Confirm each branch leads to the Move and Rename you intended, and that the fall-through goes somewhere deliberate.
- Run it on a small batch and replay a run in the activity feed, adjusting the branch names if documents take a path you did not expect.
To sort a backlog instead of new arrivals, use an On a Schedule source over the folder and set Each run goes through to Every file, every run. Reorganizing files you already have explains that setup.
Frequently Asked Questions
How accurate is AI document classification?
Accuracy depends more on the categories than on the model. Distinct, mutually exclusive categories are classified reliably. Overlapping ones, such as invoice against statement against remittance advice, produce borderline calls, because the documents are genuinely similar. Start with three or four categories and add an approval step where a wrong call is expensive.
Can one step classify into more than two categories?
Yes. The branches on an Ask AI About the File step are authored per node and are the answers the model is allowed to give, so one step can carry branches named invoice, receipt, contract, and other. Each file leaves by the branch that matches, and each branch runs its own actions.
What is the difference between classification and data extraction?
Classification decides what kind of document you are holding. Extraction pulls named values out of it. Ask AI About the File classifies and forks the path, while Read Details from File extracts fields you name, such as vendor, amount, and due date, for later steps. Classify first, since an invoice and a lease need different fields.
How do I keep AI costs down when classifying files?
Put free steps first. Check File Details decides on type, age, location, name, and size without opening the file, so images or anything already in the right folder is routed before any AI runs. Then let the ai step answer only the question that needs the page read. On a schedule, "New and changed files only" prevents repeat reads.
Can I route documents by which client they belong to?
Yes, and it is one of the more useful patterns. Author a branch per client, then give each its own Move and Rename. For a longer list, let Move work it out, with an instruction such as "to the client folder, then by year", since the AI reads the file and infers the folder. Firms at volume pair this with accounting workflows.
Start with one category
The fastest way to test this on your own documents is to classify one thing. Point a workflow at the folder where mixed files land, ask it to separate invoices from everything else, and check the runs. Once that branch is right, add the next. Create a workflow, or see how Workflows file everything once the decision is made.
Share it with your network
