Skip to main content

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

Workflow preview

Workflow preview
100%
Create AI newsletters from YouTube with LangChain, Gemini, Apify & Gmail preview
Open on n8n.io

1. Workflow Overview

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 mult...

Best for

  • Social Media automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.outputparserstructured, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.gmail, n8n-nodes-base.formtrigger, n8n-nodes-base.httprequest, n8n-nodes-base.merge, n8n-nodes-base.aggregate, n8n-nodes-base.splitinbatches

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Pratyush Kumar Jha.

Original n8n.io source

1.1 Workflow description

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

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. TriggerOn 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 & journalismAI Agent2 (LangChain/Gemini) cleans the transcript, extracts thesis + key points, and writes 3 newsletter sections in a journalistic tone.
  5. HTML conversionConvert 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 & mergeMerge + 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 & loopingSplit 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 max_output_tokens (or equivalent) to avoid runaway costs; enforce the 1000-word HTML hard limit in the prompt.
  • Validation: validate the YouTube URL and that transcript content exists before invoking AI summarization (fail fast with a clear error).
  • Schema enforcement: use Structured Output Parser nodes with strict JSON schemas to prevent malformed outputs.
  • Testing: run with a small subscriber test sheet and use a safety test Gmail account before sending to production lists.
  • Logging & monitoring: log each run (video URL, subject, send count, errors) to a monitoring sheet or external logging service.
  • Privacy & compliance: ensure recipients have consent to receive emails (store opt-ins); include unsubscribe handling if you move beyond one-off sends. Comply with CAN-SPAM / local laws.
  • Credential rotation: rotate API keys periodically and revoke compromised tokens.
  • Content safety: instruct the LM agents to avoid hallucinated citations — only include links you can verify.

Customization ideas

  • Multi-language support: auto-detect video language and run summarizer in that language.
  • A/B subject testing: generate 2–3 subject lines and send variations to subsets.
  • Scheduling: add a scheduler node to delay sends or publish at optimal send-times per recipient timezone.
  • Integrate with SendGrid/Mailgun for higher throughput and analytics (opens/clicks).
  • Add personalization tokens (first name, company) from subscribers sheet to the HTML (merge fields).
  • Auto-attach transcript as plain-text footer or include “Read more” link to a hosted full article.
  • Add analytics: record opens, clicks, and engagement back into Google Sheets or a database.
  • Support other platforms: ingest videos from Vimeo, Loom, or uploaded MP4s.
  • Use a templating engine to allow multiple newsletter layouts and style variants.
  • Auto-generate social posts (Twitter/X, LinkedIn) from the newsletter summary.

Tags

n8n newsletter youtube transcript langchain gemini apify gmail google-sheets html-email automation batching ai content-ops

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Structured Output Parser1

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 2 - Convert Newsletter to HTML (AI)

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 3 - Sending Emails to all the Subscribers

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 4 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.3

Block 5 - HTTP Request2

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 6 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 7 - Aggregate

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 8 - Structured Output Parser2

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 9 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 10 - Get row(s) in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 11 - AI Agent1

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 12 - Code in JavaScript

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - AI Agent2

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 14 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 15 - You Tube Transcript Scraper

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 16 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - You Tube Thumbnail Scraper

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 20 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Google Gemini Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 23 - Google Gemini Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 24 - Information Extractor

Type / Role
@n8n/n8n-nodes-langchain.informationExtractor - informationExtractor
Config choices
Version 1.2

Showing the first 24 of 26 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Create AI newsletters from YouTube with LangChain, Gemini, Apify & Gmail
Complexity advanced
Nodes 26
Categories Social Media, Multimodal AI
Author Pratyush Kumar Jha
Published 12 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14012/14012.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Create AI newsletters from YouTube with LangChain, Gemini, Apify & Gmail do?

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 mult...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media, Multimodal AI use case.