Quick overview
This workflow accepts a bank statement upload (CSV or text-based PDF), parses transactions, uses OpenAI to categorize merchants and generate narrative insights, and returns an interactive HTML expense report with category totals, monthly breakdowns, recurring-charge detection, and a downloadable CSV.
How it works
- Receives a bank statement file upload through an n8n Form trigger.
- Detects whether the uploaded file is a PDF or CSV/text file and extracts its text accordingly.
- Parses the raw statement text to normalize dates, amounts, and descriptions into a clean list of transactions and a deduplicated merchant list.
- Sends the unique merchant list to OpenAI to assign each merchant a spending category and cleaned-up payee name.
- Calculates spend and income totals, category breakdowns, month-by-month summaries, largest transactions, and repeating charges with annualized cost.
- Sends the computed summary to OpenAI to generate a short commentary, observations, and questions to check.
- Builds an HTML report (charts/tables, recurring charges, full transaction table, and CSV download) and returns it as the form response.
Setup
- Add an OpenAI API credential in the OpenAI Chat Model node (gpt-4o-mini) and ensure it is connected to both AI agents.
- Activate the workflow and copy the production form URL from the Upload Statement trigger.
- Upload a bank-exported CSV or a text-based (not scanned/image) PDF statement via the form to generate the report.