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
- Find and click the Download button on this page.
- Open your n8n editor (cloud or self-hosted).
- Use the Import from File option to load the downloaded workflow JSON.
Configure Credentials and IDs
- Add your YouTube OAuth credentials in the YouTube node settings.
- Connect your OpenAI API key in the OpenAI node.
- Set your X (Twitter) OAuth credentials in the Twitter node.
- Update the YouTube Channel ID in the YouTube node to your actual channel ID.
Test and Activate
- Run the workflow manually once to check it fetches video data, creates the post, and tweets it.
- If all works, toggle the workflow’s active state to start automatic runs every 30 minutes.
- 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.
