š§¾ Track expenses from receipt photos with AI, Google Sheets & Slack reports
ā” 372 views Ā· š§¾ Invoice Processing
Description
Whoās it for
This template is for individuals or households who want to:
- Easily digitize and track their spending from physical receipts.
- Automate budget management and financial reporting.
- Get quick insights into their spending habits on a daily and monthly basis.
- Stay informed about their remaining budget through Slack notifications.
What it does
This workflow automates your household budget tracking in several steps:
- Receipt Photo Upload: You upload a photo of your receipt to a webhook.
- Parse Receipt: An AI agent extracts the date, store name, purchased items, and total amount from the receipt text.
- Add to Budget Sheet: The extracted data is then appended to your designated Google Sheet.
- Daily Budget Report: After each receipt entry, the workflow calculates your current monthās spending, remaining budget, and sends a summary to Slack.
- Monthly Budget Report: Once a day (triggered by a cron job), it reads all budget data for the current month from Google Sheets, performs an analysis (total spending, daily average, top stores, items, and spending days), and sends a comprehensive report to Slack.
How to set up
Requirements
- n8n Account: Self-hosted or Cloud.
- Google Sheets: A Google Sheet set up with columns for āDateā, āStoreā, āItemsā, and āAmountā.
- Slack Workspace: A Slack channel where you want to receive budget updates.
- OpenRouter Account: An API key for OpenRouter to use their chat models.
Steps
-
Google Sheets Setup:
- Create a new Google Sheet (or use an existing one) and name it āHousehold Budgetā.
- In the first sheet (e.g., āSheet1ā), set up the following headers in the first row: āDateā, āStoreā, āItemsā, āAmountā.
- Share the Google Sheet with the service account email associated with your n8n Google Sheets credentials, granting āEditorā access.
- In the āAdd to Budget Sheetā and āGet Budget Sheet (Daily)ā nodes, select your Google Sheet and the appropriate sheet name.
-
OpenRouter Credentials:
- Sign up or log in to OpenRouter (https://openrouter.ai/).
- Generate an API key.
- In n8n, create a new āOpenRouterā credential using your API key. Apply this credential to the āOpenRouter Chat Model1ā, āOpenRouter Chat Model2ā, and āOpenRouter Chat Modelā nodes.
-
Slack Credentials:
- In n8n, create a new āSlackā credential. Follow the instructions to connect your Slack workspace.
- In the āSend a messageā and āSend monthly reportā nodes, select the Slack channel where you want to receive messages.
- Make sure the Slack app has permission to post to the selected channels.
-
Webhook URLs:
- After activating the workflow, the āReceipt Photo Uploadā node will generate a webhook URL. Copy this URL. You will use this URL to send receipt text (e.g., from a mobile app that scans text).
-
Monthly Budget Adjustment:
- In the āCode in JavaScript2ā node, locate the line
const budget = 30000;and change30000to your desired monthly budget in JPY.
- In the āCode in JavaScript2ā node, locate the line
How to customize the workflow
Daily Report Trigger
The āDaily Report Triggerā node is set to run once a day. You can modify its schedule to trigger more or less frequently by adjusting its cron settings.
AI Model
You can change the AI models used in the āOpenRouter Chat Modelā nodes to any other large language model supported by n8n, such as OpenAI, Anthropic, or custom hosted models, by updating the credentials and model names.
Output Formatting
The Slack messages generated by the āReport Budgetā and āMonthly Reportā nodes can be customized by editing the systemMessage and text parameters in those nodes to change the tone, content, or language of the reports.
Additional Integrations
You can extend this workflow by adding more nodes:
- Integrate with other accounting software.
- Send notifications to different platforms (e.g., email, Discord, Telegram).
- Add sentiment analysis to your spending habits.
- Categorize expenses automatically based on items or stores using another AI node.
š Nodes Used
Cron, Google Sheets, Slack, Webhook, AI Agent, OpenRouter Chat Model
š„ Import
Download workflow.json and import into n8n:
Workflow menu ā Import from File