🎬 Generate YouTube scripts and full SEO package with GPT-4o-mini and Gmail

⚑ 158 views · 🎬 Content Creation & Video

πŸ’‘ Pro Tip β€” YouTube’s API quotas can be a bottleneck when you’re pulling data at scale. ScraperNode is a community node with dedicated scrapers for channels, videos, and comments β€” no quota limits, just structured data.

View All Scrapers

Description

Description

Submit your video topic, target audience, video length, and tone of voice using a simple form and two sequential AI agents do the rest. The first writes a complete structured video script with hook, three content sections, conclusion, and call to action. The second generates the full SEO metadata package: an optimized title, three alternative titles, a full YouTube description with hashtags, 15 tags, and timestamped chapters. Everything arrives in one clean Gmail email ready to record and upload. Built for YouTube creators, video marketers, and SEO agencies who want a complete production-ready video package in minutes instead of hours.


What This Workflow Does


Setup Requirements

Tools Needed

Credentials Required

> ⚠️ OpenAI API key appears in 2 steps β€” connect it in both 4. OpenAI β€” Script Model GPT-4o-mini and 7. OpenAI β€” SEO Model GPT-4o-mini

Estimated Setup Time: 10–15 minutes


Step-by-Step Setup

  1. Import the workflow β€” Open n8n β†’ Workflows β†’ Import from JSON β†’ paste the workflow JSON β†’ click Import

  2. Fill in Config Values β€” Open node 2. Set β€” Config Values β†’ replace all three placeholders:

FieldWhat to enter
PASTE_YOUR_EMAIL_HEREThe email address where the content package should be sent
PASTE_YOUR_NAME_HEREYour name for the email greeting and sign-off
PASTE_YOUR_CHANNEL_NICHE_HEREYour channel’s topic area (e.g. personal injury law, SaaS marketing, medical aesthetics) β€” GPT uses this to personalize both the script and metadata
  1. Connect OpenAI for the script step β€” Open node 4. OpenAI β€” Script Model GPT-4o-mini β†’ click the credential dropdown β†’ add your OpenAI API key β†’ test the connection

  2. Connect OpenAI for the SEO step β€” Open node 7. OpenAI β€” SEO Model GPT-4o-mini β†’ click the credential dropdown β†’ select the same OpenAI API credential β†’ confirm it is connected

  3. Connect Gmail β€” Open node 10. Gmail β€” Send Content Package β†’ click the credential dropdown β†’ add Gmail OAuth2 β†’ sign in with the Gmail account where you want to receive packages β†’ authorize access

  4. Activate the workflow β€” Toggle the workflow to Active β†’ copy the Form URL from node 1. Form β€” YouTube Content Request β†’ open it in a browser to submit your first video


How It Works (Step by Step)

Step 1 β€” Form: YouTube Content Request You open the form URL in a browser and fill in five fields: the video topic, target audience, video length (e.g. β€œ8 minutes”), tone of voice (optional, defaults to β€œeducational and engaging”), and your name. Submitting the form starts the workflow immediately.

Step 2 β€” Set: Config Values Your email, sender name, channel niche, and all five form inputs are stored here. Today’s date is auto-generated for the email subject. Tone of voice defaults to β€œeducational and engaging” if left blank on the form.

Step 3 β€” AI Agent: Write Video Script GPT-4o-mini receives the video topic, target audience, video length, tone of voice, and channel niche. It writes a complete spoken video script in plain English with no bullet points or markdown. The structure is fixed: a 30-second hook with 3–4 punchy sentences, a short introduction paragraph, three named content sections each with 2–3 paragraphs, a conclusion summarizing the three key takeaways, and a 2-sentence call to action asking viewers to like, subscribe, and comment.

Step 4 β€” OpenAI: Script Model GPT-4o-mini This is the language model powering the script writing step. It runs at temperature 0.7 for creative, natural-sounding spoken language and is capped at 2,000 tokens to accommodate a full-length video script.

Step 5 β€” Set: Save Script and Config The completed script is saved from the previous step’s output. All nine config values β€” email, name, niche, topic, audience, length, and today’s date β€” are explicitly re-carried forward here so the SEO agent has full context. This bridge step is necessary because n8n agents pass their output to the next step, not the full context from earlier in the workflow.

Step 6 β€” AI Agent: Generate SEO Package GPT-4o-mini receives the video topic, target audience, channel niche, and video length. It returns five structured fields: a main YouTube title under 60 characters, an array of three alternative titles (one curiosity angle, one number angle, one question angle each under 60 characters), a full description under 250 words with keyword hook, learning points, call to action, and hashtags, an array of 15 keyword tags mixing short and long tail terms, and an array of timestamped chapter objects spaced evenly across the video length starting at 0:00.

Step 7 β€” OpenAI: SEO Model GPT-4o-mini This is the language model powering the SEO metadata step. It runs at temperature 0.3 for precise, consistent output β€” lower than the script step because metadata needs to be accurate and structured, not creative.

Step 8 β€” Parser: Structured SEO Output This step enforces the exact five-field schema GPT-4o-mini must return for the SEO package. It validates that title, alternativeTitles, description, tags, and chapters are all present and correctly typed before the email is assembled.

Step 9 β€” Code: Build Email The SEO output and the saved script are combined into one complete plain-text email. The email is organized into clearly labeled sections: topic summary header, main title and three alternative titles, all 15 tags as a comma-separated list, chapters as timestamp-title pairs, the full description, and the complete video script. The email subject is automatically set to β€œYouTube Content Package β€” [main title] β€” [today’s date]”.

Step 10 β€” Gmail: Send Content Package The complete email is sent to your configured email address with no attribution footer. One email contains everything needed to record, upload, and optimize the video.


Key Features

βœ… Two specialized AI agents in sequence β€” Script writing and SEO metadata are handled by separate GPT instances with different temperatures so each task is optimized independently βœ… Script temperature tuned for creativity β€” The script agent runs at 0.7 so the language sounds natural and spoken, not robotic or like a list βœ… SEO metadata temperature tuned for precision β€” The metadata agent runs at 0.3 so titles stay under 60 characters, chapters start at 0:00, and tag arrays are clean βœ… Channel niche personalizes both outputs β€” Your niche is passed to both agents so the script examples and the SEO keywords stay relevant to your actual audience βœ… Structured output enforced for metadata β€” A schema parser validates all five SEO fields before the email is built β€” no broken or incomplete packages βœ… Chapters spaced to your video length β€” The chapters step reads your submitted video length and distributes timestamps evenly so chapters actually match the content structure βœ… Single email with every deliverable β€” Script, titles, tags, chapters, and description all arrive in one email with clear section headers β€” ready to copy-paste into your recording notes and YouTube upload form βœ… Tone defaults to educational if blank β€” Leaving the Tone of Voice field empty on the form triggers a sensible default instead of failing the workflow


Customisation Options

Change the script structure β€” In node 3. AI Agent β€” Write Video Script, edit the structure instructions to add or remove sections β€” for example replace β€œSection 3 β€” common mistake” with β€œSection 3 β€” case study example” to change the content format for your channel style.

Add a Google Docs save alongside the Gmail β€” After node 9. Code β€” Build Email, add a Google Docs step that creates a new document with the email body β€” giving you a permanent editable copy in Drive alongside the email delivery.

Generate a shorter script for YouTube Shorts β€” Add a second form field option for β€œShort format (under 60 seconds)” and branch after step 2 β€” if the video length is under 60 seconds, route to a shorter prompt in the AI Agent that writes just a hook and one main point.

Send the package to a Slack channel β€” After node 10. Gmail β€” Send Content Package, add a Slack step that posts the main title, first alternative title, and today’s date to a #youtube-content channel so your team sees new packages without checking email.

Increase script length for longer videos β€” In node 4. OpenAI β€” Script Model GPT-4o-mini, raise maxTokens from 2000 to 3000 to allow GPT to write a more detailed script for 15–20 minute videos β€” useful for in-depth tutorial formats.


Troubleshooting

Form submission not starting the workflow:

Script agent not generating content:

SEO package missing fields or failing schema validation:

Gmail not sending the package:

Email arriving with missing sections or garbled content:


Support

Need help setting this up or want a custom version built for your team or agency?

πŸ“§ Email: info@incrementors.com 🌐 Website: https://www.incrementors.com/

πŸ”— Nodes Used

Gmail, AI Agent, OpenAI Chat Model, Structured Output Parser, n8n Form Trigger

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup