How I automated my entire invoicing workflow
From Northwind's timesheet to a sent invoice with no manual steps — a six-week project I should have done years ago.
By Awadesh Madhogaria · Published Jul 4, 2025
Invoicing is how Northwind gets paid, which makes it strange that I left it as a manual chore for two years. Every month it ate an afternoon, and every month I told myself I’d fix it later.
The old routine was a long chain of small steps: pull hours from Toggl, paste them into a Doc, format it, export a PDF, attach it to an email, send it, then mark it sent in a tracker. About three hours, every month. None of those steps was difficult — the cost was that there were so many of them, every one a chance to make a small mistake. Hours occasionally got pasted into the wrong client’s invoice, formatting drifted so no two invoices looked quite the same, and once or twice I simply forgot to mark one as sent and chased a paid invoice.
When I finally fixed it, the project ran six weeks — most of it not coding. This is the automation I should have built years earlier.
How it works
Now a function runs on the 1st of every month: 30 seconds, no clicks. The whole
month’s invoices go out before I’ve finished my first coffee, every one
formatted identically and logged automatically. The pieces behind it are a
Hours sheet that auto-imports from Toggl via
their API, a Doc
template with merge tokens, and a script that ties them together:
- A time-based trigger fires on the 1st of every month.
- The script reads each client’s hours from the
Hourssheet. - For each client, it copies the Doc template and replaces the merge tokens with that client’s numbers.
- It exports the finished Doc to PDF.
- It emails the client with the PDF attached.
- It writes the invoice number and date back to the tracker.
Total runtime is about 30 seconds, and I don’t click anything. Because the same script that sends is the one that updates the tracker, nothing gets forgotten.
What surprised me
The hardest part wasn’t code — it was deciding what the canonical invoice number format was. I’d been inconsistent for two years, and before I could automate anything I had to make decisions I’d been avoiding: one numbering scheme applied to every client forever, a single template so old and new invoices finally matched, and a clear rule for what happens on a month with zero billable hours.
Automation forced the consistency I should have had all along. That cleanup was worth as much as the time saved — sometimes the real value of automating isn’t the time itself, it’s that writing the script forces you to finally decide the rules you’d been fudging for years.
Was it worth it
Plainly, yes:
- Three hours a month became 30 seconds — and zero of my attention.
- Every invoice now looks identical and is numbered consistently.
- Nothing gets forgotten, because the tracker is updated by the same script that sends.
If you want the sending side as a standalone build, I walk through it in Send recurring invoice emails on the first.