{
  "name": "AI YouTube analytics agent: Comment analyzer & insights reporter",
  "nodes": [
    {
      "id": "e0eae618-d330-4b74-b5a4-528a28ec91c6",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1260,
        220
      ],
      "parameters": {
        "width": 480,
        "height": 740,
        "content": "=======================================\n            WORKFLOW ASSISTANCE\n=======================================\nFor any questions or support, please contact:\n    Yaron@nofluff.online\n\nExplore more tip"
      }
    },
    {
      "id": "e73f0186-b1a7-4ab9-a23e-94a38d51f8bb",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        420
      ],
      "parameters": {
        "width": 350,
        "height": 820,
        "content": "# 📊 YouTube Comment Analyzer Workflow\n\n**Purpose:** Automate YouTube comment collection, sentiment analysis, and email reporting\n\n**Schedule:** Triggers every minute for new/updated rows\n\n**Required S"
      }
    },
    {
      "id": "606f8cb5-54a5-4a90-be41-089d7ccae72f",
      "name": "Trigger Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -260,
        320
      ],
      "parameters": {
        "width": 380,
        "height": 340,
        "content": "## 🚀 Trigger Section\n\n**Google Sheets Trigger**\nMonitors the spreadsheet every minute for:\n- New video IDs added\n- Status changes to 'Pending'\n\n**Required Sheet Structure:**\n| ID | Video Title | YouTu"
      }
    },
    {
      "id": "f225b68e-272e-4414-82c2-2f79cfbcc381",
      "name": "YouTube API Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        440
      ],
      "parameters": {
        "width": 280,
        "height": 200,
        "content": "## 📹 YouTube Data Collection\n\n**This section fetches:**\n- Video metadata (title, channel)\n- Top 100 comments\n- Comment statistics\n\n**API Limits:**\n- Max 100 comments per request\n- Ordered by relevance"
      }
    },
    {
      "id": "628d65ff-007c-4b7a-862e-64158fa80e7c",
      "name": "AI Analysis Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1300,
        420
      ],
      "parameters": {
        "width": 320,
        "height": 250,
        "content": "## 🤖 AI Analysis Section\n\n**GPT-4o analyzes comments for:**\n1. Sentiment breakdown (positive/negative/neutral)\n2. Main themes & topics\n3. Common viewer questions\n4. Key feedback points\n5. Actionable i"
      }
    },
    {
      "id": "85b58261-88e1-499a-a082-548713da293e",
      "name": "Email & Status Update",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1820,
        460
      ],
      "parameters": {
        "width": 300,
        "height": 220,
        "content": "## 📧 Email & Update Section\n\n**Email Report includes:**\n- Video statistics\n- Sentiment analysis\n- Key insights\n- Formatted HTML\n\n**Final Step:**\nUpdates Google Sheet status to 'Mail Sent' to prevent d"
      }
    },
    {
      "id": "e0ba6c37-8b04-406b-9158-aef610274135",
      "name": "Data Processing Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1060,
        900
      ],
      "parameters": {
        "width": 250,
        "height": 180,
        "content": "⚠️ **Data Preparation**\n\nThis node:\n- Extracts comment texts\n- Calculates statistics\n- Performs basic sentiment analysis\n- Prepares data for AI\n\nLimited to 50 comments for AI analysis to manage token "
      }
    },
    {
      "id": "d7edbd68-9213-426b-ae6b-71a13bb23690",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "position": [
        220,
        700
      ]
    },
    {
      "id": "42f0f581-57a0-438d-b1a1-29a89e984554",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1320,
        700
      ]
    },
    {
      "id": "35abbd58-e69a-4d86-963e-0a758aaff7b2",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1420,
        920
      ]
    },
    {
      "id": "747fb13b-ee39-4dd7-8338-8db07e3b568e",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        0,
        700
      ]
    },
    {
      "id": "6895d6b4-4ae4-4092-9302-33b1c69167d6",
      "name": "Set Video Details",
      "type": "n8n-nodes-base.set",
      "position": [
        440,
        700
      ]
    },
    {
      "id": "df200d75-d932-4bb4-9e57-16a940963db3",
      "name": "Get Youtube Video Details",
      "type": "n8n-nodes-base.youTube",
      "position": [
        660,
        700
      ]
    },
    {
      "id": "5346229d-9386-497b-99c7-192e75896bf2",
      "name": "Get Youtube Video Comments",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        880,
        700
      ]
    },
    {
      "id": "ffee99ec-ad6d-4ac9-b0ad-e466a18ad7de",
      "name": "Prepare Comments Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1100,
        700
      ]
    },
    {
      "id": "7eab55e1-e9e2-4750-a07d-f02941c7a8c6",
      "name": "Prepare HTML for Email",
      "type": "n8n-nodes-base.code",
      "position": [
        1700,
        700
      ]
    },
    {
      "id": "f789c4e0-813b-4f6d-9584-86a274fba969",
      "name": "Gmail Account Configuration",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1920,
        700
      ]
    },
    {
      "id": "309d2e7d-2da0-439b-b2ac-87196d9f5733",
      "name": "Update Status on Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2140,
        700
      ]
    },
    {
      "id": "b62a4e3a-c843-4ed2-9ee4-cbfb1a218259",
      "name": "Pick Video Ids from Google sheet",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -220,
        700
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Limit",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit": {
      "main": [
        [
          {
            "node": "Set Video Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Prepare HTML for Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Set Video Details": {
      "main": [
        [
          {
            "node": "Get Youtube Video Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Comments Data": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare HTML for Email": {
      "main": [
        [
          {
            "node": "Gmail Account Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Youtube Video Details": {
      "main": [
        [
          {
            "node": "Get Youtube Video Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Youtube Video Comments": {
      "main": [
        [
          {
            "node": "Prepare Comments Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Account Configuration": {
      "main": [
        [
          {
            "node": "Update Status on Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pick Video Ids from Google sheet": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}