I built a workflow that classifies invoices and sorts them into Google Drive folders automatically – so a finance team doesn't have to

:waving_hand: Hey n8n Community,

Last week I shared a workflow I built for a friend of mine (I called him Mike) to make sure he doesn’t end up paying the same invoice twice. After I helped him with that, he mentioned that his colleague in finance is constantly struggling with something else – and honestly, it sounded like the kind of problem that shouldn’t exist in 2026.

The Problem: The Folder Sorting Marathon

Mike’s company has a finance person (let’s call her Sarah) whose job involves – among other things – uploading invoices into Google Drive folders so their tax lawyer gets everything organized. Medical invoices go here. Hotel bills go there. Telecom stuff in a third folder. Restaurant receipts in another.

Every. Single. Invoice. Sorted. By. Hand.

Sarah told Mike she spends about an hour a week just dragging PDFs into the right folders. And the worst part? When she’s in a rush, things end up in the wrong place. Their tax lawyer then has to circle back and ask “why is a hotel bill in the medical folder?” – which makes the whole team look sloppy.

Mike asked me: “You built me that duplicate checker. Can you do something about this too?”

The Solution: Automatic Invoice Classification + Sorting

I wasn’t 100% sure this would work at first. The duplicate checker was about extracting data – invoice numbers, amounts. This was different. I needed the system to actually understand what kind of document it was looking at and make a decision. That’s classification, not extraction.

But I figured I’d give it a shot with the easybits Extractor, since it worked so well for Mike’s duplicate problem. And honestly? It worked better than I expected.

How it works:

  1. The Upload – Sarah opens a simple web form and uploads the invoice. PDF, PNG, JPEG – whatever she has.

  2. The Classification – The file gets sent to easybits, which reads the document and returns a category: medical_invoice, restaurant_invoice, hotel_invoice, trades_invoice, or telecom_invoice. If it doesn’t fit any of those, it returns null.

  3. The Confidence Score – This is the part I’m most proud of. Every classification comes back with a score between 0.0 and 1.0. A clear medical invoice from a doctor’s office? 1.0. A vague receipt that could be a restaurant or a hotel? Maybe 0.5.

  4. The Routing – If the confidence is high enough, the file goes straight into the matching Google Drive folder. If it’s low or the document doesn’t match any category, it lands in a “Needs Review” folder and Sarah gets a Slack message with the file name, the classification attempt, the confidence score, and a direct link to the file.

Why this actually works in practice:

The key was getting the prompts right. I spent some time writing really detailed classification instructions – not just “here are five categories, pick one,” but actual descriptions of what signals to look for in each type. What does the issuer look like? What are typical line items? What kind of tax breakdowns show up? The more specific I got, the more accurate the results.

The confidence scoring was tricky at first. I had it set up so that “no match” returned a 0.0 – but that’s wrong. If the system looks at a grocery store receipt and confidently says “this is none of the five categories,” that’s a sure decision. It should be a 1.0. Once I fixed that, the review queue stopped filling up with obvious non-matches.

Oh, and one thing that tripped me up: the original file disappears after the API call. The easybits node returns JSON, but the binary PDF is gone. I had to add a Merge node to recombine the classification result with the original upload. Small thing, but it’ll save you 20 minutes of debugging if you know about it going in.

Sarah’s opinion:

She’s been using it for a week now. Told Mike it went from an hour of sorting to “upload and forget.” The only things that hit her Slack are genuinely ambiguous documents – maybe two or three a week. Everything else lands in the right folder automatically.

I’ve attached the workflow JSON – import it and swap in your own easybits pipeline, Google Drive folders, and Slack channel. The sticky notes inside walk you through the full setup.

For anyone doing manual document sorting – how are you handling it today? Curious if there are other approaches out there.

Best,
Felix

Workflow JSON:

1 Like