Analyze YouTube comments with OpenAI and send reports via email and chat

Go to Workflow
0 views
Built by SpaGreen Creative SpaGreen Creative
Created on June 05, 2026

Description

Who it's for
This advanced n8n workflow is designed for YouTube content creators, social media managers, digital marketers, and agency owners who need a deep, automated understanding of their video performance. It acts as a virtual audience research analyst, automatically fetching video details, scraping all comments (handling pagination), and analyzing them with AI to extract sentiment, trends, and content ideas.

Features
Complete Comment Scraping**: Fetches all YouTube comments using automatic API pagination.
Telegram Control**: Start analysis directly from Telegram with Admin/User access checks and owner alerts.
Smart ID Extraction**: Detects and extracts Video ID from different message formats automatically.
AI-Powered Analysis**: Uses LangChain + OpenAI to generate insights on sentiment, audience, engagement, and content opportunities.
Multi-Format Reporting**: Sends reports in HTML/Markdown through Gmail, Telegram, and WhatsApp simultaneously.
Cloud Archiving**: Saves reports automatically to Google Drive with the video title as the document name.
Actionable Insights**: Identifies viewer pain points, keyword ideas, and optimization opportunities for future videos.

Requirements
YouTube Data API v3**: A valid Google API Key with access to the commentThreads and video resources is required for fetching data.
OpenAI API**: Required for the LangChain Agent (using models like gpt-4.1-mini) to analyze the data and generate the comprehensive report.
Telegram API**: For triggering the workflow and receiving the final report.
Gmail & Google Drive**: Google OAuth2 credentials are needed to send the report email and save the file to your drive.
Rapiwa (WhatsApp)**: API credentials to send the report via WhatsApp messages.

Important Notes
API Key Configuration**: Replace "add_your_google_API_key" in Edit Fields (Set API key) with your valid YouTube Data API key.
Telegram Setup**: Add your Admin ID and Chat ID in the Telegram message nodes for correct notifications.
Video Input**: Send a Telegram message containing VIDEO_ID, video id, or videoid to trigger the workflow.
Cost Management**: Large videos with many comments can use high OpenAI token limits since all comments are analyzed.
Permissions**: Make sure YouTube Data API v3 is enabled in your Google Cloud Project.

Support & Help
WhatsApp**: Chat on WhatsApp
Discord**: SpaGreen Community
Facebook Group**: SpaGreen Support
Website**: spagreen.net
Developer Portfolio**: Codecanyon SpaGreen

Nodes Used (6)

AI Agent
@n8n/n8n-nodes-langchain.agent
Code
n8n-nodes-base.code
Gmail
n8n-nodes-base.gmail
Google Drive
n8n-nodes-base.googleDrive
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Telegram
n8n-nodes-base.telegram