



I built an n8n workflow that turns trending YouTube videos into 7 ready-to-post content ideas every week (fully automated)
Been meaning to solve my own content problem, so I built this in n8n over the weekend. Sharing the setup in case it's useful to anyone.
What it does: every Monday it pulls the most-viewed YouTube videos in my niche, has an AI model break down why each one worked (hook type, emotional trigger, format), then generates 7 original content ideas — each with a hook line, format, structure, and caption starter — and drops them as clean rows into a Google Sheet. Also pings me on Telegram when it's done.
The pipeline:
Schedule Trigger (weekly)
YouTube Data API → most-viewed videos in-niche (free, official API)
Code node → rank + prep the top 10
OpenAI (gpt-4o-mini) → analyze the viral patterns
OpenAI → generate 7 structured ideas as JSON
Code node → split JSON into one row per idea
Google Sheets (append) + Telegram (notify)
Stuff I learned the hard way:
Started with Reddit as the source but n8n Cloud's shared IPs get 403'd on anonymous requests — switched to the YouTube Data API and it's honestly better data (real view counts = a cleaner viral signal).
Ask the AI for JSON, not a markdown table — a table dumps into one ugly cell; JSON split into rows gives you clean columns.
gpt-4o-mini is more than enough for this and keeps the cost basically nothing.
Runs completely hands-off now. Happy to share more detail on any node if anyone wants to build their own.