Use this robust n8n workflow to automatically generate custom backgrounds using Gemini AI and composite them with your foreground video, saving the result directly to Google Drive. Perfect for marketing and social media automation.
Download this n8n workflow template and start using it instantly.
Creating highly customized video content often requires complex layering and specialized software. This powerful n8n workflow automates the entire process, bridging the gap between imagination and final production. It solves the pain point of needing unique, high-quality backgrounds for videos without manual graphic design.
By leveraging the Gemini API for image generation (Nano Banana) and the VideoBGRemover service for composition, this n8n automation takes a simple prompt and a video URL and produces a final, professional composite video saved directly to your Google Drive. This specific n8n workflow is ideal for scaling video production where visual consistency and novelty are key.
This n8n workflow functions primarily as an API endpoint triggered by an incoming HTTP POST request (Webhook) or run manually using the dedicated n8n trigger.
videourl, backgroundprompt, and aspectratio. The subsequent merge node funnels these inputs into the core processing path.backgroundprompt and desired aspect_ratio to generate a high-quality, custom background image, returning it as Base64 data.Wait 20s and 6. Check Job Status n8n node). This logic repeatedly checks the job status until it is 'completed' or 'failed'.To deploy and utilize this powerful n8n template, follow these steps:
GEMINIKEY: Your Google AI Studio API key for image generation.VIDEOBGREMOVERKEY: Your API key for the VideoBGRemover service.This n8n workflow utilizes several key n8n node types for advanced functionality:
Webhook Trigger: Acts as the external API endpoint for this n8n template, listening for POST requests to initiate video processing.
Set (Sample Inputs / Extract Webhook Data): Used to define or extract critical input variables (videourl, backgroundprompt, aspectratio) from the initial n8n trigger.
HTTP Request (1. Generate Background Image / 4. Create Job / 5. Start Composition / 6. Check Job Status / 7. Download Video): These are crucial n8n nodes for interacting with external APIs (Gemini and VideoBGRemover). They manage image generation, job creation, status polling, and final video download.
Key Configuration: Securely uses $vars.GEMINIKEY and $vars.VIDEOBGREMOVER_KEY headers for authentication.
Code (Extract Image Data): A custom n8n node that processes the raw Base64 image data returned by the Gemini HTTP Request, converting it into a binary format consumable by the Google Drive n8n node.
Google Drive: Two instances of this n8n node are used: one to stage the AI-generated background (and make it public) and one to save the final composite video.
If (Is Complete? / Has Failed?): Provides flow control, checking the video job status before proceeding to download or error handling. A fundamental piece of core logic in this n8n workflow.
Wait (Wait 20s): Part of the polling loop, forcing a delay before the n8n workflow checks the processing status again.
Automate user profile creation, including email validation, dynamic PDF generation from HTML, and delivery via Gmail. This powerful n8n workflow logs verified data to Google Sheets.

Use this powerful n8n workflow to create universal OpenAI-compatible API endpoints for all your custom n8n AI agents and LLM automation logic, supporting both streaming and standard responses.

Automate SecOps incident response using this n8n workflow. Route Splunk alerts to Jira, creating unique tickets or adding comments to existing incidents, preventing alert duplication.

Generate viral YouTube Shorts automatically using this complex n8n workflow. Integrates OpenAI for scripting, ElevenLabs (via HTTP) for voice, and Hedra for video synthesis, all managed by one n8n automation.

Use this powerful n8n workflow to turn simple content ideas (via text or voice message on Telegram) into full, detailed Instagram Reel scripts, captions, and visual concepts using GPT-4o. Explore advanced n8n templates for social media.









































