Quick Overview
This workflow collects a bank statement CSV and monthly budget via an n8n form, summarizes spending totals and top merchants, gets a structured budget review from Google Gemini, logs the result to Google Sheets, and emails a tailored report via Gmail based on whether you are over, on track, or under budget.
How it works
- Receives a form submission with the user’s email, monthly budget, and an uploaded bank/card statement CSV.
- Extracts transaction rows from the CSV and calculates total spend plus a top-spending-by-merchant summary.
- Sends only the aggregated totals and top merchants to Google Gemini to generate a structured budget review with status, overspend areas, savings opportunities, a summary, and a monthly plan.
- If Gemini fails to return a usable review, sends a failure email to the user with CSV formatting guidance.
- Formats the AI output into email-ready fields (including budget difference and bullet lists) and appends the review to a Google Sheets spreadsheet.
- Routes by budget status and sends a tailored Gmail message (over budget, on track, under budget, or a generic fallback) to the submitted email address.
Setup
- Add credentials for Google Gemini (PaLM) API, Google Sheets OAuth2, and Gmail OAuth2.
- Select the target Google Sheets spreadsheet and ensure it has a sheet/tab for appended rows (for example, “Budget Reviews”).
- Activate the form trigger and share the generated form URL so users can upload a CSV statement and enter their budget.