- Role
- Designed and built by me in n8n
- For
- Sole proprietors who know enough accounting to run their company
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. Tested on the same books, the round took 10 to 20 minutes with this workflow, 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 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.
Controls built into the ledger
The sheet checks its own input before anything reaches a total. A duplicate check marks any line that repeats another as a possible duplicate, and on the test data it caught 18. A category check sends anything outside the eleven categories to "unknown" for a person to sort. VAT is kept in its own column, so every total is net and input VAT is never deducted twice. The income statement and the VAT figures are both calculated from the same ledger lines, so they reconcile by construction.
Accounting treatment
All figures are net of VAT. Output VAT on sales and input VAT on purchases are tracked separately, and only costs with deductible VAT carry input VAT. The rest are booked gross. The tax line is AM-bidrag at 8 percent: at this level of income the profit is below the personfradrag, so no income tax falls due yet. Filing stays with the owner, who enters the VAT figures in the momsangivelse on Skat.
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 has been tested on the bookkeeping at CACommunications. 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.

Income statement
| 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 |
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.
VAT return (momsangivelse)
| Output VAT on sales (salgsmoms) | 27,000 |
| Input VAT on purchases (købsmoms) | (10,400) |
| VAT payable | 16,600 |
The same test run, set out the way the figures go into Skat's VAT return. Amounts in DKK.
Stack: n8n, OpenAI (gpt-4o-mini), Google Sheets, Gmail.
Code: On request.