See llms.txt for all machine-readable content.

Back to Templates

Build weekly payment runs with Google Sheets and Gmail

Quick overview

This workflow runs every Thursday to build a weekly payment run by reading an invoice ledger and previous payment runs from Google Sheets, writing one decision row per invoice back to the Payment Runs tab, and emailing a plain-text summary via Gmail.

How it works

  1. Runs every Thursday morning on a schedule trigger.
  2. Reads all rows from the Ledger tab and the existing Payment Runs tab in the same Google Sheets spreadsheet.
  3. Evaluates each open invoice to decide whether to pay now, pay early for a discount, hold, request approval, flag data issues, or skip it because it was already proposed in a prior run.
  4. Stops with an error if the ledger is empty or required columns are missing, or stops quietly if there is nothing to record for the current window.
  5. Writes one row per decision into the Payment Runs tab using an upsert keyed by RunKey to avoid duplicates on reruns.
  6. Builds a plain-text summary including totals by currency and reasons for blocked invoices, then sends it to the configured approver email address via Gmail.

Setup

  1. Create a Google Sheets spreadsheet with a Ledger tab and a Payment Runs tab, and ensure the header names match the column names configured in the Set Ledger and Runs Config node.
  2. Add Google Sheets credentials with edit access to the spreadsheet and update ledgerSheetId (and tab names if different) in the Set Ledger and Runs Config node.
  3. Add Gmail credentials to send email and set approverEmail in the Set Ledger and Runs Config node, or remove the Gmail step if you only want the sheet output.
  4. Optionally adjust runWindowDays, approvalLimit, defaultCurrency, dateOrder, and runDate in the Set Ledger and Runs Config node to match your payment policy and date format.

Requirements

  • A Google Sheets credential with edit access to the spreadsheet, and a Gmail credential with send access.
  • No AI model, no API key and no paid service.
  • A Ledger tab and a Payment Runs tab with the column names set in the Set Ledger and Runs Config node.

Customization

  • Change the day or hour in the "Weekly Thursday Trigger" node.
  • Change runWindowDays: 3 for a short week, 14 for a two-week payment run.
  • Set approvalLimit to 0 to turn off the approval check.
  • Replace the Google Sheets write with Airtable, Notion or a database node.

Additional info

The workflow never moves money; the Payment Runs tab is a proposal. Totals are grouped per currency with no conversion. Bad rows are written with the status FIX DATA and a reason, and never counted in the total. A failed sheet write stops the run and sends no email. Contains no credentials and no real data.