Paperwork that files itself

Sort bills from receipts automatically in n8n

The reading was never the problem. The sorting is, because it is the bit that never gets done, and an unsorted pile is why quarter-end takes a whole evening.

Build time
An afternoon
Difficulty
Intermediate
Template
8 nodes

What you need before you start

  • An n8n instance.
  • A finance inbox, or a label that everything financial ends up under.
  • An API key for any current model. The classifying step is cheap.
  • A month of real post to test against, not five examples you picked.

Nobody in a small business is short of documents. They are short of the twenty minutes it takes to work out which ones matter this week.

That is a sorting problem, not a reading problem, and sorting is the thing automation is unusually good at.

Three piles, and the third is the important one

Everything financial that arrives is one of:

  • Pay this. A bill, an invoice from a supplier, a demand. It has a date and it needs an action.
  • File this. A receipt, a payment confirmation, a statement. Money already moved.
  • None of the above. A quote, a marketing email dressed as an invoice, a delivery note, a letter from HMRC that is neither.

Most guides give you the first two and stop. The third pile is the one that decides whether this works, because a classifier will never say it does not know. It picks the nearest match with exactly the same confidence it uses on an obvious one, and without somewhere honest to put the odd ones out they end up spread through the first two.

Getting the categories right

The Text Classifier node takes a set of categories, each with a name and a description. The description is what the model actually reads, and vague descriptions are why classifiers appear unreliable.

Write them like you are explaining to a new member of staff who has never seen your post:

pay          A bill or supplier invoice we owe and have not paid.
             Has an amount due and usually a payment date or terms.

file         Proof that money already left: a card receipt, a payment
             confirmation, a paid invoice, a bank or card statement.

look         Anything else financial. Quotes, estimates, delivery notes,
             HMRC correspondence, chasers about invoices we have paid,
             and anything that mentions money but asks for no action.

That third description is doing real work. Listing the specific things you actually receive is far more effective than writing “other”, because “other” gives the model nothing to match against and it will keep guessing at the first two.

The build, eight nodes

1. Gmail Trigger. Poll your finance inbox or label every fifteen minutes.

2. Extract from File. Pull the text out of any PDF attachment. If there is no attachment, use the email body instead. A short Set node handling that gives you one text field either way, and everything after it stops caring which it was.

3. Text Classifier. Input the text, with your three categories. It routes each item down the matching output, so there is no parsing and nothing to break on a stray character.

Two options worth setting. Give it the subject line as well as the body, because subjects are often clearer than the document. And keep the input under a couple of thousand characters: the first page of a bill tells you it is a bill, and sending eleven pages costs more and classifies no better.

4, 5, 6. One Set node per branch. Each stamps the row with its category and the destination folder. Small and boring, and it keeps the Drive nodes from carrying branch logic.

7. Google Drive, Upload. Into Finance/pay/, Finance/filed/ or Finance/look/.

8. Google Sheets, Append. Every item, from every branch, into one sheet with a category column. One sheet rather than three, so you can look at a month in one place and spot the pattern of what it is getting wrong.

Read the third pile, weekly

Put a five minute job in the calendar. Open the look folder, see what is in it.

For the first month it will be busier than you expect, and that is the system working. Each thing in there is either a genuinely odd document, in which case fine, or a category description that needs a sentence adding, in which case you have just improved the classifier permanently.

After about six weeks it settles down to a handful a month and the review takes two minutes. That is the point at which you can stop thinking about it.

The one thing to add before you trust it

A due date on the pay pile.

Sorting a bill into the right folder is useful. Sorting it into the right folder and putting the due date on a row you can sort by is the thing that stops a late payment fee, and it costs one extra field on the extraction step.

Ask for due_date alongside supplier and total, and sort the sheet by it. If nothing else in this build survives contact with your actual business, keep that column.

What it is not for

It is not deciding what to pay. It routes documents into folders. Every payment is still a person looking at a bill and choosing.

It is not tax categorisation either. Working out what is deductible, what the VAT treatment is and which period something falls into is your accountant’s job, and a classifier confidently putting a purchase in the wrong box is not a mistake you find quickly. It sorts your post. That is all it does, and that is already the part that never gets done.

Published 28 August 2026. Written by the people who run this sort of thing for clients, on n8n, including our own lead pipeline.

Next in paperwork that files itself: The monthly summary that assembles itself. Or go back to all 4 in this category.

Questions about this build

What is the difference between a bill and a receipt, for filing?

A bill is money you owe and have not paid, so it needs an action and a date. A receipt is money already gone, so it needs filing and nothing else. Mixing them is why the pile is intimidating: half of it is a to-do list and half is an archive, and until they are separated the whole thing feels like work.

Can AI reliably classify documents?

Into a small number of clearly different categories, yes, and this is one of the things models are genuinely good at. What it will not do is tell you when it is unsure. It picks the closest category with the same confidence every time, which is why this build has an explicitly named category for things that are none of the above, and why that pile gets read rather than trusted.

Does n8n have a classifier node?

Yes. The Text Classifier node takes your input, a set of categories you define with a name and a description each, and routes each item down the matching output. It is the right tool here because the routing happens in the node rather than in an IF node reading a model's free text, which is fewer moving parts and one less place for a stray full stop to break things.

What happens to something it gets wrong?

It ends up in the wrong pile, which is why the categories are folders rather than actions. Nothing is paid, nothing is deleted and nothing is filed to HMRC on the strength of a classification. The cost of an error is somebody moving a file, and that is a cost worth accepting for not having to sort two hundred documents by hand.

Should the workflow pay anything automatically?

No. Approving a payment is a decision with money attached and a classifier has no business making it. Let it tell you a bill has arrived, what it is for and when it is due. A person clicks pay.

The next step

Stop losing leads.Let's fix it this week.

Tell us what keeps slipping and we'll scope something around it. You'll be talking to Max, who runs the work, not a sales team. Most clients are live within 48–72 hours of that first conversation.

30-day rolling retainers. No lock-in. Cancel anytime.