See llms.txt for all machine-readable content.

Back to Templates

Categorise bank transactions and email monthly P&L with Gemini and Google Sheets

Quick Overview

This workflow categorises uploaded bank-statement CSV transactions using Google Sheets rules and Google Gemini, saves enriched rows to Google Sheets with VAT and review flags, learns new rules from your corrections daily, and emails a monthly P&L summary via Gmail.

How it works

  1. Receives a bank-statement CSV upload via an n8n form and extracts the file rows.
  2. Normalises each transaction (date, amount, merchant, direction, currency) and shows an error page if the CSV can’t be parsed.
  3. Loads your chart of accounts and keyword rules from Google Sheets and categorises matching transactions without AI.
  4. Sends remaining unmatched merchants to Google Gemini in batches to assign an allowed category plus confidence and a short reason.
  5. Merges rule-based and AI categories, estimates VAT by category, flags recurring payments and anomalies, and marks low-confidence items as needs_review.
  6. Appends or updates the enriched transactions in the Google Sheets Transactions tab and shows an on-screen summary of totals and review items.
  7. Every morning, converts any corrected_category entries into new Rules records and marks those Transactions rows as learned.
  8. On the 1st of each month, builds a month-over-month P&L from Google Sheets, generates brief commentary with Google Gemini, and emails the report via Gmail.

Setup

  1. Create credentials for Google Sheets, Google Gemini (PaLM) API, and Gmail.
  2. Create a Google Sheets file with Categories, Rules, and Transactions tabs (including columns like corrected_category and rule_added) and set its Sheet ID in the workflow’s settings nodes.
  3. Update the report recipient email, confidence/large-payment thresholds, and the error-alert recipient email in the relevant Set/Gmail nodes.
  4. Activate the workflow and use the generated n8n form URL to upload your bank CSV exports.