Prerequisites & Overview

Everything you need to know before starting the setup process.

๐Ÿ“‹

What You'll Need

  • Google Cloud Platform account with billing enabled
  • n8n instance (cloud or self-hosted)
  • Google account (for YouTube, Drive, Sheets)
  • Approximately 30-45 minutes for complete setup
Pro Tip: Have all your account credentials and information ready before starting to streamline the setup process.
๐Ÿ”ง

Workflow Components

The AI Video Factory Automator uses the following integrated components:

Component Purpose Required APIs
Vertex AI Veo3 video generation Vertex AI API
Google Gemini AI prompt generation Generative Language API
YouTube Video upload & publishing YouTube Data API v3
Google Drive Video file storage Google Drive API
Google Sheets Workflow logging Google Sheets API
Gmail Success/failure notifications Gmail API
Important: All APIs listed above must be enabled in your Google Cloud project and properly configured with appropriate credentials for the workflow to function.

Vertex API Setup

Configure Google Cloud Vertex AI to access the Veo3 model for video generation.

1

Create Google Cloud Project

Set up a new Google Cloud project for your AI Video Factory:

  • Go to Google Cloud Console
  • Click the project dropdown in the top navigation
  • Click "New Project"
  • Enter project name: "AI-Video-Factory Automator"
  • Select your organization (if applicable)
  • Click "Create"
Tip: It may take a few moments for the project to be created. You can track the progress in the notification bell icon at the top right.
2

Enable Billing

Enable billing for your project to access the Veo3 API:

  • In Google Cloud Console, navigate to "Billing"
  • Click "Link a billing account"
  • Follow prompts to set up billing
  • Ensure your new project is linked to the billing account
Important: Veo3 API usage is billed by Google. Check current pricing at: Vertex AI Pricing
3

Enable Required APIs

Enable the necessary APIs for your project:

  • Vertex AI API
  • Google Drive API
  • Google Sheets API
  • YouTube Data API v3

To enable an API:

  • Go to the API Library
  • Search for each API by name
  • Click on the API from the results
  • Click "Enable"
4

Find Your Project ID

Your Project ID is a unique identifier for your Google Cloud project and is essential for API configuration:

  • Go to the Google Cloud Console
  • Click on the project dropdown at the top of the page
  • Your Project ID is displayed next to your project name
  • It typically looks like: my-project-123456
Note: Your Project ID is different from your Project Name. The ID is used in API calls and configuration.
5

Determine Location and API Endpoint

For Veo3, you need to specify the location and API endpoint for your requests:

  • Location: us-central1 (currently the only supported region for Veo3)
  • API Endpoint: us-central1-aiplatform.googleapis.com
  • Model Version: veo-3.0-generate-preview

Store these values for later configuration:

PROJECT_ID: your-project-id-123456 LOCATION: us-central1 API_ENDPOINT: us-central1-aiplatform.googleapis.com MODEL_VERSION: veo-3.0-generate-preview
6

Create Service Account

Create a service account for secure API authentication:

  • Go to Service Accounts
  • Click "Create Service Account"
  • Enter a name and description
  • Click "Create and Continue"
  • Assign the role "Vertex AI User" (or more specific roles as needed)
  • Click "Continue" and then "Done"
  • Click on the newly created service account
  • Go to the "Keys" tab
  • Click "Add Key" โ†’ "Create New Key"
  • Select "JSON" and click "Create"
  • The key file will be downloaded to your computer
Important: Keep this JSON file secure. It contains credentials that grant access to your Google Cloud resources. Never share it publicly or commit it to version control.

Google OAuth Setup

Configure OAuth 2.0 credentials for seamless integration with YouTube, Google Sheets, and Google Drive.

1

Configure OAuth Consent Screen

Set up your OAuth consent screen in Google Cloud Console:

  • Go to APIs & Services โ†’ OAuth consent screen
  • Select External user type and click Create
  • Fill in application details:
    • App name: "AI Video Factory Automator"
    • User support email: [Your email]
    • Developer contact information: [Your email]
  • Click Save and Continue
Note: The consent screen is essential for OAuth 2.0 authentication flows.
2

Add OAuth Scopes

Configure the required scopes for your application:

  • Click Add or Remove Scopes
  • Add these scopes manually:
    • YouTube Upload: https://www.googleapis.com/auth/youtube.upload
    • Google Drive: https://www.googleapis.com/auth/drive
    • Google Sheets: https://www.googleapis.com/auth/spreadsheets
    • Gmail Send: https://www.googleapis.com/auth/gmail.send
  • Click Update then Save and Continue
  • Add test users by entering your email address
  • Click Save and Continue
https://www.googleapis.com/auth/youtube.upload https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/spreadsheets https://www.googleapis.com/auth/gmail.send
3

Create OAuth Client ID

Generate OAuth credentials for n8n integration:

  • Go to Credentials page in Google Cloud Console
  • Click Create Credentials โ†’ OAuth client ID
  • Set Application type: "Web application"
  • Enter Name: "n8n-video-factory"
  • Add authorized redirect URIs:
    • For n8n Cloud: https://app.n8n.cloud/rest/oauth2-credential/callback
    • For Self-hosted: https://your-n8n-domain.com/rest/oauth2-credential/callback
  • Click Create
  • Copy the Client ID and Client Secret
Client ID: 1234567890-abcdefghijklmnopqrstuvwxyz.apps.googleusercontent.com Client Secret: GOCSPX-abcdefghijklmnopqrstuvwxyz123456789 ๐Ÿ”’ Keep these credentials secure and never share them publicly.
4

Configure n8n OAuth Credentials

Set up OAuth credentials in your n8n instance:

  • In n8n, go to Settings โ†’ Credentials
  • Click Add Credential
  • Search for and select "Google OAuth2 API"
  • Fill in the credential form:
    • Name: "Google OAuth (Video Factory)"
    • Client ID: [From Step 3]
    • Client Secret: [From Step 3]
  • Click Save
  • n8n will redirect you to Google for authentication
  • Grant the necessary permissions when prompted
  • You'll be redirected back to n8n with the credential created
Important: Ensure all OAuth scopes are granted during authentication for full functionality.

Gemini API Setup

Enable Google Gemini for intelligent video prompt generation and creative content automation.

1

Enable Gemini API

Enable the Gemini API in your Google Cloud project:

  • Go to the API Library
  • Search for "Generative Language API" or "Gemini API"
  • Click on the API from the results
  • Click "Enable"
Tip: You can also use the direct link: Generative Language API
2

Get API Key

Create an API key for the Gemini API:

  • Go to the Credentials page
  • Click "Create Credentials" โ†’ "API Key"
  • Copy the generated API key
  • Optionally, restrict the API key to only the Generative Language API for security
API Key: AIzaSyBxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ๐Ÿ”’ Security Tip: Restrict your API key to only the necessary APIs and consider setting up application restrictions for enhanced security.
3

Configure in N8N

Set up the Gemini credential in N8N:

  • In N8N, go to Settings โ†’ Credentials
  • Click "Add Credential"
  • Search for "Google Gemini" or "PaLM API"
  • Select "Google Gemini(PaLM) API"
  • Enter your API Key in the provided field
  • Click "Save"
Note: This credential will be used by the "Google Gemini Chat Model" nodes in your workflow.

N8N Configuration

Complete setup and testing of your N8N workflow for full automation pipeline.

1

Import the Workflow

Import the AI Video Factory Automator workflow into n8n:

  • In n8n, go to the Workflows page
  • Click "Import from file"
  • Select the JSON workflow file
  • Click "Import"
  • The workflow will appear in your list with all nodes configured
2

Configure API Parameters

Update the workflow with your specific API parameters:

  • Open the imported workflow
  • Find the "โš™๏ธ Veo3 API Setup" node
  • Update the following parameters:
    • PROJECT_ID: Your Google Cloud Project ID
    • MODEL_VERSION: veo-3.0-generate-preview
    • LOCATION: us-central1
    • API_ENDPOINT: us-central1-aiplatform.googleapis.com
  • Save the workflow
3

Assign Credentials to Nodes

Assign the appropriate credentials to each node in the workflow:

  • Google Gemini Chat Model nodes: Assign your Google Gemini(PaLM) API credential
  • ๐ŸŽž๏ธ Generate Veo3 Video node: Assign your Google OAuth2 API credential
  • โณ Check Veo3 Render Status node: Assign your Google OAuth2 API credential
  • โ˜๏ธ Upload to Google Drive node: Assign your Google Drive OAuth2 API credential
  • ๐Ÿ”ฅ Upload to YouTube node: Assign your YouTube OAuth2 API credential
  • ๐Ÿง  Store Video Concept node: Assign your Google Sheets OAuth2 API credential
  • ๐Ÿงพ Log to Google Sheet node: Assign your Google Sheets OAuth2 API credential
  • โœ‰๏ธ Success Notification node: Assign your Gmail OAuth2 API credential
  • โœ‰๏ธ Failure Notification node: Assign your Gmail OAuth2 API credential
Tip: Double-check that each node has the correct credential type. Mismatched credentials will cause workflow failures.
4

Test the Workflow

Run a test to ensure everything is working correctly:

  • Activate the workflow
  • Trigger the "Schedule Trigger" node manually
  • Monitor the execution to ensure all nodes complete successfully
  • Check that a video is generated and uploaded to Google Drive and YouTube
  • Verify that the details are logged to Google Sheets
  • Confirm that the success email is sent
๐Ÿ’ก Tip: Start with a simple test idea to minimize resource usage during initial testing.

Sample Errors & Troubleshooting

Common issues and their solutions for a smooth setup experience.

โŒ Error: "Permission denied" when accessing Vertex AI

Solution: Ensure your service account has the "Vertex AI User" role. Go to IAM & Admin > IAM and verify permissions.

โŒ Error: "Quota exceeded" for Veo3

Solution: Check your Vertex AI quotas in Google Cloud Console. Request a quota increase if needed.

โŒ Error: OAuth consent screen verification required

Solution: Add test users in the OAuth consent screen configuration for testing mode.

โŒ Error: Video generation fails with content policy violation

Solution: Veo3 has content safety filters. Modify your prompt to avoid sensitive content.

โŒ Workflow stops at "Check Veo3 Render Status"

Solution: Video generation can take time. The workflow has retry mechanisms built-in.