Invoice automation in n8n: chasing overdue invoices without the awkwardness
The most useful invoice automation in n8n is chasing late payments: keep invoices in a Google Sheet, run a Schedule Trigger each weekday, find unpaid rows past their due date, and send each client a reminder through the Gmail node. Record the reminder date and count back in the sheet so nobody gets chased too often. Creating invoices or reading supplier invoices are separate jobs with different tools.
Buy for $15 AI Automation Starter Pack for n8n — 8 ready-to-import workflows · $15
Three different invoice jobs
| Job | Typical n8n approach |
|---|---|
| Chase overdue invoices you sent | Google Sheets, Code, IF, Gmail, update the row |
| Create invoice PDFs | An invoice app or a PDF API called with HTTP Request |
| Read incoming supplier invoices | Gmail attachments, then OCR or a data extraction API |
Sheet for reminders
One row per invoice. These headers are what our workflow 06 expects; you can add your own columns.
invoice_id | client_name | client_email | amount | currency | due_date | status | last_reminder_date | reminder_count
The date logic in a Code node
This is the heart of it: skip paid rows, wait a few grace days, space reminders out and stop after a maximum.
const cfg = $('Config').first().json;
const today = new Date();
const days = (a, b) => Math.floor((a - b) / 86400000);
return $input.all().filter(item => {
const r = item.json;
if (['paid', 'cancelled', 'void'].includes(String(r.status).toLowerCase())) return false;
const overdue = days(today, new Date(r.due_date));
const sinceLast = r.last_reminder_date ? days(today, new Date(r.last_reminder_date)) : 999;
return overdue >= cfg.graceDays
&& sinceLast >= cfg.minDaysBetweenReminders
&& Number(r.reminder_count || 0) < cfg.maxReminders;
});
Rules that keep clients friendly
- Start polite and get firmer: friendly, then clear, then final.
- Put payment details in every email so paying takes one click.
- Send from your own Gmail, not a no-reply address, so clients can answer.
- Test on yourself first. Mark paid invoices as paid the same day.
Workflow 06 in the starter pack
It runs weekdays at 10:00, finds overdue unpaid invoices, has your AI provider write a reminder in the right tone for that reminder number, sends it with Gmail and updates the row. Settings live in Config: graceDays (default 1), minDaysBetweenReminders (7), maxReminders (3), paymentInstructions and dateFormat. testMode is on by default, so every reminder goes to you with the real recipient in the subject and the sheet stays untouched.
Tested end to end on n8n 2.49.9 with local test copies of Gmail and Sheets; real Gmail sign-in, real AI providers and n8n Cloud weren't tested. You need your own AI key and Google account.
The product
Questions
Does it create the invoices too?
No. It chases invoices you have already sent. Make them in your accounting tool or a free invoice maker and add a row to the sheet.
Can it stop when a client pays?
Yes, once you set the status to paid. It does not watch your bank account.
Can I skip the AI and use a fixed template?
Yes. Replace the AI step with a Code node that fills in a fixed text per reminder number.
Related
Updated 2026-12-01