🧾 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:

What it does

This workflow automates your household budget tracking in several steps:

  1. Receipt Photo Upload: You upload a photo of your receipt to a webhook.
  2. Parse Receipt: An AI agent extracts the date, store name, purchased items, and total amount from the receipt text.
  3. Add to Budget Sheet: The extracted data is then appended to your designated Google Sheet.
  4. Daily Budget Report: After each receipt entry, the workflow calculates your current month’s spending, remaining budget, and sends a summary to Slack.
  5. 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

Steps

  1. 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.
  2. 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.
  3. 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.
  4. 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).
  5. Monthly Budget Adjustment:

    • In the ā€˜Code in JavaScript2’ node, locate the line const budget = 30000; and change 30000 to your desired monthly budget in JPY.

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:

šŸ”— 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

šŸ“– Importing guide Ā· šŸ”‘ Credential setup