Quick overview
This workflow runs on weekdays and reads invoice and reminder-ledger data from Google Sheets, decides whether to send customer follow-ups or finance escalations, sends emails via Gmail in safe test mode by default, and appends an audit trail back to Google Sheets.
How it works
- Runs manually or on a weekday 09:00 schedule and loads a configuration that enforces safe test mode unless live sending is explicitly approved.
- Reads the Invoices and Reminder Log sheets from Google Sheets and combines them so each invoice can be evaluated against past reminder history.
- Validates each invoice (IDs, due dates, amounts, currencies, statuses, and email fields) and computes the follow-up stage (due soon, overdue, or escalate) with snooze and minimum-interval rules.
- Checks idempotency by looking for an existing InvoiceID+stage+date key in the Reminder Log and skips items that were already reserved or processed.
- Routes eligible items to either a customer reminder path, a finance escalation path, or an exception/hold path that records the issue without sending email.
- Reserves reminder or escalation actions by appending a “RESERVED” entry to the Reminder Log in Google Sheets, then sends the corresponding Gmail message (to a test inbox unless live sending is enabled).
- Appends the final decision (sent, escalated, skipped, hold, or data error) with the reason and idempotency key to the Reminder Log for audit and future runs.
Setup
- Create a Google Sheets spreadsheet with an Invoices tab and a Reminder Log tab containing the required columns (for example InvoiceID, CustomerEmail, AmountDue, Currency, DueDate, Status, ManualHold, LastReminderStage, LastReminderAt, NextFollowUpDate, and IdempotencyKey).
- Add Google Sheets OAuth2 credentials in n8n and set the spreadsheet ID in all Google Sheets nodes (replace SET_SPREADSHEET_ID).
- Add Gmail OAuth2 credentials in n8n for sending reminders and escalations.
- Update the configuration values for SET_TEST_EMAIL and SET_FINANCE_EMAIL, keep testMode=true for initial testing, and only set testMode=false plus liveSendApproved=true when you are ready to send to real recipients.
- Review and adjust the timezone, weekday schedule time, reminder intervals, closed-status list, currency allowlist, and email text to match your collections policy.