· Kevin Li · Workflow design · 7 min read

AI Document Classification: Sort Files into the Right Workflow

See a worked mixed-inbox example, define document classes, test lookalikes and unknowns, and route files safely before extraction or approval.

AI document classification identifies what kind of document arrived so it can enter the right workflow. It does not prove the document is valid, extract every field, approve a decision, or post a transaction. For a small business, the practical first step is to define a few distinct document types, the next queue for each type, and a place to hold anything unclear.

Here is what that looks like before choosing a tool.

A mixed inbox: what would you do with these five files?

The following is a fictional example, not a KelenAI customer project. Imagine a distributor’s shared inbox receives these attachments on Monday morning. The goal is not to guess a label from the filename. It is to decide what work, if any, should start next.

What the file actually saysClass to assignSafe next stepTempting mistake
“Invoice INV-237,” billed to the distributor, with an amount dueSupplier invoiceSend to the AP intake queue for field extraction and validationTreat the invoice label as permission to pay it
“Statement of account,” listing three earlier invoice balancesSupplier statementSend to reconciliation, not new-invoice intakeCreate three duplicate payables from the listed balances
“Credit memo CM-32,” referring to INV-237Credit memoRoute to AP review against the referenced invoiceTreat its amount as another charge
“Order acknowledgment,” referring to purchase order PO-204 and a revised ship dateOrder acknowledgmentRoute to purchasing for comparison with the POClassify it as a new purchase order because a PO number appears
One PDF containing both INV-237 and the order acknowledgmentMixed / needs splitSeparate the documents if the method supports it; otherwise hold for a personAssign one label to the whole PDF and lose the second document

The important output is the next queue, not the label alone. A statement and an invoice may both contain supplier names, invoice numbers, and amounts. Their business meaning is different. Classification is useful only if that difference survives into routing.

This is also where classification ends. An invoice routed to AP still needs extraction, supplier and duplicate checks, the applicable approval, and a confirmed system update. Our invoice processing workflow guide covers that wider path for supplier invoices; the invoice extraction comparison covers the separate job of reading fields from a document.

Define classes that change the next action

Start with the decisions your team already makes. For each class, write a one-sentence definition, a positive clue, a lookalike it must not absorb, and the queue that owns it. For the example above:

  • Supplier invoice: a supplier’s request for payment for supplied goods or services. A balance summary that merely lists earlier invoices is not a new invoice. Destination: AP intake.
  • Supplier statement: a summary of account activity or open balances across a period. Destination: reconciliation.
  • Credit memo: a supplier document that reduces or adjusts an existing charge. Destination: AP review, with a reference to the original transaction.
  • Order acknowledgment: a supplier’s confirmation or change to an order your business placed. Destination: purchasing comparison.
  • Other / needs review: a document outside the approved set, too unreadable to classify, or genuinely ambiguous. Destination: a named human queue, never the nearest available category.

If a single PDF can contain several documents, add a separate split or hold decision before assigning business types. Google Cloud’s Document AI overview distinguishes OCR, splitting, classification, and extraction; Microsoft’s Document Intelligence overview likewise describes classification as identifying types before invoking extraction. In practice, those are different jobs even when a vendor packages them together.

Do not create twenty labels because your filing cabinet has twenty folders. Begin with the categories that send work to meaningfully different owners or checks. If two labels lead to the same next step and staff cannot define the difference consistently, combining them may be more useful than asking a model to decide between them.

When should rules do the sorting instead of AI?

Use a deterministic rule when the sender, channel, form, or document code reliably identifies the type. A purchase order exported by your own ERP through a controlled integration should not need a model to rediscover that it is a purchase order. Rules are easier to inspect and usually cheaper to maintain when inputs are stable.

Use AI classification when documents arrive from many outside sources, layouts vary, and type depends on the content rather than a trusted identifier. The classifier should propose a type from your defined set. It should not invent a new class, infer a payment decision, or silently force every unfamiliar file into a known bucket. Microsoft’s custom-classifier guidance explicitly discusses an other class or a score threshold for documents outside the trained classes. Which approach works for your files needs testing; there is no universal safe score cutoff.

Many teams need both: rules for known sources and AI for the variable remainder. A human handles the cases the system cannot responsibly route.

Test the mistakes that would send work to the wrong team

Before auto-routing, collect a labelled set of recent documents that did not train or configure the classifier. Include normal examples, near-misses, poor scans, unfamiliar suppliers, and multi-document PDFs. Have the people who own AP and purchasing agree on the correct label and next queue before comparing it with the tool’s output.

Then review the results by document type, not only as one overall accuracy number. In our fictional inbox, correctly identifying ninety ordinary invoices would not compensate for repeatedly sending supplier statements into the new-invoice queue. Track at least:

  1. Wrong-route count: which documents entered the wrong work queue, and what would have happened next?
  2. Missed or held count: which legitimate files were left in review, and how much human work did that create?
  3. Confusion pairs: which types are mixed up—invoice versus statement, PO versus acknowledgment, credit memo versus invoice?
  4. Unknown handling: did unseen document types reach the review queue, or were they confidently mislabelled?

Google Cloud’s classifier guidance describes testing on documents kept out of training, and its evaluation documentation explains per-label precision and recall. Those metrics help diagnose a model, but the operating decision is simpler: is the error rate and review load acceptable for this specific next action? A label that merely opens a human review task can tolerate different mistakes from a label that starts a financial process.

When the answer is no, first inspect the class definitions and the confusing files. Better labels, a rule for a known sender, an explicit other path, or a narrower first scope may solve the problem more reliably than changing models.

Route the document; do not grant it authority

Once the type is known, pass the file, proposed class, source, and review reason to the appropriate queue. The next workflow still has to verify identity and business facts. An invoice label does not establish that the supplier is approved, the amount is correct, the invoice is new, or payment is authorized. An order-acknowledgment label does not approve a changed ship date.

This boundary matters because the most damaging classification error is often not a mislabeled folder. It is a wrong process starting without anyone noticing. If your current document flow already has several handoffs and system updates, the workflow automation service explains how KelenAI approaches those boundaries beyond the classifier itself.

If you receive only a few predictable files each week, keep human sorting or a simple rule. AI document classification becomes worth testing when varied incoming files cause meaningful delay or wrong handoffs, and you can show that a reviewed routing proposal improves the complete workflow.

Have a mixed inbox you are considering automating? Submit the workflow for a free consultation with the document types, approximate volume, and the mistakes your team currently has to catch. We will follow up with where we would start—and whether classification is actually the right first step.

Share:
Back to Insights

Related Posts

View All Posts »