{
  "name": "Generate monthly financial reports with Gemini AI, SQL, and Outlook",
  "nodes": [
    {
      "id": "fdd55253-5cb6-4b1f-9c93-6915f254f700",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -60,
        -240
      ]
    },
    {
      "id": "c8d6064a-3fd7-478d-891c-6ade336daa1f",
      "name": "YTD vs Prevoius Month1",
      "type": "n8n-nodes-base.mySql",
      "position": [
        640,
        0
      ]
    },
    {
      "id": "13102b1c-8a06-4a23-8174-75254bf783ac",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -40,
        200
      ]
    },
    {
      "id": "da2a0b30-3df4-430c-8cac-cd9d735ce759",
      "name": "CostCentrs",
      "type": "n8n-nodes-base.set",
      "position": [
        1100,
        -240
      ]
    },
    {
      "id": "7891d71c-18f8-4e07-aa30-f50bec10cef6",
      "name": "Date & Time",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        260,
        -240
      ]
    },
    {
      "id": "3e69dc27-0850-4978-bf10-e81ff575ec60",
      "name": "PreviousMonth",
      "type": "n8n-nodes-base.code",
      "position": [
        520,
        -240
      ]
    },
    {
      "id": "f6776225-39d2-4746-a90f-b4d1b12a66ee",
      "name": "Selected Cost Center",
      "type": "n8n-nodes-base.set",
      "position": [
        260,
        220
      ]
    },
    {
      "id": "1e23d876-21be-4d90-b5e4-38f3543a0c3b",
      "name": "Get Cost Centers with Budgets",
      "type": "n8n-nodes-base.mySql",
      "position": [
        800,
        -240
      ]
    },
    {
      "id": "d4429595-b1b9-4121-a612-24be11e6a36a",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        1380,
        -240
      ]
    },
    {
      "id": "67bbe834-ae40-4aad-b468-6fa73c9dc6c6",
      "name": "HTML",
      "type": "n8n-nodes-base.html",
      "position": [
        40,
        920
      ]
    },
    {
      "id": "58d1dc63-9ba7-41b8-af39-b7c134ab3cea",
      "name": "verticalPL",
      "type": "n8n-nodes-base.code",
      "position": [
        900,
        220
      ]
    },
    {
      "id": "9a8bdb09-f9d4-4c4b-b1d5-dadb3c6ee567",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1380,
        220
      ]
    },
    {
      "id": "d310db4d-183d-4f99-9bd0-863320d2db73",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        1420,
        580
      ]
    },
    {
      "id": "ba5e60fb-d5cc-4a5f-9cb6-07808f7c7021",
      "name": "Microsoft Outlook2",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        1240,
        920
      ]
    },
    {
      "id": "c3cdf21d-417f-420b-98f9-dfca33119c5a",
      "name": "CostCenter",
      "type": "n8n-nodes-base.code",
      "position": [
        920,
        0
      ]
    },
    {
      "id": "9d9fb099-5fca-4777-a753-f6791f37fd37",
      "name": "WIP1",
      "type": "n8n-nodes-base.code",
      "position": [
        900,
        400
      ]
    },
    {
      "id": "5a6626ed-c841-4fd7-9111-f686fcacaa37",
      "name": "Employees",
      "type": "n8n-nodes-base.mySql",
      "position": [
        640,
        600
      ]
    },
    {
      "id": "bbfd2c19-9538-4106-8931-f65f0261d43c",
      "name": "Employees1",
      "type": "n8n-nodes-base.code",
      "position": [
        900,
        600
      ]
    },
    {
      "id": "b425da91-2faa-4063-93dd-4d997f7cd7eb",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1480,
        1180
      ]
    },
    {
      "id": "5deead0c-d386-4b51-9b96-bd58e85244c0",
      "name": "Financial Performance",
      "type": "n8n-nodes-base.code",
      "position": [
        700,
        920
      ]
    },
    {
      "id": "a472032f-42ba-4cb2-9bf7-55314083833e",
      "name": "Email Data",
      "type": "n8n-nodes-base.set",
      "position": [
        940,
        920
      ]
    },
    {
      "id": "b7c1ae4d-cbe3-47fb-84fa-f34295f8dfee",
      "name": "Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        620,
        1220
      ]
    },
    {
      "id": "2e59b7b8-d8f6-4433-98c5-f637f6b5eaf4",
      "name": "Business Performance AI Agent (Analyst)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        300,
        920
      ]
    },
    {
      "id": "3ac7b91e-ee61-4b40-9d2d-76d7916479ee",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        460,
        1220
      ]
    },
    {
      "id": "97bac1cb-8271-4169-98cf-6ea5b06ef5db",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        220,
        1220
      ]
    },
    {
      "id": "27f40dc7-61b9-4e09-9b6d-6bb9d16c38c3",
      "name": "Departments ",
      "type": "n8n-nodes-base.mySql",
      "position": [
        640,
        200
      ]
    },
    {
      "id": "b2a3ec7d-d400-4d1c-877d-f49f67ad742f",
      "name": "Projects",
      "type": "n8n-nodes-base.mySql",
      "position": [
        620,
        380
      ]
    },
    {
      "id": "a1c5f474-dc92-47e7-bf59-9cca756245cf",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1260,
        -20
      ],
      "parameters": {
        "width": 1120,
        "height": 1200,
        "content": "## Key Sections of n8n Workflow\n\n**🟢 Schedule Trigger**\n- Triggers the automation on the 5th of every month.\n- Sets the cadence for monthly reporting.\n\n**📅 Date & Time + 🧮 PreviousMonth**\n- Captures t"
      }
    },
    {
      "id": "59500949-a8b9-4287-b6f7-be49e58e1842",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1960,
        580
      ],
      "parameters": {
        "width": 680,
        "height": 560,
        "content": "## SQL Query Nodes \n(e.g., YTD vs Previous Month, Projects, Employees, Departments)\nThese nodes fetch structured financial data (like revenue, expenses, WIP, employee count) directly from your databas"
      }
    },
    {
      "id": "02f76680-0bbf-408f-826e-daef5e6e9b09",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1960,
        0
      ],
      "parameters": {
        "width": 675,
        "height": 536,
        "content": "## Developed by Amjid Ali\n\nThank 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 wor"
      }
    }
  ],
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML": {
      "main": [
        [
          {
            "node": "Business Performance AI Agent (Analyst)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WIP1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Think": {
      "ai_tool": [
        [
          {
            "node": "Business Performance AI Agent (Analyst)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Projects": {
      "main": [
        [
          {
            "node": "WIP1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Employees": {
      "main": [
        [
          {
            "node": "Employees1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "Business Performance AI Agent (Analyst)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "CostCenter": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CostCentrs": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Data": {
      "main": [
        [
          {
            "node": "Microsoft Outlook2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Employees1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "verticalPL": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Date & Time": {
      "main": [
        [
          {
            "node": "PreviousMonth",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Departments ": {
      "main": [
        [
          {
            "node": "verticalPL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PreviousMonth": {
      "main": [
        [
          {
            "node": "Get Cost Centers with Budgets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Selected Cost Center",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Date & Time",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Microsoft Outlook2": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Selected Cost Center": {
      "main": [
        [
          {
            "node": "YTD vs Prevoius Month1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Departments ",
            "type": "main",
            "index": 0
          },
          {
            "node": "Projects",
            "type": "main",
            "index": 0
          },
          {
            "node": "Employees",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Financial Performance": {
      "main": [
        [
          {
            "node": "Email Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "YTD vs Prevoius Month1": {
      "main": [
        [
          {
            "node": "CostCenter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Business Performance AI Agent (Analyst)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get Cost Centers with Budgets": {
      "main": [
        [
          {
            "node": "CostCentrs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Business Performance AI Agent (Analyst)": {
      "main": [
        [
          {
            "node": "Financial Performance",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}