πŸ”¬ Monitor budget variance with Google Sheets, Gemini, Slack, and Gmail

⚑ 24 views Β· πŸ”¬ Document Extraction & Analysis

Description

Quick overview

This workflow runs daily to compare department budgets and actual spend from Google Sheets, calculates variance, uses Google Gemini to generate root-cause insights, sends Slack alerts when variance breaches a threshold, logs results back to Google Sheets, and emails a daily report via Gmail.

How it works

  1. Runs every day at 9:00 AM on a schedule.
  2. Reads budget and actual spend data from two Google Sheets tabs and matches records by Department.
  3. Calculates spend variance and variance percentage, then assigns a status label (Healthy/Warning/Critical) and run context like date and summary.
  4. Sends the variance details to Google Gemini to generate a JSON response with root cause, risk level, and recommendations.
  5. Checks whether the variance percentage is greater than 10% and sends a Slack alert with the AI insights when the threshold is exceeded.
  6. Appends the final analysis (including whether an alert was sent) to a Google Sheets log and sends the same report via Gmail.

Setup

  1. Connect Google Sheets OAuth credentials and set the correct spreadsheet and sheet tabs for Budget Data, Actual spend, and the Final report log.
  2. Add a Google Gemini (PaLM) API credential for the Gemini model used in the analysis step.
  3. Add Slack OAuth2 credentials and choose the channel where budget variance alerts should be posted.
  4. Add Gmail OAuth2 credentials and set the recipient(s) for the daily budget monitoring email.
  5. Update the variance alert threshold (currently >10% variance) and status thresholds (10%/20%) to match your policy.

Requirements

Customization

Additional info

Who’s It For

Add-ons (Enhancements)

Use Case Examples

  1. Corporate Budget Monitoring

Track departmental spending daily and prevent overspending

  1. Procurement Cost Control

Identify supplier-related cost deviations early

  1. Startup Financial Discipline

Maintain strict control over limited budgets

  1. Project-Based Budget Tracking

Monitor cost overruns across multiple projects

  1. Audit & Compliance Reporting

Maintain a clear log of financial decisions and anomalies

These are just a few examplesβ€”this workflow can be adapted for many other financial monitoring scenarios.

Troubleshooting Guide

IssuePossible CauseSolution
No data fetchedIncorrect Google Sheets configurationVerify sheet IDs and column names
Merge not workingDepartment names mismatchEnsure consistent naming across sheets
Wrong variance valuesNon-numeric dataEnsure Budget and Spend fields are numbers
No Slack alertsCondition not met or Slack not configuredCheck IF condition and Slack credentials
AI output missingGemini API issueVerify API credentials and prompt
Email not sentGmail credentials issueReconnect Gmail OAuth
Data not loggedSheet mapping issueCheck column mapping in final node
Workflow not runningTrigger inactiveActivate workflow

Need Help?

If you need help setting up this workflow, customizing it for your business, or adding advanced features like dashboards, AI enhancements or integrations, our n8n workflow development team at WeblineIndia is here to assist you.

We specialize in building scalable automation workflows tailored to your business needs.

Reach out to us for:

Let us help you turn automation into a competitive advantage.

πŸ”— Nodes Used

Google Sheets, Slack, Gmail, Schedule Trigger, Google Gemini

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup