Automate YouTube Insights Extraction with n8n AI Agent

Struggling to analyze YouTube video data and comments? This n8n automation workflow extracts comprehensive insights from YouTube channels and videos using APIs and AI analysis, saving hours of manual research.
agent
httpRequest
lmChatOpenAi
+14
Workflow Identifier: 1099
NODES in Use: Sticky Note, OpenAI Chat Model, Switch, Get Channel Details, Get Video Description, Get Comments, Run Query, Get Videos by Channel, analyze_thumbnail, video_transcription, OpenAI, Postgres Chat Memory, AI Agent, When chat message received, Edit Fields, Get Video Transcription, Execute Workflow Trigger

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Automation Does

This n8n workflow automates getting YouTube channel info, videos, comments, transcripts, and thumbnail analysis.

It solves the problem of wasting time collecting video data and comments manually.

The workflow saves hours and gives clear insights fast.

It uses YouTube Data API, OpenAI, and Apify to get channel details, video lists, analyze comments with sentiment, transcribe videos, and check thumbnails.

It stores chat memory in Postgres for smart conversations.

Results help content creators make better videos and grow their audience.


Inputs, Processing, and Outputs

Inputs

  • User sends a chat message with commands via webhook.
  • Channel handle, video ID, or search query included.
  • API keys for YouTube, OpenAI, and Apify configured in credentials.

Processing Steps

  • The chat trigger in the Webhook node receives message.
  • AI Agent node reads message and decides action.
  • Switch node routes command to proper YouTube API call or transcription.
  • Get Channel Details node retrieves channel ID and info by handle.
  • Run Query or Get Videos by Channel node fetch videos by channel or search terms.
  • Get Comments node gathers top comments and replies for videos.
  • Edit Fields node formats comments for easy reading.
  • Get Video Transcription node uses Apify to convert video audio to text.
  • OpenAI node analyzes thumbnails with custom prompts.
  • Postgres node manages chat history to keep conversations clear.

Outputs

  • Formatted JSON or text answers sent back to chat interface.
  • Video insights including channel data, comments with sentiment, transcripts, and thumbnail reviews.

Who Should Use This Workflow

Content creators with YouTube channels who want to understand their audience quickly can use this.

This helps marketers, strategists, or managers who want fast, reliable video data without manual work.

You do not need deep technical skills once setup is done.


Tools and Services Used

  • YouTube Data API: Gets channel, video, and comment info.
  • OpenAI: Processes chat inputs, analyzes thumbnails, and extracts sentiment.
  • Apify: Transcribes video audio to text.
  • Postgres: Stores chat session data for memory.
  • n8n: Runs the workflow with Webhook node, Switch node, and HTTP Request nodes.

Beginner Step-by-Step: How to Use This Workflow in n8n

Step 1: Import the Workflow

  1. Download the workflow JSON file using the Download button on this page.
  2. Open n8n editor where workflows are managed.
  3. Click “Import from File” and select the downloaded JSON file.

Step 2: Configure Credentials

  1. Go to Credentials in n8n.
  2. Add your API keys for Google Cloud (YouTube Data API), OpenAI, Apify, and Postgres if used.
  3. Confirm keys are correct and saved.

Step 3: Update IDs and URLs

  1. If needed, update channel handles, video URLs, or table names in input nodes.
  2. Check any prompt or JSON code snippets for placeholders and replace with your values.

Step 4: Test the Workflow

  1. Trigger the workflow by sending a sample chat message to the URL from the Webhook node.
  2. Watch the execution in n8n editor to see if data returns properly.
  3. Fix any credential or input errors if results are missing.

Step 5: Activate Workflow for Production

  1. Toggle the workflow status to ON.
  2. Use your front-end or chat system connected to the webhook URL to send real user requests.
  3. Regularly monitor API key limits and errors in n8n dashboard.
  4. If self hosting n8n, consider self-host n8n for more control and reliability.

Important Code Snippets and Prompts

Apify Video Transcription JSON Body

Paste this in the Get Video Transcription node body field to transcribe video URL from input:

{
 "startUrls": [
 "{{ $('Execute Workflow Trigger').item.json.query.video_url }}"
 ]
}

Formatting YouTube Comments (Example JavaScript)

Used in Edit Fields node to make comments readable:

items.map(item => {
  let comments = '';
  item.json.comments.forEach(comment => {
    comments += comment.author + ': ' + comment.text + '\n';
    if(comment.replies) {
      comment.replies.forEach(reply => {
        comments += '  ' + reply.author + ': ' + reply.text + '\n';
      });
    }
  });
  item.json.formattedComments = comments;
  return item;
});

Custom Prompt for Thumbnail Analysis

Set this in OpenAI node prompt field:

Analyze the thumbnail image at this URL.
Give feedback about design, colors, and how well it might catch viewers’ attention.
Suggest improvements to increase engagement.

Troubleshooting Common Issues

  • HTTP 403 Forbidden from YouTube nodes: Check if YouTube Data API is enabled and API key is valid.
  • Empty comments: Confirm video ID is correct and comments are public.
  • Transcription fails: Use public video URLs and verify Apify API key.
  • AI Agent gives wrong answers: Check OpenAI key and update prompt for clarity.

Customization Ideas

  • Change video sorting order in search nodes for top viewed or newest.
  • Add an OpenAI sentiment analysis node on comments for positive or negative feedback.
  • Update thumbnail prompt to focus on brand colors or style guides.
  • Adjust chat memory length in Postgres for longer or shorter conversations.
  • Batch process many channels by adding a loop over a channel list.

Summary of Benefits and Results

✓ The workflow automates YouTube data gathering fast.

✓ Saves hours of manual video and comment review work.

✓ Gives clear, formatted insights for better content decisions.

✓ Combines APIs and AI for an easier way to understand channel performance.

→ Users get more audience knowledge and improved video strategies.

→ Workflow runs automatically from chat messages, so data is always fresh.


Frequently Asked Questions

Download the workflow JSON, open n8n editor, use Import from File, then configure API keys and test once.
You need API keys for YouTube Data API from Google, OpenAI, Apify, and optionally Postgres database.
It sends the video URL to Apify transcription API which returns the text transcript.
OpenAI analyzes the thumbnail image URL to give feedback on design and audience appeal.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free