1. Opening Problem Statement 📹⏱️
Meet Jim, a passionate content creator who uploads economics-related videos on YouTube. Jim spends hours every week manually downloading newly recorded videos from Google Drive, extracting transcripts, writing detailed video descriptions, creating SEO-friendly titles and tags, and finally uploading them to YouTube. This manual process takes Jim around 5 hours each week, leading to frustration and inconsistent uploads. If only there was a way to automate this repetitive, time-consuming task without compromising content quality or SEO optimization.
2. What This Automation Does ⚙️
This n8n workflow automates the entire YouTube video upload process from Google Drive to YouTube with help from AI tools. When a new video appears in a specific Google Drive folder, it triggers the workflow. Here’s what happens:
- Automatically downloads the new video file from Google Drive
- Fetches the video transcript via the Apify YouTube Transcript Scraper API
- Formats the transcript for consistent text processing
- Generates a detailed, professional YouTube video description using OpenAI’s GPT-4.1-nano
- Creates SEO-optimized video titles and relevant tags with AI assistance (OpenAI and Google Gemini models)
- Uploads the video to YouTube with the newly created description, tags, and SEO title
- Optionally deletes the original video file from the upload folder to keep Google Drive tidy
By automating these tasks, Jim saves up to 4 hours per video upload session, maintains consistent SEO optimization, and frees time to focus on creating new content.
3. Prerequisites ⚙️
- n8n account for workflow automation (self-hosting option available for full control)
- Google Drive account with OAuth2 credentials (for video download and folder watch)
- YouTube OAuth2 credentials to upload and update videos
- OpenAI API key for GPT-4.1-nano model access (for description and title generation)
- Google Palm API key (for Google Gemini model to generate YouTube tags)
- Apify account with an active token to use their YouTube Transcript Scraper API
4. Step-by-Step Guide to Build This Workflow ✏️
Step 1: Set Up the Google Drive Trigger to Watch New Videos
Go to n8n editor and add a new node by clicking + → Google Drive Trigger.
Configure it with your Google Drive OAuth2 credentials.
Set the trigger event to fileCreated and choose the specific folder ID where new videos are uploaded.
Set poll time to every minute to catch videos soon after upload.
You should see the node waiting and listening for new files in that folder.
Common mistake: Forgetting to set the correct folder ID will cause the trigger to never fire.
Step 2: Download the New Video Automatically from Google Drive
Add a Google Drive node and connect it to the trigger.
Set the operation to download and map the file ID dynamically from the trigger output using {{$json.id}}.
Use the same Google Drive credentials.
This node downloads the actual video file content ready for upload.
Common mistake: Not referencing the file ID correctly causes the node to fail downloading.
Step 3: Retrieve the Video Transcript via HTTP Request
Add an HTTP Request node after the video download.
Set method to POST.
In the URL, use the Apify YouTube Transcript Scraper API endpoint:
https://api.apify.com/v2/acts/pintostudio~youtube-transcript-scraper/run-sync-get-dataset-items.
Set JSON body to send the YouTube video URL dynamically using https://www.youtube.com/watch?v={{$json.id}}.
Add your Apify API token to the query parameters.
This call fetches the transcript data.
Common mistake: Omitting the API token or incorrect video URL leads to API errors.
Step 4: Format the Transcript Using a Code Node
Add a Code node next.
Copy this JavaScript code to flatten and join transcript segments into one continuous text:
const items = $input.all();
const transcriptStrings = items.flatMap(item => {
const dataArray = item.json.data;
if (!dataArray || !Array.isArray(dataArray)) {
return [];
}
const segmentTexts = dataArray.map(segment => {
if (segment && typeof segment.text === 'string') {
return segment.text;
} else {
return '';
}
});
return segmentTexts;
});
const transcript = transcriptStrings.join(' ');
return [
{
json: {
transcript: transcript,
},
},
];>This prepares the transcript for AI processing.
Common mistake: Modifying the code incorrectly breaks the transcript format.
Step 5: Generate the YouTube Video Description with OpenAI
Add the OpenAI node and configure it to use model gpt-4.1-nano.
Set system instructions to act as a professional copywriter creating a detailed but concise summary.
Map the formatted transcript to the message content.
You will receive a compelling video description ready to post.
Common mistake: Not setting correct system prompts for tone and style can produce generic text.
Step 6: Create SEO Optimized YouTube Title and Tags with AI Nodes
Add another OpenAI node to generate the SEO title. Use similar style prompts emphasizing SEO and brevity.
Add a Google Gemini node to generate YouTube tags based on the transcript.
Chain the description node output to the tag generation node for smooth data flow.
Common mistake: Forgetting to link nodes for proper sequential AI prompt flow.
Step 7: Upload the Video to YouTube
Add a YouTube node and set operation to upload.
Set initial title (will be updated later), privacy status, category, region, and mark as not made for kids.
Pass the video file from the download node.
Use your YouTube OAuth2 credentials.
Video is now uploaded but lacks enhanced metadata.
Step 8: Update Video Metadata (Description, Tags, Title)
Add another YouTube node, operation set to update video metadata.
Map generated SEO title, detailed description, and tags from previous AI nodes.
Use the uploaded video ID from the upload node output.
This step finalizes the YouTube video with high-quality metadata.
Step 9: (Optional) Clean Up by Deleting the Source Video from Drive
Add another Google Drive node set to deleteFile operation.
Use the file ID from the initial download node to remove the original file.
This keeps your Google Drive upload folder clean and organized.
5. Customizations ✏️
- Change Video Privacy Setting: In the Upload Video to YouTube node, switch privacyStatus from “private” to “public” or “unlisted” to control who sees your uploads.
- Adjust Transcript Formatting: Edit the Code node to add timestamps or remove filler words from transcripts before feeding to AI for cleaner descriptions.
- Add Thumbnail Update: Use YouTube API with an additional node to programmatically set custom thumbnails post upload, enhancing video appearance.
- Multi-Language Support: Integrate translation APIs in the workflow to generate descriptions and tags in multiple languages automatically.
6. Troubleshooting 🔧
Problem: “Google Drive Trigger does not detect new files”
Cause: Incorrect folder ID or insufficient permissions.
Solution: Double-check folder ID in trigger node and ensure OAuth2 credentials have read access.
Problem: “OpenAI node returns empty or generic output”
Cause: Missing or incorrect prompt configuration.
Solution: Verify system message and prompt content, especially mapping the transcript correctly.
Problem: “YouTube upload fails or video metadata does not update”
Cause: OAuth2 token expired or incorrect video IDs.
Solution: Refresh credentials and ensure outputs from upload node feed into update node properly.
7. Pre-Production Checklist ✅
- Verify Google Drive folder ID and OAuth2 credential scopes
- Test video file upload to trigger the workflow
- Validate Apify token usage and API response for transcript retrieval
- Check AI nodes generate meaningful, relevant descriptions, titles, and tags
- Test YouTube upload node with private video option before making public
- Backup Google Drive files before enabling auto-delete step
8. Deployment Guide
Activate the Google Drive Trigger to run every minute.
Turn on the entire workflow.
Monitor the executions logs in n8n editor for errors.
Adjust node settings if any failures occur.
Schedule periodic reviews of AI-generated descriptions and tags for optimization.
Optionally, self-host n8n for production with full security and control.
9. FAQs
Q: Can I use another transcript provider instead of Apify?
A: Yes, as long as the API returns transcript data in a compatible JSON format you can adjust the code node accordingly.
Q: Will this workflow consume many OpenAI API credits?
A: Each transcription and metadata generation does consume API calls, so plan your token usage accordingly.
Q: Is my video content and data secure?
A: OAuth2 authentication and API keys ensure secure access; however, self-hosting n8n increases control over data privacy.
10. Conclusion
By building this n8n automation, you can seamlessly upload YouTube videos straight from Google Drive, enriched with AI-powered descriptions, titles, and tags. This automation eliminates tedious manual steps, saves Jim (and you) hours each week, and ensures consistent SEO optimization to boost video reach. Next, consider automating social media sharing for new uploads or integrating analytics monitoring for better video performance insights. Happy automating!