I created an agent with the AI model, Memory and then an HTTP Request Node. My goal is for the AI agent to study trends in my niche everyday and give me product ideas according to trends.
I also want the AI agent to give me all the YouTube videos that our outliers and going viral and then create scripts for me accordingly.
How can I get all that done?
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
I understand you would like to query a niche in youtube, get the outlier most performant videos and generate scripts based on those for your own videos, correct?
It would be beneficial to talk a bit with ChatGPT or Claude, as they can even help you generate a full n8n flow for importing, which you can later adjust.
Here is a general approach you could use as a starting point:
Get video data from YouTube
Use the YouTube Data API (v3) via HTTP Request node.
Query by search term (their niche keywords) or from specific channels/playlists.
Retrieve metrics like viewCount, likeCount, commentCount, publishedAt.
Detect outliers / viral candidates
Use an IF node or Function node to filter:
Videos with unusually high engagement vs. recency.
For example: views / days since upload compared to average in the dataset.
Alternative: pass the list of videos + stats into the AI agent node, and let the model decide which are “outliers.”
Generate scripts
Send the title, description, or transcript (if pulled via another tool/API) into the AI Model node.
Prompt it to produce a script for new content inspired by that viral video.
Automate daily
Add a Cron node to run once a day.
Feed results to email, Slack, or save in a database for review.
Let me know if I can provide you with something more specific or if you need more help!