🎬 Generate videos with AI, ElevenLabs,PIAPI Shotstack/Creatomate & post to Youtube

⚡ 4,714 views · 🎬 Content Creation & Video

💡 Pro Tip — YouTube’s API quotas can be a bottleneck when you’re pulling data at scale. ScraperNode is a community node with dedicated scrapers for channels, videos, and comments — no quota limits, just structured data.

View All Scrapers

Description

Auto-Generate Long Videos with AI, ElevenLabs,PIAPI,Shotstack/Creatomate & Post to Youtube

Youtube.png

Overview

This n8n automation workflow automates the creation, scripting, production, and posting of YouTube videos. It leverages AI (OpenAI), image generation (PIAPI), video rendering (Shotstack), and platform integrations (Airtable, Google Sheets, YouTube) to streamline the process.

Target Audience

Problem Solved

Manually managing YouTube video production, from ideation to posting, is time-consuming and prone to errors. This workflow addresses:

Prerequisites

Before setting up, ensure you have:

  1. An n8n instance (self-hosted or cloud)
  2. API credentials for:
    • OpenAI (for idea generation)
    • PIAPI.ai (for image and video generation)
    • ElevenLabs (for audio generation)
    • Shotstack (for video rendering)
    • Creatomate (for video rendering)
    • Airtable & Google Sheets and Drive (for storage and tracking)
    • Gmail (for notifications)
    • YouTube API (for posting to YouTube)

How the Automation Works (Step by Step)

  1. Trigger (Schedule Trigger)

    • Initiates the workflow daily
    • Connects to “Generate Idea”
  2. Generate Idea

    • Uses OpenAI to create a unique 4-minute video idea with a title, description, keywords, scene structure, and intrigue note
    • Checks Airtable “Ideas” table via searchAirtable to avoid duplicates
    • Connects to “Parse Ideas”
  3. Parse Ideas

    • Extracts title, description, and notes from the OpenAI output using JavaScript
    • Connects to “Add Ideas”
  4. Add Ideas

    • Stores the initial idea in Google Sheets “Ideas” sheet with fields like “Idea”, “Description”, and “Progress” (set to “Generated”)
    • Connects to “Store in Airtable”
  5. Store in Airtable

    • Saves the idea to Airtable “Ideas” table with mapped fields and typecast enabled
    • Connects to “Generate Script”
  6. Generate Script

    • Creates a 500-600 word script with 8-10 scenes using OpenAI, based on the latest “Generated” idea
    • Uses Structured Output Parser to format output
    • Connects to “Parse Script Output”
  7. Parse Script Output

    • Formats the script into readable text and JSON, extracting scenes and closing question
    • Connects to “Store Script”
  8. Store Script

    • Saves the script to Google Sheets “Production” sheet with “Script”, “Scenes”, and “Status” (set to “Scripted”)
    • Connects to “Store Script in Airtable”
  9. Store Script in Airtable

    • Saves the script to Airtable “Production” table with mapped fields and typecast enabled
    • Connects to “Updated Idea to Scripted”
  10. Updated Idea to Scripted

    • Updates the idea status to “Scripted” in Google Sheets “Ideas” sheet
    • Connects to “Update Status Ideas Table”
  11. Update Status Ideas Table

    • Updates the idea status to “Scripted” in Airtable “Ideas” table, matching by “Idea ID”
    • Connects to “Extract Scenes”
  12. Extract Scenes

    • Parses scene data from Airtable “Production” table for image generation
    • Connects to “Text-to-Image”
  13. Text-to-Image

    • Generates images for each scene using PIAPI
    • Connects to “Wait for 4 Min”
  14. Wait for 4 Min

    • Waits 3 minutes to allow image generation to complete
    • Connects to “Get Images”
  15. Trigger (Schedule Trigger1)

    • Initiates the posting process daily
    • Connects to “Search for Latest Ready Video”
  16. Search for Latest Ready Video

    • Searches Airtable “Production” table for the latest video with “Status” = “Ready”
    • Connects to “If Ready?”
  17. If Ready?

    • Checks if a video is ready (condition: Status contains Ready)
    • If true, connects to “Download Video” and “Update Production Table”
  18. Download Video

    • Downloads the video file using the VideoURL from Airtable
    • Connects to “Post YouTube”
  19. Post YouTube

    • Uploads the video to YouTube with title and description, using YouTube OAuth2
  20. Update Production Table

    • Updates the “Production” sheet in Google Sheets, setting “Status” to “Published” and matching by “Production ID”

Additional Nodes and Processes

Setup Requirements

Before starting, ensure you have the following

1 n8n Instance

2 API Credentials

4 Google Sheets Configuration

  1. Shotstack Configuration (Assumed)

Setup Instructions

  1. Import the Workflow
  1. Configure Credentials
  1. Set Up Airtable
  1. Configure Google Sheets
  1. Schedule Triggers
  1. Test the Workflow
  1. Monitor and Adjust

Benefits

Notes

Conclusion and Suggestions to Improve the Automation

Conclusion

This workflow streamlines YouTube video production, making it ideal for busy content creators, video producers, and marketing teams. Customize it by adding more platforms, adjusting wait delays for image/video generation, or enhancing notifications for status updates. Share your feedback in the n8n community to help others benefit from this automation.

Suggestions to Improve

đź”— Nodes Used

Airtable, Google Sheets, HTTP Request, Google Drive, Gmail, YouTube

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup