API Driven Expense Tracker using Google Sheets - n8n Workflow

Automate personal finance tracking with this robust n8n workflow. Use a simple API webhook to log expenses directly to Google Sheets, including validation and automated daily spending summaries.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Individuals seeking to automate personal finance tracking.
Developers needing a simple API endpoint to log transactional data.
Users looking for powerful n8n templates that combine custom logic with cloud storage.
Anyone who wants to replace manual data entry with an automated n8n solution.

Overview

Managing personal finances often involves tedious manual data entry or relying on expensive, restrictive third-party apps. This powerful n8n workflow solves this by creating a dedicated API endpoint for logging expenses in real-time. By utilizing a Webhook n8n trigger, any external application (like a mobile form or scripting tool) can instantly push expense data. The workflow ensures data integrity through validation before securely storing the information in Google Sheets. Furthermore, a secondary scheduled n8n trigger automatically generates daily spending summaries, providing instant insights without requiring manual calculation. This complete n8n solution offers robust tracking capabilities and immediate feedback via API response.

How it Works

This n8n workflow operates via two main parallel processes, each starting with a unique n8n trigger.

1. Real-Time Expense Logging (API Triggered)


  1. Expense Input Webhook: The primary process begins when a POST request hits the /webhook/add-expense n8n trigger endpoint, delivering raw expense data (amount, category, description, etc.).

  2. Validate and Format Expense Data: A crucial Function n8n node takes over. It validates the input, ensuring the amount is positive, assigning default values if necessary, and enforcing defined categories (Food, Transport, etc.). If validation fails, an error is thrown.

  3. Save Expense to Google Sheets: The validated data is passed to the Google Sheets n8n node, which securely appends the new transaction to the designated 'Expenses' sheet.

  4. Calculate Monthly Summary & Respond: A subsequent Function n8n node prepares a clean success message and summary payload. Finally, the Send Success Response n8n node immediately returns a success message to the calling application, providing real-time confirmation.

2. Scheduled Daily Reporting (Cron Triggered)


  1. Daily Summary Schedule: This flow is initiated by a Cron n8n trigger (scheduled, typically for the evening).

  2. Read Today's Expenses from Sheet: The Google Sheets n8n node reads the relevant expense data from the spreadsheet. Since all data is read, the subsequent step handles filtering.

  3. Calculate Daily Total: A dedicated Function n8n node filters the retrieved data to include only transactions marked for today. It then calculates the total spending for the day and provides a breakdown by category. This completes the daily report generation phase of the n8n workflow.

Installation Guide

To deploy and utilize this highly effective n8n workflow, follow these steps:


  1. Import the n8n template: Copy the provided JSON and import it into your n8n instance.

  2. Google Sheets Setup: Create a new Google Sheet. Crucially, ensure the main data tab is named 'Expenses' and contains the required header columns: Date | Category | Description | Amount | Payment Method.

  3. Credential Configuration: Set up your Google Sheets OAuth2 credentials within n8n.

  4. Update Spreadsheet IDs: In the Save Expense to Google Sheets n8n node and the Read Today's Expenses from Sheet n8n node, replace REPLACEWITHYOURSPREADSHEETID with the actual ID of your expense tracking spreadsheet.

  5. Activate: Save the n8n workflow and set the Daily Summary Schedule n8n trigger to your preferred time (e.g., 8:00 PM daily). Activate the n8n workflow to make the webhook live.

Node Details

This n8n workflow leverages several key n8n nodes to achieve robust functionality:

Expense Input Webhook (n8n trigger): This is the entry point, configured as a POST request handler at the path /add-expense. It is the primary n8n trigger for expense logging.
Validate and Format Expense Data (Function n8n node): Essential for data quality. This custom n8n node validates that amount > 0, defaults the category if needed, and ensures the data adheres to a strict format before proceeding to storage.
Save Expense to Google Sheets (Google Sheets n8n node): Configured to use the append operation, ensuring every new item passed from the preceding n8n node is added as a new row to the 'Expenses' sheet.
Daily Summary Schedule (Cron n8n trigger): The secondary n8n trigger, configured to run on a daily schedule, automating the generation of summary reports.
Read Today's Expenses from Sheet (Google Sheets n8n node): Fetches the data needed for analysis, utilized by the scheduled branch of the n8n workflow.
Calculate Daily Total (Function n8n node): A custom n8n node that performs filtering based on today's date and aggregates totals by category, generating the final summary report payload.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

Featured*