AI/ML

    Automate Expense Tracking & Budget Alerts for Small Businesses with n8n


    Overview

    n8n monitors Expensify for new expenses, logs them in Google Sheets and alerts the team on Slack if budgets are exceeded.

    Prerequisites

    • n8n installed.
    • Expensify accounts with API access.
    • Google Sheets API enabled.
    • Slack account with bot token.

    Workflow Setup

    1. Prepare n8n Environment

      • Navigate to http://localhost:5678 (or your n8n URL) and log in with your credentials. In the sidebar, click “Workflows,” then select “+ New” and name it (e.g., “Expense Tracker”). Click “+” on the canvas to open the node selector.

    2. Trigger Node: Expensify

      • Node: HTTP Request

      • Settings:

        • URL: https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations

        • Method: POST

        • Body: { "type": "report", "credentials": { "partnerUserID": "<ID>", "partnerUserSecret": "<Secret>" } }

      • Output: New expense data (e.g., {{ $json.reports[0].amount }}).

    3. Log Expense Node: Google Sheets

      • Node: Google Sheets

      • Settings:

        • Operation: Append

        • Spreadsheet ID: Expense sheet

        • Range: A:C

        • Values: {{ [$node["HTTP Request"].json.reports[0].created, $node["HTTP Request"].json.reports[0].amount, $node["HTTP Request"].json.reports[0].merchant] }}

      • Output: Expense logged.

    4. Check Budget Node: Function

      • Node: Function

      • Settings:

        • Code:

    const total = $node["Google Sheets"].json.reduce((sum, row) => sum + row[1], 0); return [{ json: { overBudget: total > 5000 } }];

    • Output: Budget status.

    1. Alert Node: Slack

      • Node: Slack

      • Settings:

        • Credentials: Slack Bot Token

        • Channel: #finance

        • Text: Budget Alert: Expenses at ${{ $node["Google Sheets"].json.reduce((sum, row) => sum + row[1], 0) }}

        • Condition: {{ $node["Function"].json.overBudget }}

      • Output: Alert sent if over budget.

    Workflow Summary

    • Flow: HTTP Request → Google Sheets → Function → Slack.

    • Execution: ~15 seconds per expense.

    Benefits

    • Saves ~1 hour/week on tracking.

    • Prevents overspending with alerts.

    • Maintains financial visibility.

    Troubleshooting

    • API Fail: Check Expensify credentials.
    • Budget Logic: Verify Function code.

     

    Ready to transform your business with our technology solutions? Contact Us  today to Leverage Our AI/ML Expertise. 

    Experts in AI, ML, and automation at OneClick IT Consultancy

    AI Force

    AI Force at OneClick IT Consultancy pioneers artificial intelligence and machine learning solutions. We drive COE initiatives by developing intelligent automation, predictive analytics, and AI-driven applications that transform businesses.

    Share

    facebook
    LinkedIn
    Twitter
    Mail
    AI/ML

    Related Center Of Excellence