See llms.txt for all machine-readable content.

Back to Templates

Email a weekly 13-week cash flow forecast with Google Sheets and Gmail

Quick overview

This workflow runs every Monday and reads bank balances and expected cash items from Google Sheets to calculate a 13-week cash flow forecast, update a Forecast tab, and send an HTML report via Gmail highlighting low-cash weeks, past-due items, and data issues.

How it works

  1. Runs every Monday at 7:00 AM based on the schedule trigger.
  2. Loads the Google Sheets URL, email recipient, minimum cash balance, currency code, and company name used for the report.
  3. Reads the latest bank balance from the “Bank Balance” tab and all expected inflow/outflow items from the “Cash Items” tab in Google Sheets.
  4. Calculates a 13-week (Monday–Sunday) forecast by expanding recurring items, rolling past-due one-off items into week 1, and computing weekly opening/closing balances while flagging weeks below the minimum cash level.
  5. Writes the weekly forecast rows back to the “Forecast” tab in Google Sheets by matching on the Week value (W01–W13).
  6. Builds an HTML email summary (including warnings, a 13-week table, and the largest upcoming items) and sends it to the configured recipient using Gmail.

Setup

  1. Create a Google Sheet with tabs named “Bank Balance”, “Cash Items”, and “Forecast”, using headers that match the fields referenced in the workflow (for example: Bank Balance: Date, Balance; Cash Items: Type, Category, Description, Amount, Expected Date, Repeat).
  2. Add Google Sheets OAuth credentials in n8n and replace the spreadsheet URL plus company/currency/minimum cash/recipient values in the forecast settings.
  3. Add a Gmail OAuth credential for the account that sends the email report.
  4. Populate the Bank Balance tab with at least one valid Date and Balance row, and add Cash Items with Type (Inflow/Outflow), Amount, Expected Date, and optional Repeat values (blank/Weekly/Biweekly/Monthly/Quarterly).