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
Node types used
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
- 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.
- 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.
- 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.
- 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.
- Thumbnail Analysis
- Evaluate your video thumbnails by submitting the URL through the OpenAI API to gain insights into their effectiveness.
- 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:
- OpenAI Chat Model (OpenAI Chat Model)
- get_channel_details (Call n8n Workflow Tool)
- get_video_description (Call n8n Workflow Tool)
- get_list_of_videos (Call n8n Workflow Tool)
- get_list_of_comments (Call n8n Workflow Tool)
- search (Call n8n Workflow Tool)
- analyze_thumbnail (Call n8n Workflow Tool)
- video_transcription (Call n8n Workflow Tool)
- Postgres Chat Memory (Postgres Chat Memory)
- AI Agent (AI Agent)
- When chat message received (Chat Trigger)
- Get Comments (HTTP Request)
- Execute Workflow Trigger (Execute Workflow Trigger)
- Get Channel Details (HTTP Request)
- Get Video Description (HTTP Request)
- Edit Fields (Edit Fields (Set))
- Run Query (HTTP Request)
- Get Videos by Channel (HTTP Request)
- Response (Edit Fields (Set))
- Switch (Switch)
- Get Video Transcription (HTTP Request)
- 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
- Download the JSON file with the button above.
- 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.
- Open each node that shows a warning and select or create its credential.
- 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.