Automate Posting New YouTube Videos to X with n8n & ChatGPT

Save time and boost engagement by automating posts about your latest YouTube videos on X using n8n workflow integrating YouTube, ChatGPT, and X API. Perfect for creators wanting consistent social presence.
youtube
openAi
twitter
+2
Workflow Identifier: 1797
NODES in Use: Schedule Trigger, YouTube, OpenAI, Twitter, Sticky Note

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Automation Does

This workflow checks your YouTube channel every 30 minutes for new videos.

It creates a short, catchy post about the newest video using ChatGPT and posts it automatically on X (Twitter).

This saves time by removing the need to manually write and post every update.

The result is fast, automatic posting that keeps your audience engaged with new videos right away.


Tools and Services Used

  • YouTube API: Gets latest videos from your channel.
  • OpenAI (ChatGPT): Writes short, interesting posts for X.
  • X (Twitter) API: Posts the message on X automatically.
  • n8n automation platform: Runs and connects all steps in one workflow.

Inputs, Processing, and Outputs

Input

  • Your YouTube Channel ID.
  • OAuth credentials for YouTube, OpenAI, and X (Twitter).

Processing Steps

  • Schedule Trigger runs every 30 minutes to activate the flow.
  • YouTube node fetches the latest video published in the last 30 minutes.
  • ChatGPT (OpenAI node) generates a post text under 140 characters using the video’s title, description, and link.
  • Twitter (X) node posts the generated message as a tweet.

Output

  • New tweet on X with a fresh post about the latest YouTube video.

Beginner Step-by-Step: How to Use This Workflow in n8n Production

Download and Import Workflow

  1. Find and click the Download button on this page.
  2. Open your n8n editor (cloud or self-hosted).
  3. Use the Import from File option to load the downloaded workflow JSON.

Configure Credentials and IDs

  1. Add your YouTube OAuth credentials in the YouTube node settings.
  2. Connect your OpenAI API key in the OpenAI node.
  3. Set your X (Twitter) OAuth credentials in the Twitter node.
  4. Update the YouTube Channel ID in the YouTube node to your actual channel ID.

Test and Activate

  1. Run the workflow manually once to check it fetches video data, creates the post, and tweets it.
  2. If all works, toggle the workflow’s active state to start automatic runs every 30 minutes.
  3. If self-hosting n8n, keep the server running steadily; see self-host n8n for useful resources.

Common Issues and How to Fix Them

  • No videos fetched from YouTube node? Double-check the Channel ID is correct. Confirm the 30-minute publishedAfter filter is valid and in ISO format.
  • Empty post from ChatGPT? Make sure dynamic placeholders like {{ $json.id.videoId }} are correct in the prompt. Test with simple prompts to verify AI response.
  • Error posting on X? Authenticate or refresh your Twitter OAuth credentials in n8n Settings.

Customization Ideas

  • Change the Schedule Trigger interval from 30 minutes to any time you want.
  • Edit the ChatGPT prompt to add hashtags, change tone, or add call to actions.
  • Fetch multiple videos by increasing the YouTube node limit and using loops to post multiple tweets.
  • Add media to posts by fetching thumbnails and uploading them in the Twitter node.

Summary

✓ Saves time by automating social posts from YouTube videos.
✓ Ensures consistent, timely engagement by posting every 30 minutes.
✓ Removes the need for manual creation or posting.
→ Result is a fresh, smart X post for each new video automatically.


Frequently Asked Questions

The YouTube node uses the channel ID and checks for videos published in the last 30 minutes using a time filter.
If the prompt has wrong placeholders, ChatGPT may return empty or irrelevant posts. Check that the placeholders match the video data fields.
Posting fails if the Twitter OAuth credentials in n8n are expired or revoked. Reauthenticate and update credentials to fix.
Yes, the workflow works on self-hosted n8n. Just ensure the server is running to allow scheduled executions. See buldrr.com for hosting resources.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free