n8n

How to Automate YouTube to X Social Posts?

Promote your latest YouTube videos on X without manual work. The flow writes a short post, keeps it under the limit, and logs each post in Google Sheets. Ideal for creators and marketing teams that want steady social updates.

Every two hours a scheduler checks your YouTube channel for new uploads from the last 20 hours. New items pass a duplicate filter so the same video never posts twice. OpenAI drafts the post and, if needed, uses Wikipedia and Calculator tools. A length check loop rewrites the copy to about 220 characters, then the text is stored in Google Sheets and published to X with the sheet entry updated.

Connect YouTube, OpenAI, X, and Google Sheets in n8n, then paste your Channel ID and select your sheet. Expect a clear time win by shrinking a 30 minute task to a few minutes while keeping a clean audit trail. Great for channels that release often, social teams that plan daily content, and solo creators who want hands off promotion.

What are the key features?

  • Scheduled check every two hours with a random minute to spread load
  • YouTube node fetches up to two recent videos from the last 20 hours by Channel ID
  • Remove Duplicates tracks past video IDs so the same video never posts twice
  • OpenAI writes the X post and can use Wikipedia and Calculator tools for extra context
  • Character limit gate rewrites text to about 220 characters until it passes
  • Google Sheets append creates a row with a unique ID, date and text
  • Post to X publishes the approved copy and then updates the sheet record
  • Optional Slack, Discord and Gmail nodes ready for team notifications

What are the benefits?

  • Reduce manual social posting from 30 minutes to 3 minutes per video
  • Eliminate repeat posts for the same video with cross run dedupe
  • Keep every post within 240 characters to avoid truncation
  • Centralize posts in Google Sheets for tracking and audits
  • Connect YouTube, OpenAI, X, Slack, Discord and Gmail in one flow
  • Handle multiple uploads per day without extra work

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You will need accounts with YouTube, OpenAI, X, Google Sheets, Slack, Discord and Gmail. See the Tools Required section above for links to create accounts with these services.
  3. Connect YouTube: double click the YouTube node named Fetch Latest Videos, open the Credential to connect with menu, click Create new credential, then follow the on screen steps to sign in. Use a clear name like YouTube OAuth Main.
  4. Set your Channel ID in the YouTube node. Paste your channel ID into the Channel ID field and keep the time filter so only recent videos pass.
  5. Connect OpenAI: open the nodes Generate X Post and Rewrite X Post to 220 Characters, create a new OpenAI API Key credential, and paste your key from your OpenAI account. Name it OpenAI API Main.
  6. Connect X: open the Post to X node, create a new X OAuth2 credential, and complete the sign in. Confirm the account has permission to post.
  7. Connect Google Sheets: open GS - Add Tweet and GS - Update Tweet, create a Google Sheets OAuth credential, choose your spreadsheet and the Sheet1 tab. Confirm useAppend and appendOrUpdate are set as shown.
  8. Optional notifications: open the Slack and Discord nodes. For Slack incoming webhook and Discord webhook credentials, paste your webhook URLs and save. For Gmail, create a Gmail OAuth2 credential if you plan to email alerts.
  9. Open the Schedule Trigger and confirm it runs every two hours with a random minute. Adjust the interval if you want a different cadence.
  10. Check the Remove Duplicates node. Ensure the dedupe value is set to the video ID and scope is workflow so earlier posts are remembered.
  11. Review the Verify character limit constraints and Rewrite nodes. Keep the target near 220 characters to leave room for links. Adjust the prompt if your brand voice needs changes.
  12. Map the Google Sheets columns: confirm xid, date, time and post fields are filled from the generated message, and that Update writes back after posting.
  13. Run a test with the Manual Trigger. If nothing posts, make sure a new video exists in the last 20 hours and the channel ID is correct. If posts are too long, lower the target length.
  14. If Slack or Discord messages show missing fields, update the message template to reference data from GS - Add Tweet or the Post to X node. Save and retest.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Discord

Sign up

Free: $0 / mo (no API usage fees; standard rate limits apply)

Gmail

Sign up

No cost: Personal Gmail (Gmail API has no usage-based pricing; quotas apply)

Google Sheets

Sign up

Free: $0 (Google Sheets API usage has no additional cost; quota limits apply)

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

Slack

Sign up

Free plan: $0 / mo; limited to 10 apps (third-party or custom) and usable via Slack API

Free tier: $0 / mo, 1000 API calls per workspace / mo

YouTube

Sign up

Free: $0, default quota 10,000 units/day

Credits:
Alex Kim

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.