See llms.txt for all machine-readable content.

Back to Templates

Control invoice reminders and escalations with Google Sheets and Gmail

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

  1. Runs manually or on a weekday 09:00 schedule and loads a configuration that enforces safe test mode unless live sending is explicitly approved.
  2. Reads the Invoices and Reminder Log sheets from Google Sheets and combines them so each invoice can be evaluated against past reminder history.
  3. 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.
  4. Checks idempotency by looking for an existing InvoiceID+stage+date key in the Reminder Log and skips items that were already reserved or processed.
  5. 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.
  6. 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).
  7. 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

  1. 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).
  2. Add Google Sheets OAuth2 credentials in n8n and set the spreadsheet ID in all Google Sheets nodes (replace SET_SPREADSHEET_ID).
  3. Add Gmail OAuth2 credentials in n8n for sending reminders and escalations.
  4. 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.
  5. Review and adjust the timezone, weekday schedule time, reminder intervals, closed-status list, currency allowlist, and email text to match your collections policy.