Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Reports, Analytics & Dashboards

Reports, Analytics & Dashboards

Generate Monthly Financial Reports with Gemini, SQL and Outlook

On the monthly schedule, it pulls cost center figures from MySQL, has Gemini write a year-to-date comparison, and emails the report through Outlook.

What it does

## Key Sections of n8n Workflow 🟢 Schedule Trigger - Triggers the automation on the 5th of every month. - Sets the cadence for monthly reporting. 📅 Date & Time + 🧮 PreviousMonth - Captures the current date and derives the previous month/year for dynamic filtering. - Used throughout all SQL queries for monthly slicing. 📊 Get Cost Centers with Budgets - Dynamically fetches all cost centers that have relevant budget and GL data for the selected period. - Ensures only active, relevant divisions are processed. 🔍 Filter - Narrows the analysis to a specific Cost Center (e.g., "AI DEPARTMENT") during testing or preview. 🔁 Loop Over Items - Iterates over all fetched Cost Centers to individually generate reports for each business unit. - Powers multi-division reporting automation. 🧾 YTD vs Previous Month1 - Performs detailed financial comparison between Year-To-Date and Previous Month. - Outputs revenue, expenses, and variance figures. 🏢 Departments + 🧱 verticalPL - Analyzes financial performance by sub-divisions (Verticals) within the cost center. - Data is transformed into an HTML table for final report. 🧱 Projects + 🧮 WIP1 - Gathers project status and WIP metrics. - Calculates % invoiced, cost % used, and revenue recognition stats. 👥 Employees + 📊 Employees1 - Counts total employees, joined this month/year for the selected cost center. - Used to calculate per-employee KPIs. 🔗 Merge + 🧾 Code - Combines all HTML tables into a single responsive report with visual formatting. - Clean, structured layout for email and review. 💡 Business Performance AI Agent (Analyst) - Uses Google Gemini 2.5 Pro to analyze financial HTML output. - Executes structured analysis and generates business insights, executive summary, profitability, and recommendations. 📩 Email Data + Microsoft Outlook - Sends the final HTML report via email. - Ready for business manager distribution with personalized message. ⏳ Wait - Enables looping and batch control across multiple cost centers. - Prevents overloading or email spamming. 🧠 Think + Calculator - Used by the AI Agent to "reason" and perform precise financial computations. - Ensures accuracy in gross/net profit, percentages, and insights.

The steps

  1. Schedule Trigger
  2. YTD vs Prevoius Month1
  3. Loop Over Items
  4. CostCentrs
  5. Date & Time
  6. PreviousMonth
  7. Selected Cost Center
  8. Get Cost Centers with Budgets
  9. Filter
  10. HTML
  11. verticalPL
  12. Merge
  13. Code
  14. Microsoft Outlook2

27 steps in total.

Similar automations