TL;DR: This n8n workflow lets you track expenses by simply typing natural language into a chat — no forms, no apps, no friction. An AI Agent parses your message ("coffee 4.50 yesterday"), extracts the structured data, and saves it to Google Sheets automatically. Perfect for anyone who wants expense tracking that feels like texting a friend.

Difficulty⭐⭐ (Level 2)
Who's it forFreelancers, small teams, anyone tired of expense apps
Problem solvedManual expense entry is tedious; this makes it conversational
TemplateView on n8n.io
Tools usedn8n Chat, AI Agent, OpenAI, Google Sheets
Setup time15 minutes
Time savedHours per month on expense logging

David once spent an entire Sunday afternoon categorizing three months of receipts. The coffee had gone cold. The spreadsheet had gone rogue. And somewhere in the chaos, a €47 lunch had been filed under "office supplies." He looked at me with the hollow eyes of a man defeated by data entry and said, "There has to be a better way."

There is. And it involves talking to a chat window like you're texting a slightly obsessive accountant.

What This Workflow Does

At its core, this workflow transforms casual messages into structured expense records. You type something like "car wash; 59.30 usd; 25 jan 2024" into an n8n chat interface, and moments later, a new row appears in your Google Sheet with the cost, description, and date properly formatted.

The magic happens through n8n's AI Agent node, which uses OpenAI to parse your natural language input. The agent doesn't just regex its way through your message — it actually understands context. Tell it "lunch with client yesterday" and it figures out the date. Say "fifty bucks on taxi" and it extracts both the amount and the category. It's parsing with personality.

The workflow uses a sub-workflow pattern to separate concerns cleanly. The main flow handles the chat interface and AI orchestration, while a secondary flow manages the actual parsing and Google Sheets insertion. This isn't just architectural vanity — it makes the workflow easier to debug, extend, and maintain.

Quick Start Guide

Before you dive into the nodes, you'll need three things ready: an OpenAI API key (for the language model), Google Sheets credentials (for storage), and about fifteen minutes of uninterrupted focus. The template provides a sample spreadsheet you can clone, which saves you the trouble of setting up columns correctly.

Import the workflow template into your n8n instance and immediately check the credential bindings. The AI Agent nodes need your OpenAI connection, and the Google Sheets nodes need OAuth access to your Google account. If you're running self-hosted n8n, make sure your instance can reach both APIs without firewall drama.

The one gotcha that trips up newcomers: the sub-workflow executor tool needs to reference its own workflow. After import, open the "Parse msg and save to Sheets" node and re-select the current workflow from the dropdown. This self-referential setup lets the AI Agent call back into the same workflow for the parsing step. It feels circular, but it works beautifully.

Building the Chat Interface

The workflow starts with n8n's Chat Trigger node, which creates an embeddable chat widget. When activated, this node provides a URL where you can access a simple chat interface. Users type their expense messages here, and each message triggers the workflow.

The Chat Trigger is remarkably flexible. You can embed it in a webpage, access it directly via the provided URL, or even connect it to other messaging platforms with a bit of webhook creativity. For personal use, the direct URL works perfectly — bookmark it on your phone and you've got instant expense logging anywhere.

For Advanced Readers: The Chat Trigger node accepts configuration for custom styling and behavior. You can set options.allowFileUploads to enable receipt image attachments, though you'd need additional nodes to process them. The webhookId parameter lets you create stable URLs that survive workflow updates.

Orchestrating the AI Agent

The heart of this workflow is the AI Agent node, configured with a simple but effective system prompt. It tells the agent: "You are a helpful accountant. Use save to db tool to save expense message to DB." This prompt establishes the agent's role and points it toward the tool it should use.

Connected to the agent are two supporting nodes. The OpenAI Chat Model provides the language understanding — this is where your API key earns its keep. The Window Buffer Memory maintains conversation context, so if you need to correct or clarify an expense, the agent remembers what you were discussing.

The agent's secret weapon is the "Parse msg and save to Sheets" tool, which is actually an n8n sub-workflow executor. When the agent decides an expense needs saving, it calls this tool with the original message text. This delegation pattern keeps the agent node clean while giving you full control over the parsing logic.

For Advanced Readers: The agent uses maxIterations: 3 to prevent infinite loops. If parsing fails repeatedly, the agent will give up gracefully rather than burning through your OpenAI credits. You can adjust this in the node settings, but three iterations handles most edge cases without excessive API calls.

Parsing Natural Language to JSON

The sub-workflow receives the raw message and feeds it to an Information Extractor node — one of n8n's LangChain-powered tools. This node is configured with a schema defining exactly what data you want: cost (number), description (string), and date (ISO format).

The Information Extractor is smarter than simple regex. Feed it "taxi to airport, fifty euros, last Tuesday" and it returns structured JSON with the numeric amount, cleaned description, and calculated date. It handles currency symbols, written-out numbers, and relative date references without breaking a sweat.

Once parsed, the data flows into a Google Sheets node configured for append operations. The node maps the extracted fields to your spreadsheet columns, adding the original message as a fourth column for audit purposes. If something looks wrong in your sheet, you can always check what was actually typed.

For Advanced Readers: The Information Extractor's schema uses JSON Schema format. You can add validation constraints like "minimum": 0 for the cost field or "enum": ["food", "transport", "office"] for category fields. The required: true flag ensures the LLM always attempts extraction, even for ambiguous inputs.

Connecting to Google Sheets

The Google Sheets node uses a straightforward append operation, adding each expense as a new row. The template includes a pre-structured sheet with columns for date, cost, description, and original message, but you can customize this to match your existing expense tracking setup.

One detail worth noting: the node uses useAppend: true in its options, which is more efficient than reading the entire sheet to find the next empty row. For sheets with thousands of entries, this makes a noticeable performance difference.

The sheet template includes a date column that accepts ISO format dates, which pairs nicely with the Information Extractor's output. If your dates look wrong, check that your sheet's locale matches the format being inserted — Google Sheets can be finicky about date interpretation.

Key Learnings

This workflow demonstrates two powerful patterns worth understanding deeply. First, the AI Agent as orchestrator: rather than building complex branching logic, you let the language model decide when and how to use available tools. The agent handles edge cases and ambiguous inputs that would require dozens of IF nodes in a traditional workflow.

Second, the sub-workflow tool pattern keeps your main workflow clean while providing full customization of individual operations. You could swap out Google Sheets for Airtable, Notion, or a database without touching the agent configuration. The tool interface abstracts the implementation details.

What's Next

This workflow gives you the foundation, but the real power comes from customization. Consider adding category detection — the same Information Extractor can classify expenses into food, transport, or office supplies. Or connect multiple sheets for different expense accounts. The agent pattern makes these extensions remarkably simple.

David now logs expenses while walking to meetings. A quick voice-to-text "coffee four fifty" and it's done. No more Sunday spreadsheet sessions. No more cold coffee. Just quiet, competent automation doing what it does best: making the tedious invisible.

Your move. Import the template, connect your credentials, and send your first expense. The chat is waiting.