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
Automate YouTube posts with n8n and OpenAI

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

Learn how to Build this Workflow with AI:

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.


Automate YouTube posts with n8n and OpenAI

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.