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
- Receives a bank-statement CSV upload via an n8n form and extracts the file rows.
- Normalises each transaction (date, amount, merchant, direction, currency) and shows an error page if the CSV can’t be parsed.
- Loads your chart of accounts and keyword rules from Google Sheets and categorises matching transactions without AI.
- Sends remaining unmatched merchants to Google Gemini in batches to assign an allowed category plus confidence and a short reason.
- Merges rule-based and AI categories, estimates VAT by category, flags recurring payments and anomalies, and marks low-confidence items as needs_review.
- Appends or updates the enriched transactions in the Google Sheets Transactions tab and shows an on-screen summary of totals and review items.
- Every morning, converts any corrected_category entries into new Rules records and marks those Transactions rows as learned.
- 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
- Create credentials for Google Sheets, Google Gemini (PaLM) API, and Gmail.
- 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.
- Update the report recipient email, confidence/large-payment thresholds, and the error-alert recipient email in the relevant Set/Gmail nodes.
- Activate the workflow and use the generated n8n form URL to upload your bank CSV exports.