I Built an AI Agent That Changed How I Handle My Finances
I used to save invoices by hand and always forgot something. Now an AI agent handles them the moment they hit my inbox.
One of my readers reached out with a familiar problem. As a consultant, he takes pictures of all his receipts, sends them to his business Gmail, then manually saves each one to a Google Drive folder, renames the file, and finally links it into a spreadsheet where he types in the date, activity, amount, and other details.
Sound familiar?
If you’re nodding along, whether you’re tracking client invoices, business expenses, subscription bills, or vendor receipts, you know this tedious dance.
It’s not complicated work, but it’s the kind of manual task that eats up time and always seems to fall through the cracks when you’re busy.
So I built an AI agent that does all of it for you.
What this system does
You (or anyone on your team) email financial documents (invoices, receipts, bills) to a designated email address. They can be PDFs or images you snap on your phone.
Then, the automation:
Watches your inbox for emails matching your rules (specific senders, subject line keywords like “invoice” or “receipt”, attachments present)
Extracts the document whether it’s a PDF or an image
Reads it with AI to pull out the important details: invoice number, issue date, due date, sender/company name, amount, currency, and description
Uploads it to Google Drive with smart naming (like 11-2025_Invoice-1234.pdf using month-year plus the original filename), so everything is organised and easy to find
Logs everything in Google Sheets with all the extracted fields plus a direct link to the file in Drive
Sends you a confirmation email so you know it’s done
And just like that, your receipts and invoices are automatically filed.
No manual data entry. No forgetting to log an expense. No digging through email attachments three months later trying to find that one receipt.
When this financial workflow helps
When expenses come from everywhere and everyone
Events, NGOs, logistic-heavy teams, schools, operational departments. Everyone buys small things throughout the month. Taxi. Hardware store. Grocery runs. Printer ink. A random tool someone needed on-site.
Half of these receipts arrive late, some arrive as blurry phone photos, others never arrive at all. Accounting ends up playing detective.
When email is the dumping ground
Your inbox fills with invoices with random file names like scan00123.jpg, IMG_4920.jpeg, or no name at all. You save them manually. Rename them manually. File them manually. Eventually something gets lost.
When you’re a consultant or freelancer
You rely on clean documentation for invoicing, taxes, and budgets. But admin eats time, and every missed receipt turns into a small headache later.
When you run a small business
Bills from vendors, SaaS tools, deliveries, utilities, marketplaces. You can’t afford to misplace something, and you can’t chase your team for it either.
For all these cases, this financial workflow solves the boring part (that part nobody wants to think about) and makes it impossible to lose anything.
But this workflow is only one piece of a much larger shift in how I’m running my business, and it’s the part I didn’t see coming until I started building these systems.
The bigger picture: how the background systems end up making the biggest difference
Ted came to me because his manual workflow was eating time he couldn’t afford and I realised I was dealing with the same thing in my own business.
I kept telling myself I’d organise everything later, and “later” usually meant digging through emails at the end of the month, trying to remember what each file was and where it should go. It’s a small thing, but it adds friction, and friction compounds.
There’s this layer of tasks that lives in every business. They’re not hard, they’re not interesting, but they’re constant.
None of these things look like they matter when you look at them individually, but they interrupt you, they break focus, and they take hours you never planned to spend.
At some point I realised I didn’t want to run my business with all these small pieces sitting in my head, so I started building systems to take over more of the routine work.
And once I began, it snowballed.
Because every bit of time I save goes back into the work that actually matters. And that’s where the real payoff is.
And this invoice system sits right at the foundation of a lot more you can build on top of it.
How far you can take this
The version I’m giving you already works out-of-the-box. It reads PDFs and images, stores them properly, extracts all the info, and logs them in a sheet.
But the real value is that this is just the backbone. You can layer anything on top of it.
Here are a few directions you could take it if you want to adapt it to your business:
Route different documents to different places: Invoices from vendor A can go into one Drive folder. Receipts under 50 dollars to another. Team expenses to a third.
Swap Gmail for something else: Use Slack uploads instead of email. Or even WhatsApp or Telegram. Or a shared Google Drive upload folder. The entry point can be whatever your team already uses.
Connect it to your accounting or finance tools: Send the extracted data straight into your accounting system. No manual handoff.
Trigger approval flows: High-value invoices could notify a manager first. Or get routed into a different spreadsheet until they’re approved.
Send notifications to where your team lives: Slack messages, email confirmations for vendors, or alerts to the finance channel.
Build monthly summaries: Automatic reports on spend per category, per person, per vendor.
Match invoices with payments: Sync with Stripe or PayPal logs for reconciliation.
A custom version makes sense when you want something tailored to your business. And if you need help, let’s jump on a call.
But for now, let’s solve this one.
Everything you need to build this system
I’m giving you everything you need to set this up yourself:
the JSON files for the three n8n workflows, plus all the prompts that make the agent work
a spreadsheet template you can copy
step-by-step guides to connect all the tools this workflow needs
a walkthrough on how to customise it so it fits the way you work
Once your accounts are connected, the whole setup takes only a couple of minutes.
Set up the invoice-tracking system in a few minutes
Here’s everything you need to get the AI agent running. The whole setup takes a few minutes once your accounts are connected.
Create your n8n account
Go to n8n.io and sign up or log in.
Connect the tools the automation needs
If this is the first workflow you build, you’ll need to connect n8n to your Google and OpenAI accounts so the agent can read emails, store files, and extract data.
Follow these guides to set everything up:
Download the three workflow JSON files:
You’ll import these into n8n by creating a new workflow, then clicking the three dots in the top right corner and selecting Import from File. Upload one of the JSON files, save it, and repeat the same steps until all three workflows are added.
Smart Invoice Filing & Tracking.json (the main workflow that handles everything)
Document processing.json (processes PDFs and extracts their data)
Image processing.json (processes images and extracts their data)
Prepare your Google Sheet
This is where all the extracted data will go.
Make a copy of my Spreadsheet template and clear the example rows. The AI agent will write into this sheet every time a new document is processed.
Let’s make the system work for you
We’ll go workflow by workflow, and inside each one we’ll walk through the nodes step by step so you can set everything up without guessing.
1. Smart Invoice Filing & Tracking
This is the main workflow. It receives the incoming emails, decides what the attachment is, and sends it to the right place.
Gmail Trigger node
Select your Google credentials
Choose the Google credentials you created earlier when you connected n8n to your Google account. If you haven’t set them up yet, click Create new credentials, choose OAuth2, and sign in to your Google account.
Customise the filters
This is where you decide which emails the workflow should pay attention to.
Search:
I’m currently using: has:attachment
subject:(invoice OR bills OR finance OR receipt OR receipts)
This tells the automation to only look at emails that have attachments and match the keywords I care about. You can add more or change them depending on your workflow.
Sender (optional)
You can choose to track emails only from specific senders.
For example, I track invoices sent by my accountant and by myself, but you can add anyone: team members, vendors, partners, etc.
Leave the other settings as they are.
You don’t need to change anything there.
AI Agent node
This is the part that decides what happens with each email.
It checks whether the attachment is a PDF or an image and sends it to the correct workflow:
PDFs go to Document processing
Images go to Image processing
You already imported both of these workflows earlier. The prompt inside the agent is pre-written, so you don’t need to change anything unless you want to adjust the system message.
To set it up:
Open the OpenAI Chat Model node
Select the OpenAI credential you created earlier (the one with your API key).
Connect the Document Processing workflow
Double-click the node and pick your Document Processing workflow from the Workflow dropdown list.
Connect the Image Processing workflow
Do the same: double-click the node and select your Image Processing workflow.
Window Buffer Memory node
No changes needed here. It keeps a short memory (5 processed emails), which is more than enough for this system.
Send Email Confirmation node
Select your email credentials
Choose the same Google credentials you used earlier.
Choose where the confirmation email goes
You can hardcode your own email address as I did, or you can make the system send confirmations back to whoever sent the original email.
This is useful when multiple people on your team are using it so you know who submitted each document. Use this expression if you want that:
{{ $(’Gmail Trigger’).item.json.from.value[0].address }}
Edit the subject and message
Right now it simply tells me the document has been processed.
You can customise the message if you’d like.
This is what the confirmation email looks like when everything is set up:
2. Document Processing
This workflow handles PDFs. It extracts the text, pulls the invoice data, uploads the file, and logs everything in Sheets.
We’ll go node by node.
Download PDF from email node
Select your Google credentials from the dropdown. Leave all the other settings as they are.
Extract info from PDF node
Nothing to change here. This node simply takes the downloaded PDF and extracts all the text and information inside it.
Organize extracted info node
Select your OpenAI credentials again. Keep everything else as it is.
Merge node
No changes needed. This node combines the extracted PDF data and the original downloaded file. We need both so we can upload the PDF to Drive and also pass the invoice information into Sheets.
Upload PDF to Drive node
This is the node that uploads the file to your Google Drive and renames it.
What you need to do:
select your Google credentials
choose your Drive from the “Parent Drive” dropdown
choose the folder where you want all invoices to be saved
By default, the File Name field takes the original filename from the email and adds the month and year in front of it, like: “12-2025_Invoice123.pdf”
You can change this expression if you want a different naming format.
Pass through node
No changes needed. This node simply passes the extracted invoice info to the next step, where we add everything to Sheets.
Join for Sheets node
This merge node combines the Drive file (so we can add its link to the spreadsheet) and all the invoice details extracted earlier. No need to change anything here.
Upload data in Sheets node
Here’s what you need to set:
Select your Google credentials.
Select the spreadsheet you want to use. Make a copy of the template I gave you and choose that one.
Select the specific sheet inside it.
If you rename any columns in the spreadsheet, you must refresh the columns in this node. Click the refresh icon in the Values to Send field.
The expressions for each column should not be changed, they ensure the correct data is written into the correct fields.
3. Image Processing
This workflow does the same thing but for images. It reads the image, extracts the text, grabs all the details, saves the file, and logs it.
Since most of the setup is identical, there’s no need to go node by node again. The only real difference is that this workflow uses Extract text from image (an OpenAI node) instead of the “Extract from file” node we used in the PDF workflow.
Everything else follows the same pattern:
connect your Google credentials for Gmail, Drive, and Sheets
connect your OpenAI credentials to the two AI nodes
select the correct Drive folder where you want the images to be stored
select the same spreadsheet (or a different one if you want images tracked separately)
Once you connect the credentials and pick the right destinations, the workflow will run exactly like the PDF one - it reads the image, extracts the info, uploads the file to Drive, and writes everything into Sheets.
When you’re done, save all three workflows so your changes are stored, then turn them active. From that moment on, they’ll start tracking incoming emails.
Your workflow is ready
Once everything is active, you have a system that takes over a part of your operations you probably never enjoyed doing in the first place. It files your invoices, names them properly, extracts the right details, and keeps everything organised without you having to remember a thing.
This is the kind of work that doesn’t feel exciting while you set it up, but the moment it runs on its own, you notice the difference. Your inbox feels lighter. Your accounting becomes cleaner. You stop postponing small tasks because the system handles them the moment they arrive.
If you want to take this further or adapt it to fit how your business works, I’m happy to help. But even on its own, this workflow gives you back time, clarity, and fewer things to keep in your head, which is exactly why I built it in the first place.
Now that everything’s ready, send yourself a quick test email and watch the whole system run.


























Oooh…going to see if this will work if I feed it a credit card statement full of random expenses! 🤞😆