YouTube Comment Analysis Automation with n8n & OpenAI
This workflow automates deep analysis of YouTube video details and comments, delivering creators actionable insights and sentiment reports. Save hours by generating detailed video performance and audience engagement reports automatically.
This workflow takes a YouTube video ID and an API key. It collects the video details and up to 100 comments. Then it studies comment feelings and topics using OpenAI. Finally, it makes a clear report with suggestions. The report is sent by email and saved on Google Drive.
This saves lots of time. It helps video makers see what viewers think without reading all comments by hand. It shows if people like or dislike the video. It also shows what viewers talk about the most. This helps make better videos next time.
Who Should Use This Workflow
People who make YouTube videos and want to know viewer opinions fast. Anyone who finds reading many comments slow and hard. Users who want clear advice for improving videos. It is also good for those who want automatic reports sent by email.
Verify OpenAI API details are set in the AI nodes.
Test and Activate
Run the workflow manually to check it works. Watch for errors.
Look at the generated report email you receive and the saved file.
If all is good, activate the workflow to run automatically or on schedule.
Workflow Inputs, Processing, and Outputs
Input
Google API Key used to call YouTube Data API.
YouTube Video ID to identify which video to analyze.
Processing Steps
Build YouTube API URLs using the video ID and API key.
Retrieve video details (title, views, likes, topics).
Fetch up to 100 comments using pagination to get all pages.
Merge all data into one JSON object.
Send combined data to OpenAI GPT model for analysis.
Generate a detailed Markdown report covering sentiment, themes, recommendations.
Convert Markdown to HTML for nice formatting.
Email report via Gmail.
Save report copy to Google Drive.
Output
A structured report with video insights and viewer feedback.
Email sent to configured addresses.
Report file saved as archive on Google Drive.
Key Code Examples in Workflow
Below is the JavaScript code snippet that builds the YouTube API URL dynamically using input variables. You can copy it into the Create YouTube API URL code node.
This code makes the URL for fetching video details. The variables must match what you set in Workflow Variables.
Another important snippet handles comment pagination. It requests each page of comments until reaching around 100 total. Use in the Get Video Comments with Pagination code node.
Use other OpenAI models like GPT-4 by switching in YouTube Video Report Agent node.
Add more YouTube API parts, for example, liveStreamingDetails for live stats.
Troubleshooting
Video ID missing error: Add a valid VIDEO_ID in Workflow Variables.
Google API Key missing error: Make sure the GOOGLE_API_KEY is correct and set.
Comments incomplete: Use full pagination code to fetch all pages.
Report incomplete or off: Check data merge nodes to confirm full details and comments go to AI.
Pre-Production Checklist
Google API Key works and has YouTube Data API enabled.
Gmail OAuth2 credentials can send test emails.
Test video ID fetches details and comments correctly.
OpenAI credentials work and give expected responses.
Output report looks good after Markdown to HTML conversion.
Deployment Guide
Activate the workflow in n8n by setting it to active. Run manually first to test each part. Schedule with cron or connect to other triggers if needed. Watch workflow logs for errors. Reports will then be sent via email and saved automatically.
← Back to All Workflows
YouTube Comment Analysis Automation with n8n & OpenAI
Press CTRL+F5 if the workflow didn't load.
What This Workflow Does
This workflow takes a YouTube video ID and an API key. It collects the video details and up to 100 comments. Then it studies comment feelings and topics using OpenAI. Finally, it makes a clear report with suggestions. The report is sent by email and saved on Google Drive.
This saves lots of time. It helps video makers see what viewers think without reading all comments by hand. It shows if people like or dislike the video. It also shows what viewers talk about the most. This helps make better videos next time.
Who Should Use This Workflow
People who make YouTube videos and want to know viewer opinions fast. Anyone who finds reading many comments slow and hard. Users who want clear advice for improving videos. It is also good for those who want automatic reports sent by email.
Tools and Services Needed
If using self hosting n8n, see self-host n8n. This helps full control without cloud service limits.
Beginner Step-by-Step: How to Use This Workflow in n8n
Download and Import
Configure Credentials and Variables
GOOGLE_API_KEY.VIDEO_ID.Test and Activate
Workflow Inputs, Processing, and Outputs
Input
Processing Steps
Output
Key Code Examples in Workflow
Below is the JavaScript code snippet that builds the YouTube API URL dynamically using input variables. You can copy it into the Create YouTube API URL code node.
This code makes the URL for fetching video details. The variables must match what you set in Workflow Variables.
Another important snippet handles comment pagination. It requests each page of comments until reaching around 100 total. Use in the Get Video Comments with Pagination code node.
This ensures all wanted comments load fully before analysis.
Customizations
VIDEO_IDin Workflow Variables to analyze other videos.maxResultsin comment fetch code to get fewer or more comments.liveStreamingDetailsfor live stats.Troubleshooting
VIDEO_IDin Workflow Variables.GOOGLE_API_KEYis correct and set.Pre-Production Checklist
Deployment Guide
Activate the workflow in n8n by setting it to active. Run manually first to test each part. Schedule with cron or connect to other triggers if needed. Watch workflow logs for errors. Reports will then be sent via email and saved automatically.
Summary ✓
✓ Saves hours by automating YouTube comment reading and analysis.
✓ Gives clear, easy-to-understand reports about video and viewer feedback.
✓ Sends reports automatically by email and keeps copies safe on Google Drive.
→ Helps creators understand viewers better to make improved content.
Visit through Desktop to Interact with the Workflow.
Frequently Asked Questions
Get Self-Host n8n
Why Pay $20/month, When you can Self Host n8n @ $3.99 only
2 Months of Sales Navigator 👉 FREE
50+ InMails. Advanced Lead search. First 2 Users only
10,000+ n8n Workflows to Download & Learn Building
There’s no automation you can’t learn to build with BULDRR AI.
1:1 - Meeting FREE
I'll show how you can implement AI AGENTS to take over repetitive tasks.
Promoted by BULDRR AI
Learn by Category
Related Workflows
Automate Twist Channel Creation and Messaging with n8n
Automate Ideogram Image Generation with Google Sheets & Gmail
Automate IT Support with Slack and OpenAI in n8n
Automate Crypto Analysis with CoinMarketCap & n8n AI Agent
Automate Gumroad to Beehiiv Subscriber Sync with n8n
Generate On-Brand Blog Articles Using n8n and OpenAI
Browse by Apps