ChatGPTCreativeVideoAI score · PendingAI-assisted edit · no obvious prompt-injection riskn8n.io

Auto-Repurpose YouTube Videos into Social Posts and AI Thumbnails with n8n

Input YouTube URL → extract transcript and metadata → OpenAI generates LinkedIn/Twitter/blog/YouTube description + AI thumbnail → store in Notion database

Some experienceStepsWorkflowPromptTip
Who
Content operators, social media managers, YouTube creators
You get
Send one YouTube link, get a LinkedIn post, Twitter thread, blog draft, YouTube description, and a 1024×1024 AI thumbnail, all archived in Notion
You need
n8n · google-drive · youtube · apify · notion

Constraints

Prerequisites: n8n instance; credentials for YouTube Data API, OpenAI API (with image generation access), Apify API, Google Drive, and Notion. Costs: OpenAI API billed by tokens and image count; Apify Actor billed by run duration. Note: Notion field names must match the workflow exactly, including the leading space in ' Youtubedescription'; the Timestamp field mapping uses timezone rather than a date value.

What they did

weblineindia published an n8n template that receives a YouTube URL via webhook, fetches metadata and transcript via YouTube API and Apify, uses OpenAI gpt-4.1-mini to generate a LinkedIn post, Twitter thread, blog draft, and YouTube description, simultaneously creates a thumbnail prompt and generates a 1024×1024 image with gpt-image-1, and stores all outputs in a Notion database.

How it went

The template author claims it enables: automatic multi-format content from a single video, AI-generated thumbnails, and centralized Notion archiving (author_report, not tested by this site).

Worth knowing

Known limitations and notes: 1) Videos must have captions enabled; otherwise Apify cannot retrieve transcripts. 2) Notion field names must exactly match the workflow, including the leading space in ' Youtubedescription'; the Timestamp mapping uses timezone, not a date value. 3) The Notion node title parameter is hardcoded to 'n8n' and does not affect the displayed page title. 4) The Google Drive upload node uses 'root' as example folderId; replace with an actual folder in production. 5) Short transcripts may yield empty AI responses; test with longer videos. 6) This site has not run the workflow; actual results may vary due to API versions, credential permissions, or node parameter changes.

n8n workflow template

Structure checked · Not run-tested

Use “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.

Setup and test checklist

Credentials to connect

  • Generate Social Media Content node: connect OpenAI API credentials.
  • Create Thumbnail Prompt node: connect OpenAI API credentials.
  • Generate AI Thumbnail node: connect OpenAI API credentials.

Configuration to replace

  • Source template is n8n public workflow #19369 (~23 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
  • Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.

Test input and expected output

  • Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
  • Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.

Template changes

  • Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
  • No business-logic edits; verify keys, quotas and privacy compliance before use.

Template retrieved: 2026-10-25

Steps

  1. Receive YouTube URL and Extract Video ID

    Configure a Webhook node in n8n (POST method, path yt-repurpose) to receive a JSON body containing a `url` field. A downstream Code node splits the URL to extract the videoId after `v=`.

  2. Fetch Video Details and Transcript

    The YouTube node retrieves snippet/topicDetails/contentDetails using the videoId. An Apify Actor (benthepythondev/youtube-transcript-scraper) fetches the video captions. A Code node cleans the transcript: replaces HTML entities (e.g. '→'), removes [♪…♪] music markers, and collapses whitespace.

    Execution prompt · Source text。Clean Transcript Text node JS Code field

    const transcript = $json.transcript;
    
    // remove HTML entities like '
    const clean = transcript
      .replace(/'/g, "'")
      .replace(/\[♪.*?♪\]/g, "")
      .replace(/\s+/g, " ")
      .trim();
    
    return [{
      transcript: clean
    }];
  3. Generate Social Media Content and Thumbnail Prompt

    The cleaned transcript is sent in parallel to two OpenAI nodes. The first uses gpt-4.1-mini to generate a JSON with LinkedIn post, Twitter thread, blog draft, and YouTube description. The second uses gpt-4.1-mini to generate an English thumbnail prompt based on the video title and transcript.

    Execution prompt · Source text。Generate Social Media Content node Responses > Content field

    =You are a professional content repurposing assistant.
    
    Convert this YouTube transcript into:
    
    {
      "linkedin_post": "",
      "twitter_thread": "",
      "blog": "",
      "youtube_description": ""
    }
    
    Transcript:
    {{$json.transcript}}

    Execution prompt · Source text。Create Thumbnail Prompt node Responses > Content field

    =Create a professional YouTube thumbnail prompt for this video.
    
    Video Title:
    {{$('Fetch YouTube Video Details').first().json.snippet.title}}
    
    Transcript: {{ $('Clean Transcript Text').item.json.transcript }}
    
    
    Rules:
    - Make it visually attractive
    - Modern YouTube style
    - Bold text
    - High contrast
    - Cinematic lighting
    - AI art style
    - Return only the image prompt
  4. Extract and Structure AI Output

    Code nodes extract text content from OpenAI responses, then JSON.parse into structured fields (linkedin_post, twitter_thread, blog, youtube_description). The thumbnail prompt is similarly extracted as plain text via a Code node.

    Execution prompt · Source text。Extract AI Response / Extract Thumbnail Prompt node JS Code field

    return [
      {
        content: $json.output[0].content[0].text
      }
    ];

    Execution prompt · Source text。Convert AI Response to JSON node JS Code field

    const data = JSON.parse($json.content);
    
    return [
      {
        json: {
          linkedin_post: data.linkedin_post,
          twitter_thread: data.twitter_thread,
          blog: data.blog,
          youtube_description: data.youtube_description
        }
      }
    ];
  5. Generate AI Thumbnail and Upload to Google Drive

    The OpenAI image generation node (gpt-image-1, 1024×1024) generates the thumbnail from the prompt. It is uploaded to a Google Drive folder, shared publicly with anyone/reader permission, and the webViewLink is extracted as the public URL.

  6. Aggregate Data and Save to Notion

    A Code node aggregates: video title, video URL, first 1900 characters of transcript, AI-generated content, and ISO timestamp. The Notion node creates a database page with title parameter fixed as 'n8n'; field mappings must strictly match database properties, noting the leading space in ' Youtubedescription' and the Timestamp field using timezone rather than date value.

    Execution prompt · Source text。Prepare Final Content Data node JS Code field

    return [
      {
        json: {
          video_title: $('Fetch YouTube Video Details').first().json.snippet.title,
    
          video_url:
            'https://www.youtube.com/watch?v=' +
            $('Fetch YouTube Video Details').first().json.id,
    
          transcript:
            $('Fetch Video Transcript').first().json.transcript.substring(0, 1900),
    
          linkedin_post: $json.linkedin_post,
    
          twitter_thread: $json.twitter_thread,
    
          blog: $json.blog,
    
          youtube_description: $json.youtube_description,
    
          timestamp: new Date().toISOString()
        }
      }
    ];

Prompt you can copy

Setup guidance · Editorial suggestion。Hand to setup assistant; confirm inputs and permissions first

This block is the prompt. Ads are never placed here.

You are an n8n workflow setup assistant. The user wants to replicate the "YouTube video auto-repurposing + AI thumbnail" template. First confirm they have: an n8n instance, YouTube Data API credentials, OpenAI API key (with image generation access), Apify account, and OAuth credentials for Google Drive and Notion. Then guide them to import workflow.json, configure each node's credentials, create the Notion database (fields must match exactly, note the leading space in ' Youtubedescription'), and test the webhook.

After pasting workflow.json, verify credentials and field mappings in node order

Source

Repurpose YouTube videos into social posts and thumbnails with OpenAI · weblineindia · n8n.io · 2026-09-08

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related