Quick Overview
This workflow runs daily, reads unpaid invoices from Google Sheets, uses Google Gemini to draft stage-appropriate reminder emails, sends them via Gmail, optionally alerts a Slack finance channel for long-overdue invoices, and updates the invoice row with the latest reminder date.
How it works
- Runs every day at 09:00 on a schedule.
- Reads invoice rows from a Google Sheets “Invoices” sheet.
- Calculates how many days each invoice is overdue, how long since the last reminder, and assigns a reminder stage (gentle, firm, escalate) or skips if not due/too recent.
- Uses Google Gemini to generate a short reminder email body whose tone matches the assigned stage.
- Sends the reminder through Gmail with a subject line tailored to the stage.
- For “escalate” invoices, posts an alert to a Slack #finance channel after sending the final notice.
- Updates the invoice record in Google Sheets to stamp the latest reminder details so the sequence can continue on the next run.
Setup
- Connect credentials for Google Sheets, Google Gemini (PaLM) API, Gmail, and Slack.
- Select your Google Sheets spreadsheet and the “Invoices” sheet in both the read and update steps.
- Ensure your sheet contains the columns used by the workflow (Invoice No, Client, Contact Email, Amount, Due Date, and Last Reminder) and that dates are stored in a consistent, parseable format.
- Choose the Slack channel (for example, #finance) where escalation alerts should be posted.
- Adjust the overdue thresholds and the minimum days-between-reminders logic in the overdue calculation step if your collection policy differs.