{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "e0eae618-d330-4b74-b5a4-528a28ec91c6",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1260,
        220
      ],
      "parameters": {
        "color": 4,
        "width": 480,
        "height": 740,
        "content": "=======================================\n            \uc6cc\ud06c\ud50c\ub85c\uc6b0 \uc9c0\uc6d0\n=======================================\n\uc9c8\ubb38\uc774\ub098 \uc9c0\uc6d0\uc774 \ud544\uc694\ud558\uc2e0 \uacbd\uc6b0, \ub2e4\uc74c\uc744 \uc5f0\ub77d\ud574 \uc8fc\uc138\uc694:\n    Yaron@nofluff.online\n\n\ub354 \ub9ce\uc740 \ud301\uacfc \ud29c\ud1a0\ub9ac\uc5bc\uc744 \uc5ec\uae30\uc5d0\uc11c \ud0d0\uc0c9\ud558\uc138\uc694:\n   - YouTube: https://www.youtube.com/@YaronBeen/videos\n   - LinkedIn: https://www.linkedin.com/in/yaronbeen/\n======================================="
      },
      "typeVersion": 1
    },
    {
      "id": "e73f0186-b1a7-4ab9-a23e-94a38d51f8bb",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -640,
        420
      ],
      "parameters": {
        "color": 2,
        "width": 350,
        "height": 820,
        "content": "# \ud83d\udcca YouTube Comment Analyzer Workflow\n\n**\ubaa9\uc801:** YouTube \ub313\uae00 \uc218\uc9d1, \uac10\uc815 \ubd84\uc11d, \ubc0f \uc774\uba54\uc77c \ubcf4\uace0\ub97c \uc790\ub3d9\ud654\n\n**\uc77c\uc815:** \uc0c8\ub85c\uc6b4/\uc5c5\ub370\uc774\ud2b8\ub41c \ud589\uc5d0 \ub300\ud574 \ub9e4 \ubd84\ub9c8\ub2e4 \ud2b8\ub9ac\uac70\n\n**\ud544\uc694\ud55c \uc124\uc815:**\n1. \ube44\ub514\uc624 ID\uac00 \uc788\ub294 Google Sheet\n2. YouTube API \uc790\uaca9 \uc99d\uba85\n3. OpenAI API \ud0a4\n4. Gmail \uacc4\uc815\n\n## \uc6cc\ud06c\ud50c\ub85c\uc6b0 \ub2e8\uacc4:\n1. **\ud2b8\ub9ac\uac70** - Google Sheet \ubaa8\ub2c8\ud130\ub9c1\n2. **\ud544\ud130** - 'Pending' \ube44\ub514\uc624\ub9cc \ucc98\ub9ac\n3. **\uac00\uc838\uc624\uae30** - \ube44\ub514\uc624 \uc138\ubd80 \uc815\ubcf4 \ubc0f \ub313\uae00 \uac00\uc838\uc624\uae30\n4. **\ubd84\uc11d** - AI \uac10\uc815 \ubd84\uc11d\n5. **\ubcf4\uace0** - \uc774\uba54\uc77c \uc694\uc57d \ubcf4\ub0b4\uae30\n6. **\uc5c5\ub370\uc774\ud2b8** - \ucc98\ub9ac\ub428\uc73c\ub85c \ud45c\uc2dc"
      },
      "typeVersion": 1
    },
    {
      "id": "606f8cb5-54a5-4a90-be41-089d7ccae72f",
      "name": "Trigger Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -260,
        320
      ],
      "parameters": {
        "color": 3,
        "width": 380,
        "height": 340,
        "content": "## \ud83d\ude80 \ud2b8\ub9ac\uac70 \uc139\uc158\n\n**Google Sheets \ud2b8\ub9ac\uac70**  \n\uc2a4\ud504\ub808\ub4dc\uc2dc\ud2b8\ub97c \ub9e4 \ubd84 \ubaa8\ub2c8\ud130\ub9c1\ud558\uc5ec:  \n- \uc0c8 \ube44\ub514\uc624 ID \ucd94\uac00\ub428  \n- \uc0c1\ud0dc\uac00 'Pending'\uc73c\ub85c \ubcc0\uacbd\ub428  \n\n**\ud544\uc694\ud55c \uc2dc\ud2b8 \uad6c\uc870:**  \n| ID | \ube44\ub514\uc624 \uc81c\ubaa9 | YouTube \ube44\ub514\uc624 ID | \uc0c1\ud0dc |  \n\n\u26a0\ufe0f \uc0c1\ud0dc\ub97c 'Pending'\uc73c\ub85c \uc124\uc815\ud558\uc5ec \ubd84\uc11d\uc744 \ud2b8\ub9ac\uac70\ud558\uc138\uc694"
      },
      "typeVersion": 1
    },
    {
      "id": "f225b68e-272e-4414-82c2-2f79cfbcc381",
      "name": "YouTube API Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        440
      ],
      "parameters": {
        "width": 280,
        "height": 200,
        "content": "## \ud83d\udcf9 YouTube \ub370\uc774\ud130 \uc218\uc9d1\n\n**\uc774 \uc139\uc158\uc5d0\uc11c \uac00\uc838\uc635\ub2c8\ub2e4:**\n- \ube44\ub514\uc624 \uba54\ud0c0\ub370\uc774\ud130 (\uc81c\ubaa9, \ucc44\ub110)\n- \uc0c1\uc704 100\uac1c \ub313\uae00\n- \ub313\uae00 \ud1b5\uacc4\n\n**API \uc81c\ud55c:**\n- \uc694\uccad\ub2f9 \ucd5c\ub300 100\uac1c \ub313\uae00\n- \uad00\ub828\uc131\uc5d0 \ub530\ub77c \uc815\ub82c\ub428\n- \ucd5c\uc0c1\uc704 \ub313\uae00\ub9cc"
      },
      "typeVersion": 1
    },
    {
      "id": "628d65ff-007c-4b7a-862e-64158fa80e7c",
      "name": "AI Analysis Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1300,
        420
      ],
      "parameters": {
        "color": 5,
        "width": 320,
        "height": 250,
        "content": "## \ud83e\udd16 AI \ubd84\uc11d \uc139\uc158\n\n**GPT-4o\uac00 \ub313\uae00\uc744 \ubd84\uc11d\ud558\ub294 \ub0b4\uc6a9:**\n1. \uac10\uc815 \ubd84\ub958 (\uae0d\uc815/\ubd80\uc815/\uc911\ub9bd)\n2. \uc8fc\uc694 \ud14c\ub9c8 \ubc0f \uc8fc\uc81c\n3. \uc77c\ubc18\uc801\uc778 \uc2dc\uccad\uc790 \uc9c8\ubb38\n4. \uc8fc\uc694 \ud53c\ub4dc\ubc31 \ud3ec\uc778\ud2b8\n5. \ud589\ub3d9 \uac00\ub2a5\ud55c \ud1b5\ucc30\n\n**\ucd9c\ub825 \ud615\uc2dd:** \ubc11\uc904 \ud0a4\ub97c \uc0ac\uc6a9\ud55c \uad6c\uc870\ud654\ub41c JSON\n\n\ud83d\udca1 \ub2e4\uc591\ud55c \ubd84\uc11d \uc694\uad6c\uc0ac\ud56d\uc5d0 \ub9de\uac8c AI Agent \ub178\ub4dc\uc5d0\uc11c \ud504\ub86c\ud504\ud2b8\ub97c \ucee4\uc2a4\ud130\ub9c8\uc774\uc988\ud558\uc138\uc694"
      },
      "typeVersion": 1
    },
    {
      "id": "85b58261-88e1-499a-a082-548713da293e",
      "name": "Email & Status Update",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1820,
        460
      ],
      "parameters": {
        "color": 4,
        "width": 300,
        "height": 220,
        "content": "## \ud83d\udce7 \uc774\uba54\uc77c \ubc0f \uc5c5\ub370\uc774\ud2b8 \uc139\uc158\n\n**\uc774\uba54\uc77c \ubcf4\uace0\uc11c\uc5d0\ub294 \ub2e4\uc74c\uc774 \ud3ec\ud568\ub429\ub2c8\ub2e4:**\n- \ube44\ub514\uc624 \ud1b5\uacc4\n- \uac10\uc815 \ubd84\uc11d\n- \uc8fc\uc694 \uc778\uc0ac\uc774\ud2b8\n- \ud615\uc2dd\ud654\ub41c HTML\n\n**\ucd5c\uc885 \ub2e8\uacc4:**\nGoogle Sheet \uc0c1\ud0dc\ub97c '\uba54\uc77c \ubc1c\uc1a1\ub428'\uc73c\ub85c \uc5c5\ub370\uc774\ud2b8\ud558\uc5ec \uc911\ubcf5 \ucc98\ub9ac\ub97c \ubc29\uc9c0\ud569\ub2c8\ub2e4\n\n\u26a0\ufe0f Gmail \ub178\ub4dc\uc5d0\uc11c \uc218\uc2e0\uc790 \uc774\uba54\uc77c\uc744 \uc5c5\ub370\uc774\ud2b8\ud558\uc138\uc694"
      },
      "typeVersion": 1
    },
    {
      "id": "e0ba6c37-8b04-406b-9158-aef610274135",
      "name": "Data Processing Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1060,
        900
      ],
      "parameters": {
        "color": 6,
        "width": 250,
        "height": 180,
        "content": "\u26a0\ufe0f **\ub370\uc774\ud130 \uc900\ube44**\n\n\uc774 \ub178\ub4dc:\n- \ub313\uae00 \ud14d\uc2a4\ud2b8 \ucd94\ucd9c\n- \ud1b5\uacc4 \uacc4\uc0b0\n- \uae30\ubcf8 \uac10\uc815 \ubd84\uc11d \uc218\ud589\n- AI\ub97c \uc704\ud55c \ub370\uc774\ud130 \uc900\ube44\n\nAI \ubd84\uc11d\uc744 \uc704\ud574 \ud1a0\ud070 \uc0ac\uc6a9\uc744 \uad00\ub9ac\ud558\uae30 \uc704\ud574 50\uac1c\uc758 \ub313\uae00\ub85c \uc81c\ud55c"
      },
      "typeVersion": 1
    },
    {
      "id": "d7edbd68-9213-426b-ae6b-71a13bb23690",
      "name": "Limit",
      "type": "n8n-nodes-base.limit",
      "notes": "Limits processing to 1 item at a time to prevent API overload",
      "position": [
        220,
        700
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "42f0f581-57a0-438d-b1a1-29a89e984554",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "notes": "Uses OpenAI GPT-4o to analyze comments and generate insights. Customize the prompt for different analysis needs.",
      "position": [
        1320,
        700
      ],
      "parameters": {
        "text": "=Analyze these comments from the video \"{{ $json.videoTitle }}\":\n\nTotal Comments: {{ $json.totalComments }}\nAverage Likes: {{ $json.avgLikes }}\n\nComments to analyze:\n{{ $json.commentTexts }}",
        "options": {
          "maxIterations": 100,
          "systemMessage": "You are a YouTube comment analyst. Analyze the provided comments and return a structured analysis with:\n1. Overall sentiment breakdown (positive/negative/neutral percentages)\n2. Top 3-5 main themes or topics discussed\n3. Common questions from viewers\n4. Key feedback points and suggestions\n5. Actionable insights for content improvement\n\nFormat your response in clear sections with headers in json key value format and use underscore in the key name. Always use following keys for output json: \n1. overall_sentiment_breakdown\n2. main_themes\n3. common_questions\n4. key_feedback_points\n5. actionable_insights"
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "35abbd58-e69a-4d86-963e-0a758aaff7b2",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1420,
        920
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {
          "responseFormat": "json_object"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "747fb13b-ee39-4dd7-8338-8db07e3b568e",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "notes": "Filters rows to process only videos with 'Pending' status",
      "position": [
        0,
        700
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "5f1eae10-5270-4e99-8627-597e3451c82c",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.Status }}",
              "rightValue": "Pending"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6895d6b4-4ae4-4092-9302-33b1c69167d6",
      "name": "Set Video Details",
      "type": "n8n-nodes-base.set",
      "notes": "Prepares video ID and sets max comments limit (100)",
      "position": [
        440,
        700
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "219795ef-daa4-4444-9865-c5d3856be63b",
              "name": "videoId",
              "type": "string",
              "value": "={{ $json['Youtube video id'] }}"
            },
            {
              "id": "cd4f519d-4c84-496c-8974-29ef69c890fc",
              "name": "maxComments ",
              "type": "number",
              "value": 100
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "df200d75-d932-4bb4-9e57-16a940963db3",
      "name": "Get Youtube Video Details",
      "type": "n8n-nodes-base.youTube",
      "notes": "Fetches video metadata including title, channel name, and other details",
      "position": [
        660,
        700
      ],
      "parameters": {
        "options": {},
        "videoId": "={{ $json.videoId }}",
        "resource": "video",
        "operation": "get"
      },
      "typeVersion": 1
    },
    {
      "id": "5346229d-9386-497b-99c7-192e75896bf2",
      "name": "Get Youtube Video Comments",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "Retrieves top 100 comments ordered by relevance using YouTube API",
      "position": [
        880,
        700
      ],
      "parameters": {
        "url": "https://www.googleapis.com/youtube/v3/commentThreads",
        "options": {},
        "sendQuery": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "part",
              "value": "snippet"
            },
            {
              "name": "videoId",
              "value": "={{ $('Set Video Details').item.json.videoId }}"
            },
            {
              "name": "maxResults",
              "value": "100"
            },
            {
              "name": "order",
              "value": "relevance"
            }
          ]
        },
        "nodeCredentialType": "youTubeOAuth2Api"
      },
      "typeVersion": 4.2
    },
    {
      "id": "ffee99ec-ad6d-4ac9-b0ad-e466a18ad7de",
      "name": "Prepare Comments Data",
      "type": "n8n-nodes-base.code",
      "notes": "Processes raw comments: extracts text, calculates stats, performs basic sentiment analysis, limits to 50 comments for AI",
      "position": [
        1100,
        700
      ],
      "parameters": {
        "jsCode": "// Get comments from HTTP Request node\nconst comments = $input.first().json.items\n//const comments = response.items || [];\n\n// Get video title from the YouTube node (step 5)\n//const videoData = ;\nconst videoTitle = $('Get Youtube Video Details').first().json.snippet.title;\n\n// Extract comment data\nconst processedComments = comments.map(item => {\n  const comment = item.snippet.topLevelComment.snippet;\n  return {\n    text: comment.textDisplay,\n    author: comment.authorDisplayName,\n    likes: comment.likeCount || 0,\n    publishedAt: comment.publishedAt,\n    replyCount: item.snippet.totalReplyCount || 0\n  };\n});\n\n// Calculate statistics\nconst totalComments = processedComments.length;\nconst totalLikes = processedComments.reduce((sum, c) => sum + c.likes, 0);\nconst avgLikes = totalComments > 0 ? (totalLikes / totalComments).toFixed(2) : 0;\nconst totalReplies = processedComments.reduce((sum, c) => sum + c.replyCount, 0);\n\n// Get top comments by likes\nconst topComments = processedComments\n  .sort((a, b) => b.likes - a.likes)\n  .slice(0, 5);\n\n// Prepare comment texts for AI analysis\nconst commentTexts = processedComments\n  .slice(0, 50) // Limit to 50 comments for AI analysis\n  .map(c => c.text)\n  .join('\\n---\\n');\n\n// Basic sentiment analysis (count positive/negative keywords)\nconst positiveWords = ['love', 'great', 'awesome', 'amazing', 'excellent', 'good', 'fantastic', 'helpful', 'thanks'];\nconst negativeWords = ['hate', 'terrible', 'awful', 'bad', 'worst', 'horrible', 'useless', 'waste'];\n\nlet positiveCount = 0;\nlet negativeCount = 0;\n\nprocessedComments.forEach(comment => {\n  const lowerText = comment.text.toLowerCase();\n  positiveWords.forEach(word => {\n    if (lowerText.includes(word)) positiveCount++;\n  });\n  negativeWords.forEach(word => {\n    if (lowerText.includes(word)) negativeCount++;\n  });\n});\n\nreturn [{\n  json: {\n    videoTitle,\n    totalComments,\n    avgLikes,\n    totalReplies,\n    topComments,\n    commentTexts,\n    processedComments,\n    sentimentCounts: {\n      positive: positiveCount,\n      negative: negativeCount,\n      neutral: totalComments - positiveCount - negativeCount\n    }\n  }\n}];\n\n"
      },
      "typeVersion": 2
    },
    {
      "id": "7eab55e1-e9e2-4750-a07d-f02941c7a8c6",
      "name": "Prepare HTML for Email",
      "type": "n8n-nodes-base.code",
      "notes": "Converts AI analysis into formatted HTML email with statistics, insights, and professional styling",
      "position": [
        1700,
        700
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const output = JSON.parse($json.output)\n //return output; \n//return output.overall_sentiment_breakdown.Positive;\n\nlet common_question = \"\";\n  \noutput.common_questions.map(rec => {\n  return common_question += \"<li>\"+rec.trim().replace(new RegExp(\".*,$\"), \"\")+\"</li>\"\n})\n\nlet key_feedback_points_and_suggestions = \"\";\n\noutput.key_feedback_points.map(rec => {\n  return key_feedback_points_and_suggestions += \"<li>\"+rec.trim().replace(new RegExp(\".*,$\"), \"\")+\"</li>\"\n})\n\n\nlet actionable_insights_for_content_improvement = \"\"\n\noutput.actionable_insights.map(rec => {\n  return actionable_insights_for_content_improvement += \"<li>\"+rec.trim().replace(new RegExp(\".*,$\"), \"\")+\"</li>\"\n})\n\n\n// return {common_question};\n\n\n     \n\n//return output; \n// Generate the email HTML\nconst emailHTML = `\n<!DOCTYPE html>\n<html>\n<head>\n  <style>\n    body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }\n    .header { background: #f4f4f4; padding: 20px; border-radius: 5px; }\n    .section { margin: 20px 0; }\n    .stats { background: #e9ecef; padding: 15px; border-radius: 5px; }\n    .analysis { background: #f8f9fa; padding: 20px; border-radius: 5px; }\n    h2 { color: #2c3e50; }\n    h3 { color: #34495e; }\n    h4 { color: #7f8c8d; }\n    .footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid #ddd; color: #666; font-size: 0.9em; }\n  </style>\n</head>\n<body>\n  <div class=\"header\">\n    <h2>YouTube Comments Analysis Report</h2>\n    <h3>Video: ${$(\"Prepare Comments Data\").item.json.videoTitle}</h3>\n  </div>\n\n  <div class=\"section stats\">\n    <h3> Quick Statistics</h3>\n    <ul>\n      <li><strong>Total Comments Analyzed:</strong> ${$('Prepare Comments Data').item.json.totalComments}</li>\n      <li><strong>Average Likes per Comment:</strong> ${$('Prepare Comments Data').item.json.avgLikes}</li>\n      <li><strong>Total Replies:</strong> ${$('Prepare Comments Data').item.json.totalReplies}</li>\n      <li><strong>Sentiment Summary:</strong> \n        Positive: ${output.overall_sentiment_breakdown.positive}, \n        Negative: ${output.overall_sentiment_breakdown.negative}, \n        Neutral: ${output.overall_sentiment_breakdown.neutral}\n      </li>\n    </ul>\n  </div>\n\n  <div class=\"section stats\">\n    <h3>Common Questions</h3>\n    <ul>\n      ${common_question}\n    </ul>\n  </div>\n\n    <div class=\"section stats\">\n    <h3>Key feedback points and suggestions</h3>\n    <ul>\n      ${key_feedback_points_and_suggestions}\n    </ul>\n  </div>\n\n\n  <div class=\"section stats\">\n    <h3>Actionable insights for content improvement</h3>\n    <ul>\n      ${actionable_insights_for_content_improvement}\n    </ul>\n  </div>\n\n\n\n\n  <div class=\"footer\">\n    <p><em>Report generated on ${new Date().toLocaleString()}</em></p>\n    \n  </div>\n</body>\n</html>`;\n\n\n// Return the formatted data\nreturn  {\n  json: {\n    emailHTML,\n    subject: `YouTube Analysis: ${$('Prepare Comments Data').item.json.videoTitle} - ${$('Prepare Comments Data').item.json.totalComments} comments analyzed`,\n    videoTitle: $('Prepare Comments Data').item.json.videoTitle\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "f789c4e0-813b-4f6d-9584-86a274fba969",
      "name": "Gmail Account Configuration",
      "type": "n8n-nodes-base.gmail",
      "notes": "Sends formatted analysis report via Gmail. Update SENDER_EMAIL_ADDRESS with actual recipient",
      "position": [
        1920,
        700
      ],
      "parameters": {
        "sendTo": "SENDER_EMAIL_ADDRESS",
        "message": "={{ $json.emailHTML }}",
        "options": {},
        "subject": "={{ $json.subject }}"
      },
      "typeVersion": 2.1
    },
    {
      "id": "309d2e7d-2da0-439b-b2ac-87196d9f5733",
      "name": "Update Status on Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "notes": "Updates video status to 'Mail Sent' to prevent duplicate processing",
      "position": [
        2140,
        700
      ],
      "parameters": {
        "columns": {
          "value": {
            "Id": "={{ $('Pick Video Ids from Google sheet').item.json.Id }}",
            "Status": "Mail Sent"
          },
          "schema": [
            {
              "id": "Id",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Youtube video id",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Youtube video id",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Id"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "GOOGLE_DRIVE_URL",
          "cachedResultName": "Youtube_Video "
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1qe6Ovp_pfmwZA2k5c7LmmZx-OKqv3hnu8Dg80Pw4KoY",
          "cachedResultUrl": "GOOGLE_DRIVE_URL",
          "cachedResultName": "Youtube_Video"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "b62a4e3a-c843-4ed2-9ee4-cbfb1a218259",
      "name": "Pick Video Ids from Google sheet",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "notes": "Triggers on new YouTube videos added to spreadsheet. Polls every minute for changes",
      "position": [
        -220,
        700
      ],
      "parameters": {
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "GOOGLE_DRIVE_URL",
          "cachedResultName": "Youtube_Video "
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1qe6Ovp_pfmwZA2k5c7LmmZx-OKqv3hnu8Dg80Pw4KoY",
          "cachedResultUrl": "GOOGLE_DRIVE_URL",
          "cachedResultName": "Youtube_Video"
        }
      },
      "typeVersion": 1
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}