Use this powerful n8n workflow to automatically remove video backgrounds, composite the resulting foreground onto custom scene videos, manage job polling, and save the final MP4 output directly to Google Drive. Find more advanced n8n templates here.
Download this n8n workflow template and start using it instantly.
Markdown-formatted:
AI UGC creators using tools like HeyGen or Synthesia who need to place avatars on specific backgrounds.
E-commerce marketers automating product video creation with branded scenes.
Technical users looking for robust n8n workflow templates involving complex API polling and file handling.
Developers needing an automated service triggered by a webhook n8n node.
This comprehensive n8n workflow solves the challenge of automating high-fidelity video processing tasks, specifically background removal and composition, which typically require dedicated software. Leveraging the VideoBgRemover API, this n8n automation accepts foreground and background video URLs, submits the job, and manages the asynchronous processing through a structured polling loop. The final composed video is retrieved and securely stored in your Google Drive. This n8n workflow demonstrates advanced concepts in API interaction, conditional flow control, and cloud storage integration, making it one of the most powerful available n8n templates for media automation.
This n8n workflow can be initiated in two ways: via the Webhook Trigger n8n node or manually for testing.
VIDEOBGREMOVERKEY). This returns a unique Job ID.aiugc_ad template, audio mixing levels, background video URL) to instruct the API to begin background removal and compositing.completed. If not, the 'Has Failed?' If n8n node checks for failure. If still processing, the 'Wait 20s' n8n node pauses the flow before looping back to check the status again.Markdown-formatted:
VIDEOBGREMOVERKEY. Set its value to your copied API key.foregroundvideourl and backgroundvideo_url in the POST body.Markdown-formatted:
Webhook Trigger / Manual Trigger: These nodes serve as the n8n trigger for the entire automation, allowing for both ad-hoc testing and production webhook integration.
Extract Webhook Data / Sample Video URLs (Set n8n node): Gathers and standardizes the required input variables (foregroundvideourl, backgroundvideourl) from either the webhook body or pre-configured manual values.
1. Create Job (Upload Foreground) (HTTP Request n8n node): Sends the initial API request to start the video processing job. Crucially, it sends the X-API-Key header using the secure $vars.VIDEOBGREMOVERKEY variable.
2. Start Composition (HTTP Request n8n node): Defines the exact composition parameters, including the template (aiugc_ad), background URL, and audio mixing configuration. This step activates the composition stage of the n8n workflow.
3. Check Job Status (HTTP Request n8n node): Polls the API endpoint, retrieving the current status (processing, completed, or failed). This is central to the polling logic of this n8n workflow.
Is Complete? / Has Failed? (If n8n node): These conditional n8n nodes manage the asynchronous flow, determining whether to proceed to download, build an error response, or re-enter the loop.
Wait 20s (Wait n8n node): Controls the polling frequency, preventing API rate limiting by pausing the n8n workflow for 20 seconds before the next status check.
5. Upload to Google Drive (Google Drive n8n node): Takes the binary video file received from the download step and uploads it to the configured Google Drive location, providing the final shareable link.
Automate privacy compliance using this n8n workflow. It monitors Google Drive for CSV files, utilizes the OpenAI n8n node to detect PII columns, sanitizes the data, and securely uploads the cleaned file. Find the best n8n templates here.

Automate image background removal using APImage, pulling source files from Airtable and saving the processed images to Google Drive. Build this n8n workflow today.

Automate data cleansing using this n8n workflow. Remove duplicate rows in Google Sheets based on specific identifiers (like profile URLs) and securely overwrite the sheet automatically.

Learn how to easily rename data keys in your n8n workflow using the Rename Keys n8n node. Perfect for standardization and integration tasks.

Use this powerful n8n workflow to schedule dynamic content generation. Fetch random cocktail recipes, render custom text overlays with Bannerbear, and automatically post the graphic to Rocketchat. Explore n8n templates for visual content automation.









































