Briefova

Home › Guides

How to automate invoice reminders with n8n

Last checked 2026-12-05. Steps follow n8n's published documentation; where we could not run something ourselves we say so.

Short answer: read your invoice list (a CSV or Google Sheet) once a day, work out how many days each unpaid invoice is past due, pick a reminder tier (for example 3 days before, then 1, 7, 14 and 30 days after), write the reminder text, and save it as a draft for you to send. Record which tier you already used so the same reminder is never drafted twice.

Chasing invoices is repetitive, easy to forget and slightly uncomfortable, which makes it a good automation target. It is also a place where a mistake is costly: a wrongly worded or duplicate reminder reaches a client. So the design below drafts reminders for review instead of sending them. This guide builds the workflow node by node in n8n. It assumes you can open the n8n editor and add nodes; no prior n8n experience with Code nodes is needed.

What you need

Step 1: a schedule trigger

Add a Schedule Trigger node set to run every day at 08:00. Set the workflow timezone in Workflow settings first (or set GENERIC_TIMEZONE on a self-hosted instance); otherwise "today" is calculated in the instance's default timezone and a reminder can fire a day early or late. For testing, also add a Manual Trigger and connect both triggers to the same next node, so you can click Execute workflow without waiting for 08:00.

Step 2: read the invoice list

For a CSV, use Read/Write Files from Disk (operation Read File(s) From Disk) followed by Extract From File (operation Extract From CSV). Each row becomes one n8n item. Two things trip people up here. First, on n8n 2.x file access is limited to the ~/.n8n-files folder by default, so put the file there (in the official Docker image that is /home/node/.n8n-files) or change N8N_RESTRICT_FILE_ACCESS_TO. Second, the first row of the CSV must be the header row, spelled exactly as above. For a Google Sheet, use the Google Sheets node (Get row(s) in sheet) instead; see Google Sheets credentials and permission errors for the credential setup.

Step 3: decide which reminder each invoice needs

Add a Code node (mode Run Once for All Items, language JavaScript). It skips invoices that are paid, void or disputed, computes days past due, finds the right tier, and drops invoices whose tier was already used:

const order = ['pre_due', 'd1', 'd7', 'd14', 'd30'];
const tiers = [                       // checked from the most overdue down
  { key: 'd30', days: 30 }, { key: 'd14', days: 14 },
  { key: 'd7', days: 7 },   { key: 'd1', days: 1 },
  { key: 'pre_due', days: -3 }
];
const today = new Date($now.toISODate() + 'T00:00:00Z');
const out = [];
for (const item of $input.all()) {
  const r = item.json;
  const status = String(r.status || '').trim().toLowerCase();
  if (['paid', 'void', 'disputed'].includes(status)) continue;
  const due = new Date(String(r.due_date).trim() + 'T00:00:00Z');
  if (isNaN(due)) continue;           // unreadable date: handle in a separate "problems" branch
  const daysOver = Math.round((today - due) / 86400000);
  const tier = tiers.find(t => daysOver >= t.days);
  if (!tier) continue;                // more than 3 days before the due date
  if (order.indexOf(String(r.last_reminder_tier || '').trim()) >= order.indexOf(tier.key)) continue;
  out.push({ json: { ...r, days_overdue: daysOver, tier: tier.key } });
}
return out;

Notes on the logic. The tiers are checked from the most overdue down, so an invoice 20 days late gets d14, not d1. Comparing positions in order means a tier fires once: after d7 is recorded, an invoice at day 8 is skipped until it reaches day 14. If the workflow was off for a week, a 9-day-late invoice jumps straight to d7 rather than sending every missed tier.

Step 4: write the reminder

Add a second Code node (or an Edit Fields node) that builds the subject and body from a template per tier. Keep the wording factual: invoice number, amount, due date, how to pay. A reasonable progression:

TierWhenToneWhat it says
pre_due3 days before dueHeads-upThe invoice is coming due, here is the link.
d11 day lateFriendlyProbably an oversight; invoice attached again.
d77 days latePolite but clearAsks for a payment date.
d1414 days lateFirmStates the amount outstanding and asks for payment or a reply this week.
d3030 days lateFinal notice, courteousSays you will pause work or follow your contract terms if unresolved.

Only mention late fees or pausing work if your contract says so. Reminder wording is not legal advice, and what you may charge depends on your contract and local law.

Step 5: output a draft, not a sent email

With Gmail credentials added, the Gmail node can create a draft (resource Draft, operation Create) addressed to client_email. Without credentials you can still use the workflow: write each reminder to a text file (Convert to File, then Read/Write Files from Disk Write File to Disk) and copy it into your mail client. Either way, a person presses send. Avoid the temptation to switch to a Send action until you have run the draft version for a few weeks and trust the output.

Step 6: remember what you drafted

Duplicate reminders are the failure that annoys clients most. After drafting, write the used tier back to last_reminder_tier. With Google Sheets, use Append or Update Row matching on invoice_id. With a CSV, the safest approach is to write a new file (for example invoices.next.csv) that you review and then use to replace the original, because n8n cannot edit a single cell in a CSV in place.

Common mistakes

Test before you trust it

Create a sample CSV with one invoice for each tier plus awkward rows: a paid invoice, a disputed one, a blank email, an amount like "n/a", and a date typed as 13/45/2027. Run the workflow with $now replaced by a fixed date in the Code node and check each result by hand. Then switch back to the real date.

Variations worth considering

When a reminder should not be sent at all

Automation does not know that a client called yesterday to say payment is coming Friday, that an invoice is in dispute, or that a client is in hospital. Keep a status value such as hold that the Code node treats like paid, and get into the habit of setting it the moment you have a conversation. Reading the day's drafts before pressing send is the second safety net; it takes about two minutes for a handful of invoices.

How to read the execution log when something looks wrong

Open Executions, click the run, and click each node to see its input and output items. If the Code node outputs nothing, check the input first: is due_date present under that exact name, or did the CSV header contain a hidden space or a byte-order mark? A header that looks like invoice_id but is really \ufeffinvoice_id will make that field "missing". Re-saving the CSV as plain UTF-8 fixes it. If the output has items but the draft is wrong, look at days_overdue and tier on the item, which show which branch of the logic was taken.

Sources

Invoice Reminder Kit

The kit below implements the workflow in this guide with test data, a setup guide and a test report.

See the kit · $19

n8n Starter Pack for Freelancers

Not ready to buy? The free starter pack has two working workflows, a scorecard and a credentials checklist so you can test n8n first.

Get the free pack

Related guides

N8n follow-up email automation (day 3 and day 7)

Build an n8n workflow that drafts day 3 and day 7 proposal follow-ups from a status table, skips replied clients, and records each nudge. Includes the Code node.

N8n Google Sheets credentials: setup and permission errors

Connect Google Sheets to n8n (managed or custom OAuth, or a service account) and fix 403 caller-does-not-have-permission, 404, quota and tab-name errors.

N8n Gmail trigger and credentials: setup and common errors

How to connect Gmail to n8n (managed OAuth on Cloud, custom OAuth when self-hosted), why tokens expire after seven days in Testing mode, and fixes for redirect_uri_mismatch and access denied.

Frequently asked questions

Should the workflow send reminders automatically?

We recommend drafts first. A wrong amount or a duplicate reminder reaches a real client, so keep a human send step until you have watched the output for several weeks.

Does this work without Gmail?

Yes. Read a CSV, write each reminder to a file, and copy it into your own email. Gmail or Sheets nodes are optional.

Why do reminders fire a day early?

Usually a timezone mismatch. Set the workflow timezone or GENERIC_TIMEZONE, and use ISO dates.