{
  "name": "Analyze ad performance from Meta, Google and Microsoft using Groq Llama 3.3 and Gmail",
  "nodes": [
    {
      "id": "86ede9b9-b627-4fa0-b6c2-5564d868f9dc",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1584,
        0
      ]
    },
    {
      "id": "b942bb9f-15e8-4d27-bab2-2d472796e8c0",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        32,
        -288
      ],
      "parameters": {
        "width": 384,
        "height": 128,
        "content": "## DATA FETCH & FORMAT\nReads campaign data from Google Sheet.\nFormats rows into a single text string for AI analysis.\nSetup: Add your Sheet ID in the Google Sheets node."
      }
    },
    {
      "id": "45c50895-30f4-4362-94f6-e526b23053a9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -336,
        176
      ],
      "parameters": {
        "width": 304,
        "height": 112,
        "content": "## TRIGGER\nRuns every Months 1st day automatically.\nChange schedule in the trigger node settings."
      }
    },
    {
      "id": "bf2e5bfb-ef1e-4304-8cfa-6e9b23ed68ae",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        192
      ],
      "parameters": {
        "width": 384,
        "height": null,
        "content": "## AI ANALYSIS & EMAIL\nSends campaign data to Groq (Llama 3.3) for analysis.\nExtracts the report and emails it automatically.\nSetup: Add your Groq API key and Gmail credentials."
      }
    },
    {
      "id": "3dddcc48-d596-47e1-8791-ff871c55e3d8",
      "name": "Read - Meta ads",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        16
      ]
    },
    {
      "id": "b35f5427-3c47-4437-b49b-e2c94a4ac1f1",
      "name": "Read - Google ads",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        -144
      ]
    },
    {
      "id": "b2c05241-11aa-4b49-a81f-aa75cdb83f42",
      "name": "Read - Microsoft ads",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        192
      ]
    },
    {
      "id": "8e2659a4-6c44-428e-bb41-b8ebf2d6f22d",
      "name": "Merge all platform",
      "type": "n8n-nodes-base.merge",
      "position": [
        416,
        0
      ]
    },
    {
      "id": "979db74e-e046-477c-a99d-73fec84f9648",
      "name": "Calculate - KPIs & Build Prompt",
      "type": "n8n-nodes-base.code",
      "position": [
        640,
        16
      ]
    },
    {
      "id": "45673594-8f7b-4954-a437-804ee2a23348",
      "name": "Build - HTML Report",
      "type": "n8n-nodes-base.code",
      "position": [
        1360,
        0
      ]
    },
    {
      "id": "f8c0a857-1997-44df-97a5-68af0ed05330",
      "name": "Merge - KPI + AI",
      "type": "n8n-nodes-base.merge",
      "position": [
        1152,
        0
      ]
    },
    {
      "id": "35e4e54c-f41d-4ad2-94d8-3970ead1577b",
      "name": "Groq - Generate Insights",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        912,
        -128
      ]
    },
    {
      "id": "793a889a-8fdd-4367-beff-86b2f28b03c9",
      "name": "Trigger - Monthly Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -224,
        16
      ]
    },
    {
      "id": "2e1deefb-4555-416e-8c48-b792b8d31d2f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -272
      ],
      "parameters": {
        "width": 464,
        "height": 544,
        "content": "## How it works\nThis workflow automatically generates a detailed AI-powered \ncampaign performance report across Meta, Google and Microsoft \nAds and emails it to your team every month.\n\nIt reads campai"
      }
    }
  ],
  "connections": {
    "Read - Meta ads": {
      "main": [
        [
          {
            "node": "Merge all platform",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge - KPI + AI": {
      "main": [
        [
          {
            "node": "Build - HTML Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read - Google ads": {
      "main": [
        [
          {
            "node": "Merge all platform",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge all platform": {
      "main": [
        [
          {
            "node": "Calculate - KPIs & Build Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build - HTML Report": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read - Microsoft ads": {
      "main": [
        [
          {
            "node": "Merge all platform",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Groq - Generate Insights": {
      "main": [
        [
          {
            "node": "Merge - KPI + AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger - Monthly Schedule": {
      "main": [
        [
          {
            "node": "Read - Google ads",
            "type": "main",
            "index": 0
          },
          {
            "node": "Read - Meta ads",
            "type": "main",
            "index": 0
          },
          {
            "node": "Read - Microsoft ads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate - KPIs & Build Prompt": {
      "main": [
        [
          {
            "node": "Groq - Generate Insights",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge - KPI + AI",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}