Extract insights & analyse YouTube comments via AI Agent chat n8n Workflow Template

n8n workflow template · 22 nodes · OpenAI

Extract insights & analyse YouTube comments via AI Agent chat is a free n8n workflow template that starts when a chat message is received and works with OpenAI and Postgres. It has 22 nodes, 12 of them AI nodes (OpenAI Chat Model, Call n8n Workflow Tool, Postgres Chat Memory and AI Agent). The notes inside the workflow say: “Navigating the content generation and optimization process can be complex, especially without significant audience insight. This workflow automates insights extraction from YouTube videos and comments, empowering users to create more engaging and relevant content effectively.” To run it, you add your own credentials for HTTP Query Auth, OpenAI API and Postgres.

At a glance

Trigger
Chat Trigger (When chat message received)
Nodes
22
Apps
OpenAI and Postgres
AI nodes
12
Credentials
3 types
Category
Spreadsheets, databases and docs

Apps and integrations

  • OpenAI
  • Postgres

Node types used

  • OpenAI Chat Model
  • Call n8n Workflow Tool
  • Postgres Chat Memory
  • AI Agent
  • Chat Trigger
  • HTTP Request
  • Execute Workflow Trigger
  • Edit Fields (Set)
  • Switch
  • OpenAI

How it works

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

AI Agent To Chat With Youtube

Made by Mark Shcherbakov from community 5minAI

Navigating the content generation and optimization process can be complex, especially without significant audience insight. This workflow automates insights extraction from YouTube videos and comments, empowering users to create more engaging and relevant content effectively.

The workflow integrates various APIs to gather insights from YouTube videos, enabling automated commentary analysis, video transcription, and thumbnail evaluation. The main functionalities include

  • Extracting user preferences from comments.
  • Transcribing video content for enhanced understanding.
  • Analyzing thumbnails via AI for maximum viewer engagement insights.

Setup notes

The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.

Set up steps

  1. API Setup
  • Create a Google Cloud project and enable the YouTube Data API.
  • Generate an API key for Apify.
  • Generate API key for OpenAI
  • Create all credentials in N8N - OpenAI, Apify, Google Cloud.
  1. YouTube Creator and Video Selection
  • Start by defining a request to identify top creators based on their video views.
  • Capture the YouTube video IDs for further analysis of comments and other video metrics.
  1. Comment Analysis
  • Gather comments associated with the selected videos and analyze them for user insights.
  • Implement pagination to handle the maximum comment retrieval limits in API requests.
  1. Video Transcription
  • Request transcriptions for videos of interest, ensuring to manage potential costs associated with longer video processing.
  • Utilize the insights from transcriptions to formulate content plans.
  1. Thumbnail Analysis
  • Evaluate your video thumbnails by submitting the URL through the OpenAI API to gain insights into their effectiveness.
  1. Data Management
  • Incorporate a database agent to organize video data and metrics, allowing efficient record management and future content planning.

... or watch set up video [13 min]

Replace credentials in all nodes - Apify, OpenAI, Google

Nodes in this workflow

The 22 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:

  1. OpenAI Chat Model (OpenAI Chat Model)
  2. get_channel_details (Call n8n Workflow Tool)
  3. get_video_description (Call n8n Workflow Tool)
  4. get_list_of_videos (Call n8n Workflow Tool)
  5. get_list_of_comments (Call n8n Workflow Tool)
  6. search (Call n8n Workflow Tool)
  7. analyze_thumbnail (Call n8n Workflow Tool)
  8. video_transcription (Call n8n Workflow Tool)
  9. Postgres Chat Memory (Postgres Chat Memory)
  10. AI Agent (AI Agent)
  11. When chat message received (Chat Trigger)
  12. Get Comments (HTTP Request)
  13. Execute Workflow Trigger (Execute Workflow Trigger)
  14. Get Channel Details (HTTP Request)
  15. Get Video Description (HTTP Request)
  16. Edit Fields (Edit Fields (Set))
  17. Run Query (HTTP Request)
  18. Get Videos by Channel (HTTP Request)
  19. Response (Edit Fields (Set))
  20. Switch (Switch)
  21. Get Video Transcription (HTTP Request)
  22. OpenAI (OpenAI)

Credentials you need

  • HTTP Query Auth – used by Get Channel Details, Get Comments, Get Video Description and Get Video Transcription and others
  • OpenAI API – used by OpenAI and OpenAI Chat Model
  • Postgres – used by Postgres Chat Memory

Configure your own credentials after importing. Create each credential in n8n, then select it in the node.

How to import into n8n

  1. Download the JSON file with the button above.
  2. In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
  3. Open each node that shows a warning and select or create its credential.
  4. Read the notes on the canvas, test the workflow with sample data, then activate it.

Do you need somewhere to run it? Read our guide to self-hosted n8n.

Need this customised?

We can adapt this workflow to your apps, data and process, then deploy and support it.

Contact Us