Automate YouTube Comment Sentiment Analysis with OpenAI & Google Sheets
detail.loadingPreview
Streamline YouTube comment analysis. Automatically fetch comments, analyze sentiment with OpenAI, and store results in Google Sheets. Save hours on manual data processing.
🚀Ready to Deploy This Workflow?
🚀 Run Without Servers
Too complicated to set up? Run this workflow instantly on AIWord.
Run on AIWord Cloud ☁️About This Workflow
How it works
This workflow automates the process of analyzing the sentiment of YouTube comments. It begins by fetching a list of YouTube video URLs from a Google Sheet. The workflow then checks if a next_fetch_time is set and if it's before the current time to determine if new comments need to be fetched. If so, it iterates through each video URL, calling the YouTube Data API to retrieve comment threads.
The retrieved comments are then processed. Each comment's text is sent to an OpenAI Chat Model (specifically gpt-4o-mini) for sentiment analysis, categorizing it as Positive, Neutral, or Negative. The workflow ensures that only successful API responses (status code 200) proceed.
Finally, the analyzed sentiment, along with other relevant comment details (comment ID, video URL, author, likes, replies, and publication date), is formatted and appended or updated in a designated Google Sheet. The workflow also updates the last_fetched_time and calculates the next_fetch_time in another sheet to manage future fetches.
Key Nodes Used:
- Manual Trigger
- Google Sheets (Read & Write)
- IF (Conditionals)
- HTTP Request (YouTube Data API)
- Split Out
- OpenAI Chat Model (Sentiment Analysis)
- Set (Field Formatting)
- No Operation
Key Features
- Reads YouTube video URLs from Google Sheets.
- Fetches YouTube comment threads using the YouTube Data API.
- Leverages OpenAI's GPT-4o-mini for accurate sentiment analysis (Positive, Neutral, Negative).
- Appends detailed comment data and sentiment scores to a Google Sheet.
- Manages fetch scheduling with
last_fetched_timeandnext_fetch_timein Google Sheets. - Handles pagination for comment fetching.
How To Use
- Set up Google Sheets:
- Create a Google Sheet with two sheets:
- Sheet1 (Results): Columns should include
commentId,video_url,comment,authorName,likes,reply,sentiment,published_at. - Sheet2 (Video URLs): Columns should include
video_urls(YouTube video links),last_fetched_time, andnext_fetch_time.
- Sheet1 (Results): Columns should include
- Create a Google Sheet with two sheets:
- Configure Credentials:
- Google Sheets: Set up a Service Account and provide its credentials.
- YouTube Data API v3: Obtain an API key and configure it in the HTTP Request node.
- OpenAI API Key: Provide your OpenAI API key for sentiment analysis.
- Connect Nodes:
- Get Video Urls from Google Sheet: Configure with your Google Sheet document and Sheet2.
- Get Comments for video urls: Configure with your YouTube API key and ensure it correctly extracts
videoIdfrom thevideo_urls. - OpenAI Chat Model: Ensure your OpenAI API key is configured. The
systemPromptTemplateis pre-configured for sentiment analysis. - Insert and update comment in google sheet: Configure with your Google Sheet document and Sheet1 for appending/updating results.
- Update last fetched time and next_fetch_time: Configure with your Google Sheet document and Sheet2 to manage scheduling.
- Trigger Workflow:
- Use the "Manual Trigger" to run the workflow on demand, or replace it with a "Cron" node for scheduled execution.
Apps Used
Workflow JSON
{
"id": "ca629aea-1402-4a87-ba1b-dedce8196d3f",
"name": "Automate YouTube Comment Sentiment Analysis with OpenAI & Google Sheets",
"nodes": 0,
"category": "AI & LLM",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
🚀 Run Without Servers
Use our managed AI Automation Cloud. No DevOps, no errors. Start for free.
- Anti-detect Browser
- Managed Proxies
- 24/7 Uptime
Get This Workflow
ID: ca629aea-1402...
About the Author
DevOps_Master_X
Infrastructure Expert
Specializing in CI/CD pipelines, Docker, and Kubernetes automations.
Statistics
Related Integrations
- Google Sheets + Schedule Trigger(394 workflows)
- Google Sheets + Split Out(277 workflows)
- Google Sheets + Slack(268 workflows)
- Gmail + Google Sheets(245 workflows)
- Google Drive + Google Sheets(203 workflows)
- Form Trigger + Google Sheets(163 workflows)
- Google Drive + Google Drive Trigger(135 workflows)
- Google Drive + Split Out(134 workflows)
- Google Sheets + Telegram(118 workflows)
- Execute Workflow Trigger + Google Sheets(101 workflows)
Related Workflows
Discover more workflows you might like
Automate Customer Feedback Sentiment Analysis with OpenAI & Google Sheets
Auto-analyze customer feedback sentiment using OpenAI and log results to Google Sheets. Save hours analyzing feedback manually!
Auto-Extract Engaging YouTube Moments with n8n Webhook
Leverage n8n to automatically identify and extract high-intensity, engaging moments from any YouTube video via webhook. Save analysis time.
Generate Speech from Text with OpenAI TTS via Webhook
Automate text-to-speech conversion using OpenAI's TTS API triggered by a webhook. Perfect for developers and growth hackers.
Build an AI Travel Assistant with Google Drive & OpenAI
Create a custom OpenAI AI Assistant that leverages your Google Drive documents for travel planning. Automate travel advice and responses.
Auto-Transcribe YouTube Videos to Text with Supadata & OpenAI
Instantly get transcribed text from YouTube videos using Supadata API and OpenAI for structuring. Save hours on content review.
AI-Powered WordPress Post Creation: Keywords to Draft Article & Featured Image
Automate WordPress post creation. Input keywords, generate AI content, draft articles, and add featured images with DALL-E. Boost your content workflow instantly.