This workflow corresponds to n8n.io template #4895 — we link there as the canonical source.
This workflow follows the Agent → Gmail recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "ilZOxWFc5OLPkBYp",
"name": "AI YouTube Comment Analyser",
"tags": [],
"nodes": [
{
"id": "d895e576-7471-403a-ba97-063db41a6027",
"name": "Workflow Overview",
"type": "n8n-nodes-base.stickyNote",
"position": [
-400,
420
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "77450348-ad41-4c98-a79c-e9a397534385",
"name": "Trigger Documentation",
"type": "n8n-nodes-base.stickyNote",
"position": [
160,
160
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "305ec2f6-9839-4270-a67f-cbd2d98f8f80",
"name": "YouTube API Section",
"type": "n8n-nodes-base.stickyNote",
"position": [
820,
140
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "562dee9f-97e1-461b-9f08-762f01d77c2a",
"name": "AI Analysis Documentation",
"type": "n8n-nodes-base.stickyNote",
"position": [
-20,
1180
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "72b01eba-4f3b-402c-a0b6-1e14f5d86ac2",
"name": "Email & Status Update",
"type": "n8n-nodes-base.stickyNote",
"position": [
1160,
1180
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "39e71ccf-2905-4cb7-8fb0-02e5e320910c",
"name": "Data Processing Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
580,
1180
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "1f55320c-0470-40ab-bd96-f18d7e384a3b",
"name": "Limit",
"type": "n8n-nodes-base.limit",
"notes": "Limits processing to 1 item at a time to prevent API overload",
"position": [
540,
520
],
"parameters": {},
"typeVersion": 1
},
{
"id": "926fcced-64ae-439c-a663-cff6471ce926",
"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": [
360,
800
],
"parameters": {},
"typeVersion": 1.9
},
{
"id": "fe5ce345-896c-44bd-a27a-30f833b011ce",
"name": "If",
"type": "n8n-nodes-base.if",
"notes": "Filters rows to process only videos with 'Pending' status",
"position": [
320,
520
],
"parameters": {},
"typeVersion": 2.2
},
{
"id": "d9414e63-9564-415c-9132-9684f449e9a1",
"name": "Set Video Details",
"type": "n8n-nodes-base.set",
"notes": "Prepares video ID and sets max comments limit (100)",
"position": [
760,
520
],
"parameters": {},
"typeVersion": 3.4
},
{
"id": "8ce5e890-a245-4f0b-a861-d6a1af3184b1",
"name": "Get Youtube Video Details",
"type": "n8n-nodes-base.youTube",
"notes": "Fetches video metadata including title, channel name, and other details",
"position": [
980,
520
],
"parameters": {},
"typeVersion": 1
},
{
"id": "f38cb402-9f39-4da3-8290-97798a86b615",
"name": "Get Youtube Video Comments",
"type": "n8n-nodes-base.httpRequest",
"notes": "Retrieves top 100 comments ordered by relevance using YouTube API",
"position": [
1220,
520
],
"parameters": {},
"typeVersion": 4.2
},
{
"id": "f4b8ddfb-60d2-4a66-bdb0-a628b1c31a69",
"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": [
120,
800
],
"parameters": {},
"typeVersion": 2
},
{
"id": "4659e605-f59a-401f-90d4-3bcb3e94f9e4",
"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": [
760,
800
],
"parameters": {},
"typeVersion": 2
},
{
"id": "4b9ee8c6-6d4b-41c7-a2bd-ef5e5ecb1079",
"name": "Gmail Account Configuration",
"type": "n8n-nodes-base.gmail",
"notes": "Sends formatted analysis report via Gmail. Update SENDER_EMAIL_ADDRESS with actual recipient",
"position": [
1000,
800
],
"parameters": {},
"typeVersion": 2.1
},
{
"id": "f764fdc1-b75b-4eff-a8d7-5c72381f8fb3",
"name": "Update Status on Google Sheet",
"type": "n8n-nodes-base.googleSheets",
"notes": "Updates video status to 'Mail Sent' to prevent duplicate processing",
"position": [
1220,
800
],
"parameters": {},
"typeVersion": 4.5
},
{
"id": "7de238eb-bf67-4c47-afda-4677baba3e22",
"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": [
100,
520
],
"parameters": {},
"typeVersion": 1
},
{
"id": "fceffdda-d2b9-4986-bb1b-77959f9a1bc9",
"name": "Azure OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
"position": [
400,
1000
],
"parameters": {},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "3c2e2e01-3984-440e-96b3-be2cf56cf2ad",
"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
}
]
]
},
"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
}
]
]
},
"Azure OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"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
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Description:
Source: https://n8n.io/workflows/4895/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Transform YouTube comments into actionable insights with automated AI analysis and professional email reports.
This workflow automates the collection and analysis of YouTube comments from a video and sends a summary report via email, using Google Sheets, the YouTube API, OpenAI (GPT-4o), and Gmail.
This workflow automates the creation, rendering, approval, and posting of TikTok-style POV (Point of View) videos to Instagram, with cross-posting to Facebook and YouTube. It eliminates manual video p
This workflow is designed for marketers, content creators, agencies, and solo founders who want to publish long‑form posts with visuals on autopilot using n8n and AI agents.
🪄 Prompt To Video (MagicHour API) with Music & YouTube