Track expenses via chat with Claude Haiku and Google Sheets

Go to Workflow
0 views
Built by Nirav Gajera Nirav Gajera
Created on June 05, 2026

Description

๐Ÿ’ฐ AI Expense Tracker โ€” Chat to Track Spending Instantly

Track your expenses by chatting naturally. No forms, no apps โ€” just type and it's saved.

๐Ÿ“– Description

This workflow turns a simple chat interface into a powerful personal expense tracker. Just describe your spending in plain language โ€” the AI understands it, categorizes it, and saves it to Google Sheets automatically.

Example inputs the AI understands:
spent 500 on lunch
uber 150
paid 1200 electricity bill
lunch in feb 25 cost 500 โ† handles past dates too
netflix 499
$50 hotel booking โ† detects currency

No rigid formats. No dropdowns. Just type naturally.

โœจ Key Features

Natural language input** โ€” type expenses exactly how you'd say them
AI-powered parsing** โ€” Claude Haiku extracts amount, category, date, currency automatically
9 auto-detected categories** โ€” Food, Transport, Shopping, Bills, Entertainment, Health, Business, Education, Other
Multi-currency support** โ€” INR, USD, EUR, GBP
Past date handling** โ€” "lunch in feb 25 cost 500" saves to February 2025, not today
Running monthly total** โ€” each row stores the cumulative month total
Monthly summary** โ€” type SUMMARY or summary february for any month
Works on empty sheet** โ€” no errors on first use
Invalid input handling** โ€” friendly error if no amount detected

๐Ÿ’ฌ Commands

| What you type | What happens |
| :--- | :--- |
| spent 500 on lunch | โœ… Saved: ๐Ÿ• Food & Dining โ€” Lunch ยท โ‚น500 |
| uber 150 | โœ… Saved: ๐Ÿš— Transport โ€” Uber ยท โ‚น150 |
| 1200 electricity bill | โœ… Saved: ๐Ÿ’ก Bills & Utilities ยท โ‚น1200 |
| lunch in feb 25 cost 500 | โœ… Saved to February 2025 correctly |
| SUMMARY | ๐Ÿ“Š Current month report with breakdown |
| summary february | ๐Ÿ“Š February report (current year) |
| summary february 2025 | ๐Ÿ“Š February 2025 specific report |
| HELP | ๐Ÿ“– Shows all commands and categories |

๐Ÿ›  Setup Requirements

1. Google Sheet

Create a new Google Sheet with these exact headers in Row 1:

| Col | Header |
| :---: | :--- |
| A | Date |
| B | Amount |
| C | Category |
| D | Description |
| E | Currency |
| F | Month |
| G | Raw Message |
| H | Total |

2. Credentials needed

| Credential | Used for | Free? |
| :--- | :--- | :--- |
| Anthropic API | Claude Haiku AI parsing | Paid (very low cost) |
| Google Sheets OAuth2 | Read & write expenses | Free |

3. After importing

Connect your Anthropic credential to the Claude Haiku node
Connect your Google Sheets credential to all sheet nodes
Update the Sheet ID in all Google Sheets nodes to point to your sheet
Open the workflow chat and type your first expense

๐Ÿ— How It Works

You type: "spent 500 on car wash"
โ†“
Detect Intent โ†’ classified as: expense
โ†“
Read All Expenses โ†’ loads sheet (works even if empty)
โ†“
Prepare Data โ†’ calculates existing month total
โ†“
AI Parse Expense (Claude Haiku)
โ†’ amount: 500
โ†’ category: Transport
โ†’ description: Car wash
โ†’ date: today
โ†’ currency: INR
โ†“
Parse & Total
โ†’ derives Month from parsed date
โ†’ computes new running total
โ†“
Is Valid? (amount > 0 and is_expense = true)
โœ… YES โ†’ Save to Sheet โ†’ Reply with confirmation
โŒ NO โ†’ Ask user to include an amount

Summary flow:

You type: "summary february"
โ†“
Detect Intent โ†’ classified as: summary
โ†“
Read for Summary โ†’ loads all rows
โ†“
Build Summary
โ†’ detects "february" in message
โ†’ filters rows by February (current year)
โ†’ calculates total, breakdown by category, daily avg
โ†“
Returns formatted report

๐Ÿ“Š Sample Summary Output

๐Ÿ“Š March 2026 Report

๐Ÿ’ณ Total: โ‚น8,450
๐Ÿ“ Entries: 12
๐Ÿ“ˆ Daily avg: โ‚น470
๐Ÿ” Top: ๐Ÿ• Food & Dining

Breakdown:
๐Ÿ• Food & Dining: โ‚น3,200 (38%)
๐Ÿš— Transport: โ‚น1,800 (21%)
๐Ÿ’ก Bills & Utilities: โ‚น1,200 (14%)
๐Ÿ›๏ธ Shopping: โ‚น1,050 (12%)
๐ŸŽฌ Entertainment: โ‚น800 (9%)
๐Ÿฅ Health: โ‚น400 (5%)

๐Ÿ“‚ Auto-Detected Categories

| Emoji | Category | Example keywords |
| :---: | :--- | :--- |
| ๐Ÿ• | Food & Dining | lunch, dinner, restaurant, zomato, swiggy, grocery |
| ๐Ÿš— | Transport | uber, ola, petrol, metro, flight, car wash, parking |
| ๐Ÿ›๏ธ | Shopping | amazon, flipkart, clothes, electronics, shoes |
| ๐Ÿ’ก | Bills & Utilities | electricity, wifi, rent, recharge, emi, gas |
| ๐ŸŽฌ | Entertainment | netflix, movie, spotify, concert, gaming |
| ๐Ÿฅ | Health | medicine, doctor, gym, pharmacy, hospital |
| ๐Ÿ’ผ | Business | office, software, domain, hosting, tools |
| ๐Ÿ“š | Education | course, books, tuition, udemy, fees |
| ๐Ÿ’ฐ | Other | anything that doesn't match above |

โš™๏ธ Workflow Nodes

| Node | Type | Purpose |
| :--- | :--- | :--- |
| When chat message received | Chat Trigger | Entry point |
| Detect Intent | Code | Classify: expense / summary / help |
| Intent Switch | Switch | Route to correct path |
| Read All Expenses | Google Sheets | Load rows (alwaysOutputData: true) |
| Prepare Data | Code | Compute month total, handle empty sheet |
| AI Parse Expense | LLM Chain | Extract fields using Claude Haiku |
| Claude Haiku | Anthropic Model | AI model for parsing |
| Parse & Total | Code | Validate, derive month, compute total |
| Is Valid Expense? | IF | Check amount > 0 |
| Save Expense to Sheet | Google Sheets | Append new row |
| Reply Saved | Code | Format confirmation message |
| Reply Invalid | Code | Request amount from user |
| Read for Summary | Google Sheets | Load all rows for report |
| Build Summary | Code | Filter by month, compute breakdown |
| Send Help | Code | Return command reference |

๐Ÿ”ง Customisation Ideas

Add a budget alert** โ€” warn when monthly total exceeds a set limit
Telegram integration** โ€” replace chat trigger with Telegram bot
WhatsApp integration** โ€” use Twilio WhatsApp as the input channel
Weekly digest** โ€” add a Schedule Trigger for automatic weekly reports
Multi-user** โ€” store user ID with each row to support team expense tracking
Export to PDF** โ€” generate monthly expense report as a PDF

โš ๏ธ Important Notes

The Read All Expenses node has Always Output Data enabled โ€” this is required so the flow works on an empty sheet
Month is derived from the parsed date, not today's date โ€” so past-dated entries file correctly
The Total column stores the running month total at the time of each entry โ€” it does not update retroactively if you delete rows

๐Ÿ“ฆ Requirements Summary

n8n (cloud or self-hosted)
Anthropic API key (Claude Haiku โ€” very low token usage)
Google account with Sheets access

Built with n8n ยท Claude Haiku ยท Google Sheets By Nirav Gajera

Nodes Used (4)

Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic
Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Google Sheets
n8n-nodes-base.googleSheets