Templates / Create AI newsletters from YouTube with LangChain, Gemini, Apify & Gmail

Create AI newsletters from YouTube with LangChain, Gemini, Apify & Gmail

Ready for 3.0

by Pratyush Kumar Jha ✓ · 464 views · created 2026-03-12 · Social Media, Multimodal AI

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

Nodes used (13)

Structured Output ParserAI AgentGmailGoogle SheetsGoogle Gemini Chat ModelInformation Extractor

What it does

Video → Newsletter AI Agent This n8n workflow converts a YouTube video into a polished, email-ready newsletter. It scrapes the transcript, extracts a thumbnail/logo and brand color theme, uses multiple AI agents to (1) clean & summarize the transcript into three newsletter sections, (2) convert that content into a styled HTML newsletter (color-aware), then saves the draft to Google Sheets and sends the email to subscribers via Gmail. The flow is optimized for batch sending and brand-consistent HTML output. How it works (step-by-step) 1. Trigger — On form submission accepts Brand Name, Brand Website, and YouTube video link. 2. Site scrape & colour study — HTTP requests + Information Extractor → AI agent derives brand color theme (primary/secondary/accent/background). 3. Transcript retrieval — Two YouTube transcript scrapers (Apify acts) fetch the video transcript and thumbnail; a small Code node merges transcript chunks. 4. Summarization & journalism — AI Agent2 (LangChain/Gemini) cleans the transcript, extracts thesis + key points, and writes 3 newsletter sections in a journalistic tone. 5. HTML conversion — Convert Newsletter to HTML (AI) agent applies the fixed layout and injects only text color variables (keeps layout intact) and outputs Subject + HTML body (≤1000 words). 6. Aggregate & merge — Merge + Aggregate assemble files, assets, and parsed outputs. 7. Save & send — Save the email draft to Google Sheets (Save Newsletter Draft in Google Sheet) and loop through subscribers from a subscribers sheet; Sending Emails to all the Subscribers (Gmail node) sends the HTML to each address in batches. 8. Batching & looping — Split In Batches handles large subscriber lists; Loop Over Items triggers the HTML-conversion per recipient batch. Quick Setup Guide 👉 Demo & Setup Video 👉 Sheet Template 👉 Course Nodes of interest - On form submission (formTrigger) — entry point for video + brand inputs. - You Tube Transcript Scraper, You Tube Transcript Scraper1 (HTTP Request → Apify) — transcript + thumbnail fetching. - Information Extractor & AI Agent1 — website color/theme extraction. - Code in JavaScript — merges transcript pieces into a single text payload. - AI Agent2 (LangChain agent + Gemini Chat Model) — transcript → journalist-style newsletter sections. - Convert Newsletter to HTML (AI) (LangChain agent + Structured Output Parser) — builds constrained, brand-aware HTML email and subject. - Structured Output Parser1/2 — enforce schemas for color theme / structured outputs. - Get row(s) in sheet & Save Newsletter Draft in Google Sheet (Google Sheets) — subscriber list + draft storage. - Loop Over Items / Split In Batches — batch processing for sends. - Sending Emails to all the Subscribers (Gmail) — SMTP/OAuth send. - OpenRouter Chat Model — LM compute provider configured in the workflow. What you’ll need (credentials & resources) - Google Sheets OAuth2 (for reading subscribers & saving drafts). - Gmail OAuth2 (for sending HTML emails). - Gemini / LLM provider credentials (Gemini API key or equivalent) for the LangChain agents. - Apify API key (for the YouTube transcript scrapers). - ConvertAPI (or similar) key if you convert logos (SVG→PNG) server-side. - Host storage / publicly accessible URLs for images (thumbnails, logos) or a file-store (S3). - Optional: SendGrid / Mailgun credentials if you swap Gmail for a transactional email provider. Security note: do NOT hardcode credentials in node parameters; use n8n credentials manager or environment variables. Recommended settings & best practices - Batch size & rate-limits: set Split In Batches to a conservative batch size (e.g., 50–200) and add delays between batches to avoid provider rate limits and Gmail throttling. - Retries & timeouts: enable retries for HTTP Request nodes and set sensible timeouts (e.g., 30–60s). Use exponential backoff. - LM controls: set token/response length limits and maxoutputtokens (or equivalent) to avoid runaway costs; enforce the 1000-word HTML hard l

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.