{
  "name": "Generate an AI YouTube trend report with GPT-4o, Google Sheets and PDF.co",
  "nodes": [
    {
      "id": "c966d5d6-91be-4d8a-a410-97bbd932c260",
      "name": "Weekly Schedule",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1008,
        800
      ]
    },
    {
      "id": "b3106b1c-1bb1-4131-9d7f-52c1227be8e2",
      "name": "Set Keywords",
      "type": "n8n-nodes-base.code",
      "position": [
        1232,
        800
      ]
    },
    {
      "id": "ad050a78-3bc9-4534-afeb-bcc8000b9425",
      "name": "Search YouTube",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1520,
        800
      ]
    },
    {
      "id": "8a109781-1977-4c9b-8c3c-b49af46c2ef7",
      "name": "Flatten Videos",
      "type": "n8n-nodes-base.code",
      "position": [
        1680,
        800
      ]
    },
    {
      "id": "201072e9-278b-4340-932e-e65f5c1a4884",
      "name": "Prep ID Batches",
      "type": "n8n-nodes-base.code",
      "position": [
        1904,
        800
      ]
    },
    {
      "id": "120b67e6-37af-45ce-9fde-d75e44fa5f48",
      "name": "Get Video Stats",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2128,
        800
      ]
    },
    {
      "id": "683eecbf-6b8d-4f30-8f72-bec5a42d83b6",
      "name": "Rank Videos",
      "type": "n8n-nodes-base.code",
      "position": [
        2352,
        800
      ]
    },
    {
      "id": "1552648b-4a9f-467c-b476-7d245f1c9216",
      "name": "Prep AI Prompt",
      "type": "n8n-nodes-base.code",
      "position": [
        2576,
        800
      ]
    },
    {
      "id": "1d14b200-2927-4d25-8a84-947bfd1a68cf",
      "name": "Analyze Trends with AI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        2800,
        800
      ]
    },
    {
      "id": "d64ffc0a-590c-460b-8392-d55f06766de3",
      "name": "Setup Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        672
      ],
      "parameters": {
        "width": 912,
        "height": 576,
        "content": "---\n## Setup Guide\nFollow these steps to get started:\n1. **Set up the Trend Finder Form**\n   Customize the form fields (Topic Name, Last How Many Days) in the **Form Trigger** node. This is how users "
      }
    },
    {
      "id": "55ce5757-e8af-409a-ac80-4f5e467b78de",
      "name": "Create Analytics Spreadsheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1680,
        1152
      ]
    },
    {
      "id": "a3f94dd3-39b1-4f00-9eb7-bd544d6c9bdf",
      "name": "Finalize Spreadsheet",
      "type": "n8n-nodes-base.code",
      "position": [
        3472,
        1152
      ]
    },
    {
      "id": "ade95937-ccf1-4b8e-888c-c954b0064171",
      "name": "Setup Tabs",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1904,
        1152
      ]
    },
    {
      "id": "d8008525-452d-427a-ab28-10adcfa47402",
      "name": "Prep Channel Stats",
      "type": "n8n-nodes-base.code",
      "position": [
        2128,
        1152
      ]
    },
    {
      "id": "40a7ad17-48e2-48d1-a6ef-d3799fd8cc9d",
      "name": "Append Channel Stats",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2352,
        1152
      ]
    },
    {
      "id": "75930448-0cbd-42c4-9fe5-0d7510519ebe",
      "name": "Prep Top Videos",
      "type": "n8n-nodes-base.code",
      "position": [
        2576,
        1152
      ]
    },
    {
      "id": "7e2d7973-94d9-4208-aa4d-78d9e177c39b",
      "name": "Append Top Videos",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2800,
        1152
      ]
    },
    {
      "id": "34260714-96b0-49be-81f0-26c6290d3d1c",
      "name": "Prep Weekly Summary",
      "type": "n8n-nodes-base.code",
      "position": [
        3024,
        1152
      ]
    },
    {
      "id": "f4a8a8ba-b6b3-406c-99d0-72146f3ce831",
      "name": "Append Weekly Summary",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3248,
        1152
      ]
    },
    {
      "id": "5a6bc2b0-8371-4d83-ae78-72eec3300058",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 912,
        "height": 620,
        "content": "# AI YouTube Trend Intelligence Report\n\n### **What it does:**\nAutomatically discovers, ranks, and analyzes the top-performing AI & automation YouTube videos each week, delivering a branded PDF report "
      }
    },
    {
      "id": "dc8e53dc-324f-4d48-b472-c27801cd44e1",
      "name": "Contact & Attribution",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4048,
        0
      ],
      "parameters": {
        "width": 700,
        "height": 1268,
        "content": "## Was this helpful? Get in touch!\n\n[![clic](https://vptkuqoipqbebipqjnqw.supabase.co/storage/v1/object/public/Milo%20Bravo/seeAxWUupcOOXY5tntexZ_video.gif)](https://tally.so/r/EkKGgB)\n\nI really hope "
      }
    },
    {
      "id": "ecb358b0-a948-4563-9fa0-0616ce63bc8c",
      "name": "Section 1 - Trigger & Keywords",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        944,
        672
      ],
      "parameters": {
        "width": 492,
        "height": 304,
        "content": "## 1. Trigger & Keywords\n\nWeekly cron fires every Monday at 7 AM. The Code node defines 10 AI/automation search keywords and calculates the 7-day lookback date."
      }
    },
    {
      "id": "ee932d5f-b05c-46d8-8542-31f99f5554c4",
      "name": "Section 2 - YouTube Data Fetch",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1456,
        672
      ],
      "parameters": {
        "width": 816,
        "height": 304,
        "content": "## 2. YouTube Data Fetch\n\nSearches the YouTube Data API v3 for each keyword (50 results each), deduplicates videos, batches IDs in groups of 50, and fetches full statistics including views, likes, com"
      }
    },
    {
      "id": "921b7267-5d6c-4bbf-8bf3-aafe69eb2d22",
      "name": "Section 3 - Rank & AI Analysis",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2288,
        672
      ],
      "parameters": {
        "width": 780,
        "height": 304,
        "content": "## 3. Rank & AI Analysis\n\nRanks all videos by views, calculates engagement rates, extracts top channels and keyword distribution. Sends the top 20 videos to an AI model for trend analysis, topic detec"
      }
    },
    {
      "id": "415f05d9-f708-43fb-92c9-2c61c81db5c7",
      "name": "Section 4 - PDF Report & Email",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3104,
        672
      ],
      "parameters": {
        "width": 872,
        "height": 304,
        "content": "## 4. PDF Report & Email\n\nGenerates a branded HTML report with charts (QuickChart.io), converts to PDF via PDF.co, downloads the file, and emails it as an attachment with a Google Sheets link."
      }
    },
    {
      "id": "c40b6120-1e80-4aa1-8d07-75ce6b4a3767",
      "name": "Section 5 - Google Sheets Export",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1552,
        1056
      ],
      "parameters": {
        "width": 2100,
        "height": 272,
        "content": "## 5. Google Sheets Export\n\nCreates a new \"YouTube Analytics 2026\" spreadsheet with three tabs (Channel Stats, Top Videos, Weekly Summary), populates each with ranked data, then passes the spreadsheet"
      }
    },
    {
      "id": "d253f0d1-8222-4669-aeba-a31d5c4557ae",
      "name": "PDFco Api",
      "type": "n8n-nodes-pdfco.PDFco Api",
      "position": [
        3344,
        800
      ]
    },
    {
      "id": "3193346a-e211-445e-89ee-bf49930353c6",
      "name": "Build HTML Report1",
      "type": "n8n-nodes-base.code",
      "position": [
        3168,
        800
      ]
    },
    {
      "id": "9c5537e9-969d-40c6-abf0-99a129dedf85",
      "name": "Download PDF",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3536,
        800
      ]
    },
    {
      "id": "236876a8-2e4e-41fe-91d2-89002789cd64",
      "name": "Send Report Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3760,
        800
      ]
    }
  ],
  "connections": {
    "PDFco Api": {
      "main": [
        [
          {
            "node": "Download PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Setup Tabs": {
      "main": [
        [
          {
            "node": "Prep Channel Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rank Videos": {
      "main": [
        [
          {
            "node": "Create Analytics Spreadsheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download PDF": {
      "main": [
        [
          {
            "node": "Send Report Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Keywords": {
      "main": [
        [
          {
            "node": "Search YouTube",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Flatten Videos": {
      "main": [
        [
          {
            "node": "Prep ID Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep AI Prompt": {
      "main": [
        [
          {
            "node": "Analyze Trends with AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search YouTube": {
      "main": [
        [
          {
            "node": "Flatten Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Video Stats": {
      "main": [
        [
          {
            "node": "Rank Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep ID Batches": {
      "main": [
        [
          {
            "node": "Get Video Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Top Videos": {
      "main": [
        [
          {
            "node": "Append Top Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Schedule": {
      "main": [
        [
          {
            "node": "Set Keywords",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Top Videos": {
      "main": [
        [
          {
            "node": "Prep Weekly Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build HTML Report1": {
      "main": [
        [
          {
            "node": "PDFco Api",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Channel Stats": {
      "main": [
        [
          {
            "node": "Append Channel Stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prep Weekly Summary": {
      "main": [
        [
          {
            "node": "Append Weekly Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Channel Stats": {
      "main": [
        [
          {
            "node": "Prep Top Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Finalize Spreadsheet": {
      "main": [
        [
          {
            "node": "Prep AI Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Weekly Summary": {
      "main": [
        [
          {
            "node": "Finalize Spreadsheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Trends with AI": {
      "main": [
        [
          {
            "node": "Build HTML Report1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Analytics Spreadsheet": {
      "main": [
        [
          {
            "node": "Setup Tabs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}