⚡ Track expenses via chat with Claude Haiku and Google Sheets

⚡ 108 views · ⚡ Personal Productivity

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:

No rigid formats. No dropdowns. Just type naturally.


✨ Key Features


💬 Commands

What you typeWhat 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:

ColHeader
ADate
BAmount
CCategory
DDescription
ECurrency
FMonth
GRaw Message
HTotal

2. Credentials needed

CredentialUsed forFree?
Anthropic APIClaude Haiku AI parsingPaid (very low cost)
Google Sheets OAuth2Read & write expensesFree

3. After importing

  1. Connect your Anthropic credential to the Claude Haiku node
  2. Connect your Google Sheets credential to all sheet nodes
  3. Update the Sheet ID in all Google Sheets nodes to point to your sheet
  4. 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

EmojiCategoryExample keywords
🍕Food & Dininglunch, dinner, restaurant, zomato, swiggy, grocery
🚗Transportuber, ola, petrol, metro, flight, car wash, parking
🛍️Shoppingamazon, flipkart, clothes, electronics, shoes
💡Bills & Utilitieselectricity, wifi, rent, recharge, emi, gas
🎬Entertainmentnetflix, movie, spotify, concert, gaming
🏥Healthmedicine, doctor, gym, pharmacy, hospital
💼Businessoffice, software, domain, hosting, tools
📚Educationcourse, books, tuition, udemy, fees
💰Otheranything that doesn’t match above

⚙️ Workflow Nodes

NodeTypePurpose
When chat message receivedChat TriggerEntry point
Detect IntentCodeClassify: expense / summary / help
Intent SwitchSwitchRoute to correct path
Read All ExpensesGoogle SheetsLoad rows (alwaysOutputData: true)
Prepare DataCodeCompute month total, handle empty sheet
AI Parse ExpenseLLM ChainExtract fields using Claude Haiku
Claude HaikuAnthropic ModelAI model for parsing
Parse & TotalCodeValidate, derive month, compute total
Is Valid Expense?IFCheck amount > 0
Save Expense to SheetGoogle SheetsAppend new row
Reply SavedCodeFormat confirmation message
Reply InvalidCodeRequest amount from user
Read for SummaryGoogle SheetsLoad all rows for report
Build SummaryCodeFilter by month, compute breakdown
Send HelpCodeReturn command reference

🔧 Customisation Ideas


⚠️ Important Notes


📦 Requirements Summary


Built with n8n · Claude Haiku · Google Sheets By Nirav Gajera

🔗 Nodes Used

Google Sheets, Basic LLM Chain, Anthropic Chat Model, Chat Trigger

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup