← All N8N workflows
AI & researchAgentCodeDate TimeFilterHtml

Key Sections of n8n Workflow

Configured with Agent, Date Time, Filter, Html, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
TriggerSchedule TriggerSchedule TriggerData storeYTD vs Prevoius Month1My SqlRoutingLoop Over ItemsLoop Over ItemsTransformCostCentrsEdit FieldsTransformDate & TimeDate TimeCodePreviousMonthCodeTransformSelected Cost CenterEdit FieldsData storeGet Cost Centers withBudgetsMy SqlRoutingFilterFilterTransformHTMLHtmlCodeverticalPLCodeTransformMergeMergeCodeCodeCodeMessagingMicrosoft Outlook2Microsoft OutlookCodeCostCenterCodeCodeWIP1CodeData storeEmployeesMy SqlCodeEmployees1CodeWaitWaitWaitCodeFinancial PerformanceCodeTransformEmail DataEdit FieldsIntegrationCalculatorTool CalculatorAI & modelsBusiness Performance AIAgent (Analyst)AgentAI & modelsThinkTool ThinkAI & modelsGoogle Gemini ChatModelLM Chat Google GeminiData storeDepartments My SqlData storeProjectsMy Sql

Node categories in this workflow

  • Trigger
  • Data store
  • Routing
  • Transform
  • Code
  • Messaging
  • Wait
  • Integration
  • AI & models

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Schedule TriggerTriggerSchedule TriggerSee node parameters
YTD vs Prevoius Month1Data storeMy SqlexecuteQuery
Loop Over ItemsRoutingLoop Over ItemsSee node parameters
CostCentrsTransformEdit FieldsSee node parameters
Date & TimeTransformDate TimeSee node parameters
PreviousMonthCodeCodeSee node parameters
Selected Cost CenterTransformEdit FieldsSee node parameters
Get Cost Centers with BudgetsData storeMy SqlexecuteQuery
FilterRoutingFilterSee node parameters
HTMLTransformHtmlSee node parameters
verticalPLCodeCodeSee node parameters
MergeTransformMergeSee node parameters
CodeCodeCodeSee node parameters
Microsoft Outlook2MessagingMicrosoft OutlookSee node parameters
CostCenterCodeCodeSee node parameters
WIP1CodeCodeSee node parameters
EmployeesData storeMy SqlexecuteQuery
Employees1CodeCodeSee node parameters
WaitWaitWaitSee node parameters
Financial PerformanceCodeCodeSee node parameters
Email DataTransformEdit FieldsSee node parameters
CalculatorIntegrationTool CalculatorSee node parameters
Business Performance AI Agent (Analyst)AI & modelsAgentSee node parameters
ThinkAI & modelsTool ThinkSee node parameters
Google Gemini Chat ModelAI & modelsLM Chat Google GeminiSee node parameters
Departments Data storeMy SqlexecuteQuery
ProjectsData storeMy SqlexecuteQuery

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

None declared. HTTP requests and Code nodes may still need configuration.

Workflow notes

Key Sections of n8n Workflow

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.
SQL Query Nodes

SQL Query Nodes

(e.g., YTD vs Previous Month, Projects, Employees, Departments) These nodes fetch structured financial data (like revenue, expenses, WIP, employee count) directly from your database (e.g., ERPNext on MySQL).

You can use any database (MySQL, PostgreSQL, MSSQL, etc.) as long as the schema is mapped accordingly.

To generate these queries faster, use ChatGPT or any AI chat tool: 👉 Just describe what you want (e.g., “monthly budget vs actual grouped by cost center”), and it will write SQL for you.

You can also replace these SQL nodes with any other data source:

Excel/CSV File (via Google Drive or n8n Read Binary File)

Google Sheets

Airtable

REST APIs

Internal apps

✅ The key is to produce the same structured data format expected by the next steps in the workflow.

Developed by Amjid Ali

Developed by Amjid Ali

Thank you for using this workflow template. It has taken me countless hours of hard work, research, and dedication to develop, and I sincerely hope it adds value to your work.

If you find this template helpful, I kindly ask you to consider supporting my efforts. Your support will help me continue improving and creating more valuable resources.

You can contribute via PayPal here:

http://paypal.me/pmptraining

For Full Course about ERPNext or Automation using AI follow below link

http://lms.syncbricks.com

Additionally, when sharing this template, I would greatly appreciate it if you include my original information to ensure proper credit is given.

Thank you for your generosity and support! Email : user@example.com https://linkedin.com/in/amjidali https://syncbricks.com https://youtube.com/@syncbricks

Key Sections of n8n Workflow

Key Sections of n8n Workflow

Purpose and structure

This folder contains the Key Sections of n8n Workflow workflow. Its executable nodes use agent, code, dateTime, filter, html, lmChatGoogleGemini, merge, microsoftOutlook, mySql, scheduleTrigger, set, splitInBatches, toolCalculator, toolThink, wait. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

Schedule Trigger

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Wait/0869_Wait_Datetime_Send_Scheduled.json MIT; preserve source notices.

More in AI & research