30% of a solo accountant's week goes to AR and invoicing. This agent monitors your overdue invoices, ranks them by risk, and writes the reminder emails — automatically.
This is a personal, non-commercial side project I built to learn — not a product or service, and not connected to any company I work with.
In Post #3, I showed you the time breakdown of a typical solo accountant in a 50-person company. The biggest single category — 30% of the week — is invoicing and accounts receivable.
That's 12 hours every week spent on: checking which invoices are overdue, figuring out who to chase, writing reminder emails, following up again when there's no response. Manually. Repeatedly. Every single week.
"The highest-value work — forecasting, scenario analysis, proactive cash management — gets 5% of the time. Because the other 95% is already spoken for."
This is what the Overdue Invoice Agent addresses. It doesn't replace the accountant. It takes the 30% that doesn't require judgment — and handles it automatically.
| # | Invoice | Client | Amount | Overdue | Status | Risk Score |
|---|---|---|---|---|---|---|
| 1 | INV-003 | Gamma s.r.o. | €31,000 | 81 days | Critical | |
| 2 | INV-007 | Eta Solutions | €22,000 | 97 days | Critical | |
| 3 | INV-005 | Epsilon Ltd | €15,000 | 10 days | Watch | |
| 4 | INV-001 | Acme Corp | €12,500 | 64 days | Critical | |
| 5 | INV-004 | Delta AG | €8,200 | 25 days | Warning | |
| 6 | INV-006 | Zeta Corp | €6,400 | 7 days | Watch | |
| 7 | INV-002 | Beta GmbH | €4,800 | 45 days | Warning | |
| 8 | INV-008 | Theta GmbH | €3,200 | 3 days | Watch |
Dear Gamma s.r.o. finance team,
I am writing regarding Invoice INV-003 for €31,000, originally due on March 15, 2026 — now 81 days past the payment date. Despite previous correspondence, this invoice remains outstanding.
At this stage, we require either immediate payment in full or a confirmed payment commitment with a specific date by end of business this Friday. Please treat this as urgent.
Please transfer payment to our bank account on file or contact me directly at [YOUR PHONE / EMAIL] to discuss payment arrangements.
We value our relationship with Gamma s.r.o. and would like to resolve this matter without further escalation.
# Clone the repository git clone https://github.com/LuliBobo/cfo-agents.git cd cfo-agents # Install the two required packages pip install -r requirements.txt
# Edit this file with your real invoices invoice_id,client,amount_eur,due_date,contact_email,status INV-001,Acme Corp,12500,2026-04-01,finance@acmecorp.com,unpaid INV-002,Beta GmbH,4800,2026-04-20,ap@betagmbh.de,unpaid INV-003,Your Client,31000,2026-03-15,billing@client.com,unpaid
# Copy the template and fill in your values cp .env.example .env # .env file contents: GEMINI_API_KEY=your_key_from_aistudio.google.com SENDER_EMAIL=your@gmail.com SENDER_PASSWORD=your_gmail_app_password RECIPIENT_EMAIL=accountant@yourcompany.com COMPANY_NAME=Your Company Name
# Run it manually first to test python invoice_agent.py # You'll see output like this: ══════════════════════════════════════════════════════ Invoice Agent — Overdue AR Monitor 2026-06-05 07:00 ══════════════════════════════════════════════════════ [Step 1] Pulling invoice data from: data/invoices.csv ✓ Loaded 8 invoices [Step 2] Detecting overdue invoices... ✓ Found 8 overdue invoices [CRITICAL] INV-003 — Gamma s.r.o. — €31,000 — 81d overdue [CRITICAL] INV-007 — Eta Solutions — €22,000 — 97d overdue [Step 3] Prioritizing by financial risk... [Step 4] Generating AI reminder emails... ✓ Generated reminder for Gamma s.r.o. [Step 5] Delivering report... ✓ Report sent to accountant@yourcompany.com
on: schedule: - cron: '0 7 * * 1' # Every Monday 7:00 AM UTC workflow_dispatch: # Or run manually from GitHub # Add your secrets in GitHub: # Settings → Secrets → GEMINI_API_KEY, SENDER_EMAIL, ...
A simple CSV file with your invoice data. Export it from any accounting system or keep it as a Google Sheet.
invoices.csv → Python
Google Gemini writes the reminder emails. Free tier handles weekly runs without any cost.
gemini-2.0-flash
GitHub Actions runs the agent every Monday morning. No server, no infrastructure, completely free.
cron: '0 7 * * 1'
One email to your accountant with the full report and all draft reminders ready to review and send.
Gmail SMTP
The complete Invoice Agent is in the same repository as the CFO Report Agent from Post #2. Clone it once — get both agents.
Post #4 moves to a different process entirely — cash visibility instead of invoicing — and covers the specific tasks that, in my experience, make sense to automate first, and why the order matters more than the tools themselves.
No spam. One post per week. Unsubscribe any time.