Automation Workflows
A collection of N8N workflows designed to automate complex tasks, integrate services, and streamline productivity. Each workflow is battle-tested and ready for deployment.
Workflow Statistics
Expense Processor With AI Entity Classification Agent
N8NExpense processor with multi-channel logic for business and personal expense processing
Why I Built This
Life as a small business owner is exceedingly busy.
Besides managing clients and projects, there's the monthly burden of gathering expenses: not only for my own business but also (sometimes) for clients.
Then there are the "personal" expenses accrued when working from home that are, in part, tax deductible.
Good record-keeping demands that these expenses be captured according to their nature and purpose but ... with SaaS subs, electricity bills, and .... toner .. things get overwhelming pretty quickly.
I built a couple of modules over the years for processing discrete entities like client and business expenses.
But ultimately I thought that unifying all of these workflows in one big chain made the most sense.
Thus after some iterations and lots of grunt work came about the "master" expense processor here-documented.
How It Works
This is a big 'ol branching workflow in N8N. The three routes are set by the user in the data intake form. Mine are personal (stuff I buy); business (things I buy that may be, or are in whole, business purchases); and shared purchases for the household. My wife gets copied on the latter!
As usual (for workflow builds) the trusty form is the data-ingesting means of choice.
I'm experimenting these days with conversational-form hybrids ( et al). Because: 1) nobody - not even me - enjoys filling out forms and 2) it just makes sense.
But for things that you really need to just work and work without fuss (like the things you rely upon to file your expenses on time) .... I played it safe and conventional.
The N8N form builder is robust if not the most beautiful interface. is a favorite of mine although their pricing, for non-enterprise customers, is tricky (it's either free, with no authentication, or business-appropriate).
Workflow Architecture
This is the "high level" architecture in N8N:
I currently have the AI agent here in a bit of weird position: the "if" filter that feeds into it checks if it's a shared expense (as in household).
That then pipes into the shared expense notifier (Gmail) while bypassing the other legs of the automation.
If you're paying for the inference why not use it, you may wonder?
For most, it would probably make sense to do exactly that - and write out the data to a database for good measure.
My reasoning: The expense manager that the email pipes the business expenses into (via mailhook) has its own document parsing engine that's probably far better than anything I could string together.
For my own bills .... I just do the old fashioned thing and cry over bank statements (manually) to see where I'm squandering money.
AI Agent Or Document Processing Thingy!?
There are two ways of skinning the cat of using some kind of AI tool to parse billing documents - or rather, two levels of sophistication.
Assuming that your billing docs arrive in the form of nicely packaged PDFs, the crude method is to just scrape off the text and then feed that into an AI agent.
This transformation works at the character analysis level. If you're using N8N, the PDF to text node (binary to text) will do something like that.
The other method is OCR or - in its more modern evolution - using vision language models to actually parse and attempt to understand the documents using computer vision (note: OCR and vision document processing are not the same technology!). This approach is, of course, the pricier one from an API charge standpoint. But it produces more reliable results.
Using Vision Language Models vs. Specialist Document Entity Parsers
The second and emerging distinction is between what kind of tool to use.
Named entity recognition (NER) and document processing is a vast business with enterprises and fintech providers running billions of routine billing documents through them every hour of the day.
Unsurprisingly the real workhorses of this stable - the type sold to businesses who really run these workflows by the bucketload - tend to be priced for enterprise. Pay as you go pricing models are thin on the ground at this tier.
The cheaper somewhat and more cheery approach (depending upon how well it works, of course) is to chance one's arm with the emergent combination of a vision LLM (these days, almost all of them) and a structured JSON schema to constrain the output.
Then, devise a structured prompt that tells the LLM what "things" you need to pluck out of the type of documents it will be getting. This is actually an advantage of using language models for this task as opposed to document processing engines which be more rigid in what kind of recognition logic they can support. You can ask an LLM to do just about anything including, in this case, do helpful things like add the ISO code of the billing entity to the output.
For instance, system prompt:
And constrain with this JSON schema:
The degree of success is dependent upon the model and the disadvantage relative to the specialist tools is using a jack of all trades.
But experience so far suggests that results tend to be "good enough" (the shortfall is mitigated against in practice by reprocessing nodes, human in the loop, etc).
Storage and Organization System
Once the invoices are processed and sorted I move them into the appropriate storage areas.
My accountants like me to keep my "stuff" together in a Google Drive share (as do I). So that's the "friendly" cloud storage destination to which the invoices and receipts reliably go.
However - the beauty of N8N (and automation generally) is that you can afford to be rather thorough.
As much as I love Google Drive (and Workspace), I don't depend upon it for long term archival storage - of the kind that the authorities require and which prudent business owners are therefore well-advised to adhere to.
For that, I go to object storage on the big cloud providers. Crossing the 't's of data compliance can be a burdensome headache. So being able to drop the documents into archival storage in the same workflow as they're placed in their "everyday" storage (and in a client-facing folder) is a huge win.
Use Cases
- Freelancers and Consultants: Streamlined business expense tracking for tax compliance - Small Businesses: Automated expense processing for teams and departments - Households: Shared expense tracking and budget management - Personal Finance: Comprehensive expense categorization and analysis