{
  "name": "Send weekly GA4 WoW email reports with Gemini AI executive summary",
  "nodes": [
    {
      "id": "242dcef9-b89b-4d05-b9dd-616c8f51942c",
      "name": "GA4 - Overview Current Week",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -544,
        -464
      ]
    },
    {
      "id": "eb6868d0-0dab-49ab-99ba-b34108d16a17",
      "name": "GA4 - Overview Previous Week",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -320,
        -464
      ]
    },
    {
      "id": "dca8f70f-f4ad-439a-b8b8-e9395d5b540e",
      "name": "GA4 - Top 5 Pages",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -544,
        -272
      ]
    },
    {
      "id": "85950514-c48e-4cab-b3c5-159ecc0d7d4a",
      "name": "GA4 - Top 5 Referrals",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -544,
        -80
      ]
    },
    {
      "id": "0d766056-e67f-4827-838c-e6fe339231d9",
      "name": "GA4 - Top 5 Events",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -544,
        112
      ]
    },
    {
      "id": "9f0dabdd-36c0-41d3-9052-b9d2cdf8ea85",
      "name": "GA4 - Top 5 Countries",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -544,
        304
      ]
    },
    {
      "id": "1c982d79-9f8a-47c4-bb35-1b210abb1524",
      "name": "GA4 - Device Breakdown",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -544,
        496
      ]
    },
    {
      "id": "7de9e216-c86a-44b3-9ae5-1872e44e264a",
      "name": "New vs Returning Users Breakdown",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -544,
        688
      ]
    },
    {
      "id": "0ea9bb61-586a-4d25-8a15-c7b875464470",
      "name": "Weekly Monday Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -976,
        112
      ]
    },
    {
      "id": "43f5b7c2-562e-4003-9517-7022ab148529",
      "name": "Wait for All GA4 Data",
      "type": "n8n-nodes-base.merge",
      "position": [
        64,
        32
      ]
    },
    {
      "id": "404f04c1-57ff-456e-917e-62ee967655be",
      "name": "Generate AI Summary",
      "type": "@n8n/n8n-nodes-langchain.googleGemini",
      "position": [
        368,
        112
      ]
    },
    {
      "id": "b173f712-0bfe-4ec1-8ad4-ef011a7bb3a1",
      "name": "Build Report & Email HTML",
      "type": "n8n-nodes-base.code",
      "position": [
        864,
        112
      ]
    },
    {
      "id": "a50596dc-72d1-4efa-8d73-d9f9ed96d5c2",
      "name": "Send Weekly Report",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1248,
        112
      ]
    },
    {
      "id": "402d7cd9-f814-49f5-9ae9-985d2ae86492",
      "name": "GA4 - Top 5 Pages Previous Week",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -320,
        -272
      ]
    },
    {
      "id": "98a79977-3d6d-4200-ba26-4b2f59868ada",
      "name": "GA4 - Top 5 Referrals Previous Week",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -320,
        -80
      ]
    },
    {
      "id": "cec80406-03d0-4592-9646-e489216e32a7",
      "name": "GA4 - Top 5 Events Previous Week",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -320,
        112
      ]
    },
    {
      "id": "31a96f65-3ff9-47da-b6ea-62e059d636f3",
      "name": "GA4 - Top 5 Countries Previous Week",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -320,
        304
      ]
    },
    {
      "id": "7ac51236-fc7e-4e90-9ebc-44c4a897697e",
      "name": "GA4 - Device Breakdown Previous Week",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -320,
        496
      ]
    },
    {
      "id": "814f5d15-8fef-4db4-a676-deece444adb0",
      "name": "GA4 - New vs Returning Previous Week",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        -320,
        688
      ]
    },
    {
      "id": "7b51be87-b503-40e8-8516-3965f3ae013d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1888,
        -48
      ],
      "parameters": {
        "width": 544,
        "height": 480,
        "content": "## 📊 Weekly GA4 Business Intelligence Report\n\nAutomatically runs **every Monday at 8:00 AM** and delivers a fully formatted HTML performance report to stakeholders via email.\n\n**What this workflow doe"
      }
    },
    {
      "id": "3b842436-77b7-4605-8969-a9b187cbcff2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1248,
        -464
      ],
      "parameters": {
        "width": 688,
        "height": 448,
        "content": "## 📡 Google Analytics 4 — Data Nodes\n\nFetches data for 7 key categories, running both **Current Week** and **Previous Week** nodes to generate deep Week-over-Week (WoW) comparisons.\n\n**⚠️ Required: Se"
      }
    },
    {
      "id": "7e2f82c1-abb2-45ff-bfdb-d876182d3495",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        48
      ],
      "parameters": {
        "width": 512,
        "height": 288,
        "content": "## ⏰ Schedule Trigger\n\nFires every **Monday at 8:00 AM IST**.\n\n\n\n\n\n\n\n\n**To change timezone or time:**\nOpen workflow settings → change the Timezone to your preferred one.\n\nDefault timezone: Your Local "
      }
    },
    {
      "id": "d05075f0-2f6d-49ac-978f-fa03e5c90715",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -48,
        -272
      ],
      "parameters": {
        "width": 304,
        "height": 624,
        "content": "## 🔀 Merge\n\nWaits for **all GA4 data chains (14 nodes total)** to complete before passing data forward.\n\nWithout this node, Gemini and Code nodes could trigger before all GA4 data is ready - causing e"
      }
    },
    {
      "id": "b4fa1e17-e992-49f6-9264-65a8e2569f47",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -272
      ],
      "parameters": {
        "width": 416,
        "height": 624,
        "content": "## 🤖 Gemini — AI Executive Summary\n\nGenerates a **3-paragraph executive summary** covering overall performance, audience behaviour, and actionable recommendations. It analyzes the full Week-over-Week "
      }
    },
    {
      "id": "130b47cc-f010-46a4-b926-340d8237ec7f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        -272
      ],
      "parameters": {
        "width": 432,
        "height": 624,
        "content": "## 🧮 Code Node — Data Processing + Email Builder\n\nDoes 4 things:\n1. Pulls data from all 14 GA4 nodes and Gemini by node name.\n2. Calculates week-over-week % changes for **every single section** (Overv"
      }
    },
    {
      "id": "8c2b8818-4b6f-460b-9896-5d13240bd3fb",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1152,
        -272
      ],
      "parameters": {
        "width": 288,
        "height": 624,
        "content": "## 📧 Send Email\n\nSends the HTML report to all recipients defined in the Code node.\n\n**Fields mapped from Code node output:**\n- To → {{ $json.recipients }}\n- Subject → {{ $json.subject }}\n- HTML Body →"
      }
    }
  ],
  "connections": {
    "GA4 - Top 5 Pages": {
      "main": [
        [
          {
            "node": "GA4 - Top 5 Pages Previous Week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GA4 - Top 5 Events": {
      "main": [
        [
          {
            "node": "GA4 - Top 5 Events Previous Week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate AI Summary": {
      "main": [
        [
          {
            "node": "Build Report & Email HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GA4 - Top 5 Countries": {
      "main": [
        [
          {
            "node": "GA4 - Top 5 Countries Previous Week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GA4 - Top 5 Referrals": {
      "main": [
        [
          {
            "node": "GA4 - Top 5 Referrals Previous Week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait for All GA4 Data": {
      "main": [
        [
          {
            "node": "Generate AI Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Monday Trigger": {
      "main": [
        [
          {
            "node": "GA4 - Overview Current Week",
            "type": "main",
            "index": 0
          },
          {
            "node": "GA4 - Top 5 Pages",
            "type": "main",
            "index": 0
          },
          {
            "node": "GA4 - Top 5 Referrals",
            "type": "main",
            "index": 0
          },
          {
            "node": "GA4 - Top 5 Events",
            "type": "main",
            "index": 0
          },
          {
            "node": "GA4 - Top 5 Countries",
            "type": "main",
            "index": 0
          },
          {
            "node": "GA4 - Device Breakdown",
            "type": "main",
            "index": 0
          },
          {
            "node": "New vs Returning Users Breakdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GA4 - Device Breakdown": {
      "main": [
        [
          {
            "node": "GA4 - Device Breakdown Previous Week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Report & Email HTML": {
      "main": [
        [
          {
            "node": "Send Weekly Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GA4 - Overview Current Week": {
      "main": [
        [
          {
            "node": "GA4 - Overview Previous Week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GA4 - Overview Previous Week": {
      "main": [
        [
          {
            "node": "Wait for All GA4 Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GA4 - Top 5 Pages Previous Week": {
      "main": [
        [
          {
            "node": "Wait for All GA4 Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "GA4 - Top 5 Events Previous Week": {
      "main": [
        [
          {
            "node": "Wait for All GA4 Data",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "New vs Returning Users Breakdown": {
      "main": [
        [
          {
            "node": "GA4 - New vs Returning Previous Week",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GA4 - Top 5 Countries Previous Week": {
      "main": [
        [
          {
            "node": "Wait for All GA4 Data",
            "type": "main",
            "index": 4
          }
        ]
      ]
    },
    "GA4 - Top 5 Referrals Previous Week": {
      "main": [
        [
          {
            "node": "Wait for All GA4 Data",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "GA4 - Device Breakdown Previous Week": {
      "main": [
        [
          {
            "node": "Wait for All GA4 Data",
            "type": "main",
            "index": 5
          }
        ]
      ]
    },
    "GA4 - New vs Returning Previous Week": {
      "main": [
        [
          {
            "node": "Wait for All GA4 Data",
            "type": "main",
            "index": 6
          }
        ]
      ]
    }
  }
}