# Invoice Chaser — n8n template

A Little Red Bot template (aiautomations.sg). A polite, persistent invoice-reminder machine that reads your invoice list from a Google Sheet every morning at nine, works out who's overdue, and sends the right reminder — friendly at 7 days, firmer at 14, final at 30 — then records what it sent so nobody gets nagged twice. Full playbook: [Automate your invoice chasing in one afternoon](https://aiautomations.sg/articles/automate-invoice-chasing).

## What it does

| Days overdue | Email that goes out |
|---|---|
| 7+ | Step 1 — friendly nudge, assumes good faith |
| 14+ | Step 2 — firmer, asks for a concrete payment date |
| 30+ | Step 3 — final notice with a 7-day deadline (no legal threats) |

Guardrails: invoices marked `Paid` are never emailed, nobody is re-reminded within 6 days (`MIN_DAYS_BETWEEN_REMINDERS`), and rows with a missing email or unreadable due date are skipped rather than guessed at. Every send is logged back into the sheet.

## Requirements

- n8n — self-hosted (Community Edition, free) or n8n Cloud.
- A Google account (Sheets + Gmail). If you don't use Gmail, swap the Gmail node for n8n's Send Email node with your SMTP.
- One Google Sheet, one tab named `Invoices`, columns in row 1 — exactly:
  `InvoiceNo | ClientName | Email | AmountSGD | DueDate | Status | LastReminded`
- Dates as `YYYY-MM-DD` (the code node also accepts `d/M/yyyy` and `d MMM yyyy`, interpreted in Asia/Singapore).

## Setup — 10 steps

1. **Create the sheet** with the columns above. Populate it with your real receivables; leave `LastReminded` empty.
2. **Import the workflow**: in n8n, Workflows → Import from file → pick `invoice-chaser-n8n.json`.
3. **Connect a Google Sheets credential** on the "Read invoices sheet" node (n8n walks you through OAuth).
4. **Reuse that credential** on the "Update LastReminded" node.
5. **Connect a Gmail credential** on the "Send reminder email" node — or replace it with an SMTP Send Email node.
6. **Paste your spreadsheet ID** into both Sheets nodes (replace `PASTE_YOUR_SPREADSHEET_ID_HERE`). The ID is the long string in the sheet URL between `/d/` and `/edit`.
7. **Edit the `BUSINESS` block** at the top of the Code node — company name, contact person, phone, payment instructions.
8. **Personalise the three email templates** in the same Code node. Keep the temperature range: warm → direct → firm.
9. **Test with your own email** in the sheet at ~10 days overdue: run the workflow manually, confirm the right template arrived and `LastReminded` was written back. Run it again immediately — nothing should send (the 6-day guard).
10. **Activate the schedule** (daily 09:00 Asia/Singapore). Watch the first week's run history.

## Customisation

- **Ladder timings** — edit `LADDER` in the Code node: `[{step:1,minDaysOverdue:7}, {step:2,minDaysOverdue:14}, {step:3,minDaysOverdue:30}]`.
- **Reminder spacing** — `MIN_DAYS_BETWEEN_REMINDERS` (default 6) keeps clients from getting two emails in the same week.
- **SMTP swap** — if you're not on Gmail, delete the Gmail node and add n8n's Send Email node; the input fields are the same (`{{ $json.Email }}`, `{{ $json.emailSubject }}`, `{{ $json.emailBody }}`).
- **CC your accounts person** — add a `cc` field on the send node.
- **Send time / timezone** — Schedule Trigger node → change the hour, or the workflow-level `Asia/Singapore` timezone in Settings.
- **Currency formatting** — the `sgd()` helper in the Code node uses `en-SG` and outputs `S$1,234.56`; edit it if you invoice in another currency.

## PDPA note

Client emails are personal data. Chasing invoices is using that data for the purpose it was collected (billing the work they engaged you for) — ordinary business use. Do NOT quietly copy these addresses into a marketing list; that's a different purpose needing separate consent. Restrict who can access the sheet, and clear old rows once claims are settled.

---

Free during launch, no sign-up. Provided as-is: test with your own email address before pointing it at clients. Corrections: hello@aiautomations.sg. Template version 1.0 — 11 Jul 2026.
