AI-Powered Receipt Processing and Budget Tracking with Real-Time Slack Reports - n8n Workflow

Use this comprehensive n8n workflow to automate expense tracking. It uses AI to parse receipt photos, stores data in Google Sheets, and provides real-time and scheduled budget reports via Slack.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Small businesses or freelancers requiring automated, auditable expense logs.
Households needing a shared, real-time budget tracking system.
n8n users looking for advanced n8n templates integrating AI, spreadsheets, and messaging.
Automation specialists interested in deploying a complex, two-branch n8n workflow.

Overview

This powerful n8n workflow solves the tedious problem of manual expense logging. Instead of typing receipt details, users simply submit a photo (or the OCR text of one) to a designated webhook. The n8n automation takes over, leveraging an AI agent (via OpenRouter) to accurately extract the date, store, items, and total amount.

Once parsed, the data is immediately logged into a Google Sheet—creating a centralized database. Crucially, this n8n workflow operates in two modes: providing instant feedback on the current month's spending immediately after an expense is logged, and running a scheduled daily analysis to provide deeper insights, such as top spending categories and daily averages. Utilizing the custom code n8n node for calculation ensures flexibility, making this an essential n8n template for budget management.

How it Works

This n8n workflow operates via two parallel processes:

1. Real-Time Receipt Processing


  1. Receipt Photo Upload: The process is started by an n8n trigger, specifically a Webhook, which accepts text data (usually the result of OCR on a receipt image) sent to the specified path (/receiptText).

  2. Parse Receipt: An AI Agent n8n node, powered by an OpenRouter Chat Model, takes the raw receipt text and is instructed to output a clean JSON structure containing 'Date', 'Store', 'Items', and 'Amount'.

  3. Code (Formatting): A JavaScript n8n node cleans up the AI's output, ensuring it is correctly formatted as an array of items for the next step.

  4. Add to Budget Sheet: The Google Sheets n8n node appends this structured expense data to the target Budget spreadsheet.

  5. Code (Budget Calculation): This n8n node reads the entire Google Sheet to calculate the total spent for the current month and determines the remaining budget (based on a user-defined variable of 30,000 JPY in the code).

  6. Report Budget: A second AI Agent refines the calculated summary into a clear, conversational message.

  7. Send a message: The Slack n8n node instantly sends the real-time budget update and remaining funds report to a designated channel.

2. Scheduled Monthly Reporting


  1. Daily Report Trigger: An n8n trigger (Cron n8n node) initiates this process on a fixed schedule (e.g., daily).

  2. Get Budget Sheet (Daily): The Google Sheets n8n node reads all existing data from the sheet.

  3. Monthly Analysis: A complex JavaScript n8n node filters data for the current month, aggregating statistics like monthly total, daily average, top 3 stores, and top 3 spending days.

  4. Monthly Report: A third AI Agent n8n node analyzes these structured statistics and generates a comprehensive, narrative report with trend analysis and simple advice.

  5. Send monthly report: The final Slack n8n node delivers the detailed monthly budget report.

Installation Guide

To deploy this powerful n8n workflow template, follow these setup steps:


  1. Import: Copy the provided JSON and import it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Google Sheets Setup: Create a new spreadsheet with the exact header columns: Date, Store, Items, and Amount. Configure your Google Sheets credentials in n8n and select the document ID and sheet name in both Google Sheets n8n node instances.

  3. AI Service Credentials (OpenRouter): Obtain an API key from OpenRouter. Create a corresponding credential entry in n8n and link it to all three 'OpenRouter Chat Model' n8n node instances.

  4. Slack Integration: Connect your Slack workspace by setting up Slack credentials in n8n. Select the target channel in both 'Send a message' and 'Send monthly report' Slack n8n node instances.

  5. Customization: Modify the hardcoded budget limit in the 'Code in JavaScript2' n8n node (const budget = 30000;) to match your actual monthly budget.

  6. Activation: Activate the n8n workflow. The Webhook n8n trigger URL can now be copied and used to submit receipt data.

Node Details

Receipt Photo Upload (Webhook n8n trigger): Serves as the entry point for expense data submission. Key configuration: Uses the path receipt Text and HTTP method POST.
Parse Receipt (LangChain Agent n8n node): The core intelligence. Function: Uses an AI model (linked via OpenRouter) to transform unstructured receipt text into structured JSON data. Key Configuration: Uses a specific systemMessage prompt to enforce the required JSON output format.
Add to Budget Sheet (Google Sheets n8n node): Function: Persistently stores the extracted data. Key Configuration: Operation: append, mapping data fields (Date, Store, Items, Amount) from the AI output.
Code in JavaScript2 (Code n8n node): Function: Calculates the real-time budget status. Key Configuration: Contains the logic for date parsing, monthly aggregation, and defines the crucial budget variable.
Report Budget (LangChain Agent n8n node): Function: Acts as a content editor, taking raw budget numbers and formatting them into a concise, professional message for Slack.
Daily Report Trigger (Cron n8n trigger): Function: Initiates the scheduled reporting branch of the n8n workflow. Key Configuration: Schedule settings (runs daily).
Monthly Analysis (Code n8n node): Function: Runs complex data aggregation on the entire dataset retrieved by the preceding Google Sheets n8n node, generating metrics like top spending items and daily average.
Monthly Report (LangChain Agent n8n node): Function: Consumes the statistical analysis and generates a detailed, insightful written report ready for delivery via the final Slack n8n node.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
takuma
takuma

Featured*