Back to Catalog

Bulk AI video generation with Freepik Minimax Hailuo & Google Suite integration

Robert BreenRobert Breen
2579 views
2/3/2026
Official Page

This n8n workflow automates bulk AI video generation using Freepik's Image-to-Video API powered by Minimax Hailuo-02-768p. It reads video prompts from a Google Sheet, generates multiple variations of each video using Freepik's AI, handles asynchronous video processing with intelligent polling, and automatically uploads completed videos to Google Drive with organized file names. This is perfect for content creators, marketers, or video producers who need to generate multiple AI videos in bulk and store them systematically.

Key Features:

  • Bulk video generation from Google Sheets prompts
  • Multiple variations per prompt (configurable duplicates)
  • Asynchronous processing with smart status polling
  • Automatic retry mechanism for processing delays
  • Direct upload to Google Drive with organized naming
  • Freepik Minimax Hailuo-02 AI-powered video generation (768p quality)
  • Intelligent wait/retry system for video rendering

Step-by-Step Implementation Guide

Prerequisites

Before setting up this workflow, you'll need:

  1. n8n instance (cloud or self-hosted)
  2. Freepik API account with Video Generation access
  3. Google account with access to Sheets and Drive
  4. Google Sheet with your video prompts

Step 1: Set Up Freepik API Credentials

  1. Go to Freepik API Developer Portal
  2. Create an account or sign in
  3. Navigate to your API dashboard
  4. Generate an API key with Video Generation permissions
  5. Copy the API key and save it securely
  6. In n8n, go to CredentialsAdd CredentialHTTP Header Auth
  7. Configure as follows:
    • Name: "Header Auth account"
    • Header Name: x-freepik-api-key
    • Header Value: Your Freepik API key

Step 2: Set Up Google Credentials

Google Sheets Access:

  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Enable Google Sheets API
  4. Create OAuth2 credentials
  5. In n8n, go to CredentialsAdd CredentialGoogle Sheets OAuth2 API
  6. Enter your OAuth2 credentials and authorize with spreadsheets.readonly scope

Google Drive Access:

  1. In Google Cloud Console, enable Google Drive API
  2. In n8n, go to CredentialsAdd CredentialGoogle Drive OAuth2 API
  3. Enter your OAuth2 credentials and authorize

Step 3: Create Your Google Sheet

  1. Create a new Google Sheet: sheets.google.com
  2. Set up your sheet with these columns:
    • Column A: Prompt (your video generation prompts)
    • Column B: Name (identifier for file naming)
  3. Example data:
    | Prompt                                          | Name          |
    |-------------------------------------------------|---------------|
    | A butterfly landing on a flower in slow motion | butterfly-01  |
    | Ocean waves crashing on rocky coastline        | ocean-waves   |
    | Time-lapse of clouds moving across blue sky    | clouds-timelapse |
    
  4. Copy the Sheet ID from the URL (the long string between /d/ and /edit)

Step 4: Set Up Google Drive Folder

  1. Create a folder in Google Drive for your generated videos
  2. Copy the Folder ID from the URL when viewing the folder
  3. Note: The workflow is configured to use a folder called "n8n workflows"

Step 5: Import and Configure the Workflow

  1. Copy the provided workflow JSON
  2. In n8n, click Import from File or Import from Clipboard
  3. Paste the workflow JSON
  4. Configure each node as detailed below:

Node Configuration Details:

Get prompt from google sheet (Google Sheets)
  • Document ID: Your Google Sheet ID (from Step 3)
  • Sheet Name: Sheet1 (or your sheet name)
  • Operation: Read
  • Credentials: Select your "Google Sheets account"
Duplicate Rows2 (Code Node)
  • Purpose: Creates multiple variations of each prompt
  • JavaScript Code:
const original = items[0].json;

return [
  { json: { ...original, run: 1 } },
  { json: { ...original, run: 2 } },
];
  • Customization: Add more runs for additional variations
Loop Over Items (Split in Batches)
  • Processes items in batches to manage API rate limits
  • Options: Keep default settings
  • Reset: false
Create Video (HTTP Request)
  • Method: POST
  • URL: https://api.freepik.com/v1/ai/image-to-video/minimax-hailuo-02-768p
  • Authentication: Generic → HTTP Header Auth
  • Credentials: Select your "Header Auth account"
  • Send Body: true
  • Body Parameters:
    • Name: prompt
    • Value: ={{ $json.Prompt }}
Get Video URL (HTTP Request)
  • Method: GET
  • URL: https://api.freepik.com/v1/ai/image-to-video/minimax-hailuo-02-768p/{{ $json.data.task_id }}
  • Authentication: Generic → HTTP Header Auth
  • Credentials: Select your "Header Auth account"
  • Timeout: 120000 (2 minutes)
  • Purpose: Polls the API for video completion status
Switch (Switch Node)
  • Purpose: Routes workflow based on video generation status
  • Conditions:
    • Completed: {{ $json.data.status }} equals COMPLETED
    • Failed: {{ $json.data.status }} equals FAILED
    • Created: {{ $json.data.status }} equals CREATED
    • In Progress: {{ $json.data.status }} equals IN_PROGRESS
Wait (Wait Node)
  • Amount: 30 seconds
  • Purpose: Waits before re-checking video status
  • Webhook ID: Auto-generated for resume functionality
Download Video as Base64 (HTTP Request)
  • Method: GET
  • URL: ={{ $json.data.generated[0] }}
  • Purpose: Downloads completed video file
Upload to Google Drive1 (Google Drive)
  • Operation: Upload
  • Name: =video - {{ $('Get prompt from google sheet').item.json.Name }} - {{ $('Duplicate Rows2').item.json.run }}
  • Drive ID: My Drive
  • Folder ID: Your Google Drive folder ID (from Step 4)
  • Credentials: Select your "Google Drive account"

Step 6: Customize for Your Use Case

  1. Modify Duplicate Count: Edit the "Duplicate Rows2" code to create more variations
  2. Update File Naming: Change the naming pattern in the Google Drive upload node
  3. Adjust Wait Time: Modify the Wait node duration based on typical processing times
  4. Add Video Parameters: Enhance the Create Video request with additional Freepik parameters

Step 7: Test the Workflow

  1. Ensure your Google Sheet has test data
  2. Click Execute Workflow on the manual trigger (if present)
  3. Monitor the execution flow - note that video generation takes time
  4. Watch the Switch node handle different status responses
  5. Verify videos are uploaded to Google Drive when completed

Step 8: Production Deployment

  1. Set up error handling for API failures and timeouts
  2. Configure appropriate batch sizes based on your Freepik API limits
  3. Add logging for successful uploads and failed generations
  4. Consider webhook triggers for automated execution
  5. Set up monitoring for stuck or failed video generations

Freepik Video API Details

Video Generation Process:

  1. Submit Request: Send prompt to generate video
  2. Get Task ID: Receive task_id for tracking
  3. Poll Status: Check generation status periodically
  4. Download: Retrieve completed video URL

Status Types:

  • CREATED: Video generation task created
  • IN_PROGRESS: Video is being generated
  • COMPLETED: Video ready for download
  • FAILED: Generation failed

Model Specifications:

  • Model: minimax-hailuo-02-768p
  • Resolution: 768p
  • Duration: Typically 5-10 seconds
  • Format: MP4

Example Enhanced Parameters:

{
  "prompt": "{{ $json.Prompt }}",
  "duration": 5,
  "aspect_ratio": "16:9",
  "fps": 24
}

Workflow Flow Summary

  1. Start → Read prompts from Google Sheets
  2. Duplicate → Create multiple runs for variations
  3. Loop → Process items in batches
  4. Generate → Submit video generation request to Freepik
  5. Poll → Check video generation status
  6. Switch → Route based on status:
    • Completed → Download video
    • Processing/Created → Wait and retry
    • Failed → Handle error
  7. Download → Retrieve completed video file
  8. Upload → Save to Google Drive with organized naming
  9. Continue → Process next batch

Troubleshooting Tips

Common Issues:

  • Long Processing Times: Video generation can take 2-5 minutes per video
  • Timeout Errors: Increase timeout in "Get Video URL" node
  • Rate Limits: Reduce batch size and add longer waits between requests
  • Failed Generations: Check prompt complexity and API limits
  • Upload Failures: Verify Google Drive folder permissions

Error Handling:

  • Add Try/Catch nodes around API calls
  • Implement exponential backoff for retries
  • Log failed generations to Google Sheets
  • Set up email notifications for critical failures

Performance Optimization:

  • Adjust wait times based on typical generation duration
  • Use smaller batch sizes for more reliable processing
  • Monitor API usage and costs in Freepik dashboard

Cost Considerations

Freepik API:

  • Video generation typically costs more than image generation
  • Check your plan's video generation limits
  • Monitor usage through Freepik dashboard
  • Consider upgrading for higher volume needs

Processing Time:

  • Each video can take 2-5 minutes to generate
  • Plan workflow execution time accordingly
  • Consider running during off-peak hours for large batches

Contact Information

Robert A Ynteractive

For support, customization, or questions about this workflow:

  • 📧 Email: rbreen@ynteractive.com
  • 🌐 Website: https://ynteractive.com/
  • 💼 LinkedIn: https://www.linkedin.com/in/robert-breen-29429625/

Need help implementing this workflow or want custom automation solutions? Get in touch for professional n8n consulting and workflow development services.

n8n Workflow: Bulk AI Video Generation with Google Suite Integration

This n8n workflow provides a framework for bulk generating AI videos and managing the process using Google Sheets and Google Drive. It's designed to be highly customizable, allowing users to integrate various AI video generation APIs (like Freepik, Minimax, Hailuo, etc.) and automate the entire content creation pipeline.

Description

This workflow streamlines the process of creating multiple AI-generated videos by reading video parameters from a Google Sheet, sending requests to an AI video generation API, and then storing the generated videos (or links) in Google Drive. It incorporates a looping mechanism to process items in batches, a wait step to manage API rate limits or processing times, and a switch node for conditional logic, making it adaptable to different AI services and content requirements.

What it does

  1. Triggers Manually: The workflow is initiated manually, allowing for on-demand bulk video generation.
  2. Reads Video Data from Google Sheets: It connects to a specified Google Sheet to read a list of video generation requests, likely containing parameters such as video titles, scripts, styles, or target audiences.
  3. Processes Items in Batches: The workflow splits the incoming data from Google Sheets into manageable batches, which is useful for controlling API usage and preventing timeouts.
  4. (Placeholder) AI Video Generation Request: For each item in a batch, it sends an HTTP request to an external AI video generation API (e.g., Freepik, Minimax, Hailuo, or any other service). The specifics of this request (endpoint, headers, body) would need to be configured by the user.
  5. (Placeholder) Handles API Responses: A Code node is included, likely intended for parsing the API response from the video generation service. This could involve extracting video URLs, status updates, or error messages.
  6. Waits for Processing: A Wait node is strategically placed, allowing for a delay. This is crucial for AI video generation, as these processes can take time to complete, and it helps manage API rate limits or ensures videos are ready before attempting to retrieve them.
  7. (Placeholder) Conditional Logic for Video Status: A Switch node is present, suggesting that the workflow can branch based on the status of the video generation (e.g., "completed", "pending", "failed"). This allows for different actions depending on the outcome.
  8. (Placeholder) Google Drive Integration: A Google Drive node indicates that the workflow is designed to interact with Google Drive. This could be for uploading generated video files, storing links to the videos, or managing related assets.
  9. (Placeholder) Additional HTTP Requests: Another HTTP Request node is included, which might be used for polling the AI service for video status, downloading the final video, or updating an external system.

Prerequisites/Requirements

  • n8n Instance: A running n8n instance (cloud or self-hosted).
  • Google Account: A Google account with access to Google Sheets and Google Drive.
  • Google Sheets Credential: An n8n credential configured for Google Sheets.
  • Google Drive Credential: An n8n credential configured for Google Drive.
  • AI Video Generation Service: An account and API access to an AI video generation platform (e.g., Freepik, Minimax, Hailuo, or a similar service).
  • API Key/Authentication: Necessary API keys or authentication details for your chosen AI video generation service.
  • Google Sheet: A Google Sheet containing the input data for video generation requests.

Setup/Usage

  1. Import the Workflow: Import the provided JSON into your n8n instance.
  2. Configure Credentials:
    • Set up your Google Sheets credential.
    • Set up your Google Drive credential.
    • Configure any necessary HTTP Request credentials (e.g., API keys or tokens for your AI video generation service).
  3. Update Google Sheets Node (ID: 18):
    • Specify the Spreadsheet ID and Sheet Name where your video generation data is located.
    • Ensure the operation is set to "Read" and that it retrieves the necessary columns.
  4. Configure HTTP Request Nodes (ID: 19 & 565):
    • AI Video Generation Request (ID: 19):
      • Update the URL to point to your AI video generation API endpoint.
      • Configure the Method (e.g., POST) and Headers (e.g., Content-Type, Authorization with your API key).
      • Adjust the Body to send the required parameters for video generation, using expressions to pull data from the Google Sheets output (e.g., {{ $json.videoTitle }}, {{ $json.script }}).
    • Second HTTP Request (ID: 565): This node's purpose is currently a placeholder. Configure it based on your needs, e.g., to download the video, check status, or update a database.
  5. Configure Loop Over Items (ID: 39): Adjust the "Batch Size" if you need to process more or fewer items at once.
  6. Configure Code Node (ID: 834): Modify the JavaScript code to parse the response from your AI video generation API and extract relevant information (e.g., video URL, job ID, status).
  7. Configure Wait Node (ID: 514): Adjust the "Wait Time" to match the typical processing duration of your AI video generation service.
  8. Configure Switch Node (ID: 112): Define the conditions for branching based on the video generation status (e.g., checking for {{ $json.status === 'completed' }}).
  9. Configure Google Drive Node (ID: 58):
    • Specify the Folder ID where you want to save the generated videos or video links.
    • Choose the appropriate operation (e.g., "Upload a File" if the HTTP Request downloads the video, or "Create a File" to store a text file with the video URL).
    • Map the data from previous nodes to the Google Drive operation (e.g., file content, file name).
  10. Activate the Workflow: Once configured, activate the workflow and run it manually to test.

Related Templates

Track competitor SEO keywords with Decodo + GPT-4.1-mini + Google Sheets

This workflow automates competitor keyword research using OpenAI LLM and Decodo for intelligent web scraping. Who this is for SEO specialists, content strategists, and growth marketers who want to automate keyword research and competitive intelligence. Marketing analysts managing multiple clients or websites who need consistent SEO tracking without manual data pulls. Agencies or automation engineers using Google Sheets as an SEO data dashboard for keyword monitoring and reporting. What problem this workflow solves Tracking competitor keywords manually is slow and inconsistent. Most SEO tools provide limited API access or lack contextual keyword analysis. This workflow solves that by: Automatically scraping any competitor’s webpage with Decodo. Using OpenAI GPT-4.1-mini to interpret keyword intent, density, and semantic focus. Storing structured keyword insights directly in Google Sheets for ongoing tracking and trend analysis. What this workflow does Trigger — Manually start the workflow or schedule it to run periodically. Input Setup — Define the website URL and target country (e.g., https://dev.to, france). Data Scraping (Decodo) — Fetch competitor web content and metadata. Keyword Analysis (OpenAI GPT-4.1-mini) Extract primary and secondary keywords. Identify focus topics and semantic entities. Generate a keyword density summary and SEO strength score. Recommend optimization and internal linking opportunities. Data Structuring — Clean and convert GPT output into JSON format. Data Storage (Google Sheets) — Append structured keyword data to a Google Sheet for long-term tracking. Setup Prerequisites If you are new to Decode, please signup on this link visit.decodo.com n8n account with workflow editor access Decodo API credentials OpenAI API key Google Sheets account connected via OAuth2 Make sure to install the Decodo Community node. Create a Google Sheet Add columns for: primarykeywords, seostrengthscore, keyworddensity_summary, etc. Share with your n8n Google account. Connect Credentials Add credentials for: Decodo API credentials - You need to register, login and obtain the Basic Authentication Token via Decodo Dashboard OpenAI API (for GPT-4o-mini) Google Sheets OAuth2 Configure Input Fields Edit the “Set Input Fields” node to set your target site and region. Run the Workflow Click Execute Workflow in n8n. View structured results in your connected Google Sheet. How to customize this workflow Track Multiple Competitors → Use a Google Sheet or CSV list of URLs; loop through them using the Split In Batches node. Add Language Detection → Add a Gemini or GPT node before keyword analysis to detect content language and adjust prompts. Enhance the SEO Report → Expand the GPT prompt to include backlink insights, metadata optimization, or readability checks. Integrate Visualization → Connect your Google Sheet to Looker Studio for SEO performance dashboards. Schedule Auto-Runs → Use the Cron Node to run weekly or monthly for competitor keyword refreshes. Summary This workflow automates competitor keyword research using: Decodo for intelligent web scraping OpenAI GPT-4.1-mini for keyword and SEO analysis Google Sheets for live tracking and reporting It’s a complete AI-powered SEO intelligence pipeline ideal for teams that want actionable insights on keyword gaps, optimization opportunities, and content focus trends, without relying on expensive SEO SaaS tools.

Ranjan DailataBy Ranjan Dailata
161

Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax

Spark your creativity instantly in any chat—turn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. 📋 What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing 🔧 Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation 🔑 Required Credentials OpenAI API Setup Go to platform.openai.com → API keys (sidebar) Click "Create new secret key" → Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai → Dashboard → API Keys Generate a new API key → Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) ⚙️ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflow—chat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" 🎯 Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration ⚠️ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions

Daniel NkenchoBy Daniel Nkencho
601

Automate Dutch Public Procurement Data Collection with TenderNed

TenderNed Public Procurement What This Workflow Does This workflow automates the collection of public procurement data from TenderNed (the official Dutch tender platform). It: Fetches the latest tender publications from the TenderNed API Retrieves detailed information in both XML and JSON formats for each tender Parses and extracts key information like organization names, titles, descriptions, and reference numbers Filters results based on your custom criteria Stores the data in a database for easy querying and analysis Setup Instructions This template comes with sticky notes providing step-by-step instructions in Dutch and various query options you can customize. Prerequisites TenderNed API Access - Register at TenderNed for API credentials Configuration Steps Set up TenderNed credentials: Add HTTP Basic Auth credentials with your TenderNed API username and password Apply these credentials to the three HTTP Request nodes: "Tenderned Publicaties" "Haal XML Details" "Haal JSON Details" Customize filters: Modify the "Filter op ..." node to match your specific requirements Examples: specific organizations, contract values, regions, etc. How It Works Step 1: Trigger The workflow can be triggered either manually for testing or automatically on a daily schedule. Step 2: Fetch Publications Makes an API call to TenderNed to retrieve a list of recent publications (up to 100 per request). Step 3: Process & Split Extracts the tender array from the response and splits it into individual items for processing. Step 4: Fetch Details For each tender, the workflow makes two parallel API calls: XML endpoint - Retrieves the complete tender documentation in XML format JSON endpoint - Fetches metadata including reference numbers and keywords Step 5: Parse & Merge Parses the XML data and merges it with the JSON metadata and batch information into a single data structure. Step 6: Extract Fields Maps the raw API data to clean, structured fields including: Publication ID and date Organization name Tender title and description Reference numbers (kenmerk, TED number) Step 7: Filter Applies your custom filter criteria to focus on relevant tenders only. Step 8: Store Inserts the processed data into your database for storage and future analysis. Customization Tips Modify API Parameters In the "Tenderned Publicaties" node, you can adjust: offset: Starting position for pagination size: Number of results per request (max 100) Add query parameters for date ranges, status filters, etc. Add More Fields Extend the "Splits Alle Velden" node to extract additional fields from the XML/JSON data, such as: Contract value estimates Deadline dates CPV codes (procurement classification) Contact information Integrate Notifications Add a Slack, Email, or Discord node after the filter to get notified about new matching tenders. Incremental Updates Modify the workflow to only fetch new tenders by: Storing the last execution timestamp Adding date filters to the API query Only processing publications newer than the last run Troubleshooting No data returned? Verify your TenderNed API credentials are correct Check that you have setup youre filter proper Need help setting this up or interested in a complete tender analysis solution? Get in touch 🔗 LinkedIn – Wessel Bulte

Wessel BulteBy Wessel Bulte
247