- Role
- Designed and built by me in n8n
- For
- Sole proprietors who know enough accounting to run their company
- Time
- A working day by hand, 10 to 20 minutes with it
- AI does
- LLM-based extraction into structured output: 11 fixed categories plus VAT
- Rules do
- Allowlist, ledger, income statement, VAT and tax, all rule-based
Problem
Owners of a sole proprietorship (enkeltmandsvirksomhed) do their own books. Most know enough accounting to get it right. What costs them is the time: every receipt has to be typed in, categorised and carried through to VAT, the income statement and the tax estimate. When I did the books at CACommunications, a round of bookkeeping took about a working day, 6 to 8 hours. With this workflow the same round takes 10 to 20 minutes, including checking the lines and entering the numbers with Skat.
What I built
An n8n workflow around a Google Sheets ledger. You send a mail in plain words, for example "bought printer paper 349 kr incl. VAT". The workflow first checks the sender against an allowlist, so only approved senders get through.
A language model (gpt-4o-mini) then does LLM-based extraction: it turns the mail into structured output, one line with year, description, amount, cash or credit, a category from a closed taxonomy of eleven, and whether VAT applies. The line is appended to the ledger. From there everything is rule-based: the spreadsheet's own formulas turn the ledger into the year's income statement, VAT and tax estimate, and the workflow mails the key totals back as a short summary.
The thinking behind it
This is a hybrid architecture: probabilistic where language has to be understood, deterministic where numbers have to be right. It is the main finding of my thesis put into practice: use AI only where its output is cheap to verify. The model does one job, turning a sentence into a category and an amount, and a person can check that in seconds per line. The sums, the VAT and the tax are rule-based spreadsheet logic that never guesses.
The taxonomy is closed on purpose. The model must pick one of eleven categories or "unknown", which works as a guardrail: a doubtful line is flagged for human-in-the-loop review instead of being silently misfiled.
Where it stands
It runs end to end. A mail in plain words becomes a ledger line, the income statement, VAT and tax update by themselves, and the totals come back by mail, without anyone opening the spreadsheet. It works on my own test transactions. What it needs now is fine-tuning.
What stays manual, and what is next
By design, anything marked "unknown" is sorted by a person, the access list is kept by hand, and filing VAT and tax returns stays with the business owner. The system prepares the numbers and never submits anything.
Next steps for a version others could rely on are reading PDF receipts as well as mail text, a short review step for low-confidence lines before they reach the ledger, and a larger test set to tune the categories against.

Example output
| Net revenue | 108,000 |
| Other operating expenses | (41,800) |
| Staff costs | (17,000) |
| EBITDA | 49,200 |
| Depreciation and amortisation | 0 |
| EBIT | 49,200 |
| Finance income | 640 |
| EBT | 49,840 |
| Income tax expense (AM-bidrag, 8%) | (3,987.20) |
| Net income | 45,852.80 |
| VAT payable (output VAT less input VAT) | 16,600 |
Income statement as the sheet calculates it, from a test run on made-up transactions. Amounts in DKK, all excluding VAT. Costs are in brackets.
Stack: n8n, OpenAI (gpt-4o-mini), Google Sheets, Gmail.
Code: On request.