Create interactive bank expense reports from statements with OpenAI GPT-4o
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Nodes used (8)
- n8n Form Trigger
n8n-nodes-base.formTrigger - If
n8n-nodes-base.if - Extract from File
n8n-nodes-base.extractFromFile - Merge
n8n-nodes-base.merge - Code
n8n-nodes-base.code - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - n8n Form
n8n-nodes-base.form
What it does
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 1. Receives a bank statement file upload through an n8n Form trigger. 2. Detects whether the uploaded file is a PDF or CSV/text file and extracts its text accordingly. 3. Parses the raw statement text to normalize dates, amounts, and descriptions into a clean list of transactions and a deduplicated merchant list. 4. Sends the unique merchant list to OpenAI to assign each merchant a spending category and cleaned-up payee name. 5. Calculates spend and income totals, category breakdowns, month-by-month summaries, largest transactions, and repeating charges with annualized cost. 6. Sends the computed summary to OpenAI to generate a short commentary, observations, and questions to check. 7. Builds an HTML report (charts/tables, recurring charges, full transaction table, and CSV download) and returns it as the form response. Setup 1. Add an OpenAI API credential in the OpenAI Chat Model node (gpt-4o-mini) and ensure it is connected to both AI agents. 2. Activate the workflow and copy the production form URL from the Upload Statement trigger. 3. Upload a bank-exported CSV or a text-based (not scanned/image) PDF statement via the form to generate the report.