💰 Expense Tracking n8n Workflow

Automatically track expenses by scanning receipts and invoices with AllCodeRelay! AI-powered n8n workflow with Google Sheets and Slack integration.

n8n OpenAI Google Sheets Slack
Configure Webhook Full Documentation

Key Features

  • Receipt Recognition - Automatically detects receipt URLs and QR codes
  • AI-Powered Parsing - Uses OpenAI to extract expense details
  • Google Sheets Integration - Automatically logs expenses to spreadsheet
  • Slack Notifications - Real-time expense alerts
  • Data Validation - Ensures expense data quality
  • Error Handling - Graceful handling of invalid receipts
  • Visual Workflow - Easy to understand and modify in n8n
  • Extensible - Add more integrations and features

How It Works

1 Webhook Receives Scan - AllCodeRelay sends scanned code to n8n webhook
2 Data Extraction - Extracts code content and timestamp
3 Receipt Detection - Checks if code looks like a receipt/invoice
4 Data Fetching - Downloads receipt data if it's a URL
5 AI Parsing - OpenAI extracts structured expense data
6 Validation - Ensures required fields are present
7 Logging - Saves to Google Sheets and sends Slack notification
8 Response - Returns formatted response to AllCodeRelay

Supported Receipt Types

📱 QR Codes

Receipt QR codes with embedded data from:

  • Digital receipts
  • E-commerce platforms
  • Point-of-sale systems
  • Mobile payment apps
🔗 URLs

Links to digital receipts from:

  • Online invoice pages
  • Receipt scanning apps
  • E-commerce order confirmations
  • Digital wallet receipts

Usage Examples

💰 Successful Expense Logging

When scanning a receipt QR code:

💰 Expense Logged! 🏪 Starbucks Coffee 💵 $12.45 USD 📅 2024-12-15 🏷️ Food & Beverages ✅ Added to expense tracker

❓ Not a Receipt

For non-receipt codes:

❓ Not a Receipt This doesn't appear to be a receipt or invoice. Please scan: • Receipt QR codes • Invoice URLs • Digital receipt links

❌ Processing Error

If AI can't parse the receipt:

❌ Invalid Receipt Missing required fields: merchant, amount Please scan a valid receipt or invoice.

Quick Start

1. Import Workflow

  1. Download expense-tracker.json
  2. Open your n8n instance
  3. Go to WorkflowsImport from File
  4. Select the downloaded JSON file
  5. Click Import

2. Configure Credentials

Set up the required service connections:

3. Configure Google Sheets

  1. Create a new Google Spreadsheet
  2. Name the first sheet "Expenses"
  3. Add column headers: Date, Merchant, Amount, Currency, Category, Items, Tax, Payment Method, Scan Time, Original Code
  4. Copy the spreadsheet ID from the URL
  5. Update the "Log to Google Sheets" node with your spreadsheet ID

4. Activate Workflow

  1. Click Active toggle to enable the workflow
  2. Note the webhook URL from the "Expense Webhook" node
  3. Configure AllCodeRelay with this webhook URL
Note: You'll need an OpenAI API key for the AI parsing functionality. The workflow includes detailed setup instructions.

Google Sheets Output

The workflow creates entries with these fields:

Field Description Example
Date Transaction date 2024-12-15
Merchant Store/vendor name Starbucks Coffee
Amount Total amount 12.45
Currency Currency code USD
Category Expense category Food & Beverages
Items Purchased items Coffee, Muffin
Tax Tax amount 1.12
Payment Method How paid Credit Card

Configuration Options

🤖 AI Model Settings

In the "AI Receipt Parser" node, you can adjust:

{ "model": "gpt-4o-mini", "temperature": 0.1, "max_tokens": 1000 }
💬 Slack Channel

Update the Slack notification node to post to your preferred channel:

{ "channel": "#expenses", "text": "Custom message format..." }
🏷️ Expense Categories

The AI automatically categorizes expenses using these common categories:

Files Included

Core Files
  • expense-tracker.json - Complete n8n workflow
  • expense-tracker-README.md - Complete documentation
Features
  • Visual workflow editor
  • AI-powered data extraction
  • Multiple integration options
  • Error handling and validation

Get Started

Ready to automate expense tracking with AllCodeRelay and n8n?

Download n8n Workflow View Full Documentation Get n8n
Back to Gallery Main Site