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
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
- Download
expense-tracker.json
- Open your n8n instance
- Go to Workflows → Import from File
- Select the downloaded JSON file
- Click Import
2. Configure Credentials
Set up the required service connections:
- OpenAI API - For receipt parsing
- Google Sheets OAuth2 API - For expense logging
- Slack OAuth2 API - For notifications (optional)
3. Configure Google Sheets
- Create a new Google Spreadsheet
- Name the first sheet "Expenses"
- Add column headers: Date, Merchant, Amount, Currency, Category, Items, Tax, Payment Method, Scan Time, Original Code
- Copy the spreadsheet ID from the URL
- Update the "Log to Google Sheets" node with your spreadsheet ID
4. Activate Workflow
- Click Active toggle to enable the workflow
- Note the webhook URL from the "Expense Webhook" node
- 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:
- Food & Beverages
- Transportation
- Office Supplies
- Entertainment
- Travel
- Utilities
- Healthcare
- Shopping
Get Started
Ready to automate expense tracking with AllCodeRelay and n8n?
Download n8n Workflow
View Full Documentation
Get n8n