Video Background Removal and Custom Image Composition - n8n Workflow

Automate video background removal and composition using n8n. This powerful n8n workflow template processes video files, applies custom image backgrounds, handles polling, and saves the final output directly to Google Drive.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • E-commerce businesses needing consistent product video branding and automation.

  • Content creators automating social media video production and requiring custom scenes.

  • Technical users looking for advanced file processing n8n templates and flow control.

  • Developers integrating complex video manipulation into their applications using a reliable n8n node sequence.

Overview

This expert n8n workflow template provides an end-to-end solution for high-volume video composition tasks, solving the challenge of quickly generating branded or customized video content without needing complex desktop editing software. By utilizing an external video processing API combined with robust n8n flow control, the entire process—from submitting the video to final storage—is fully automated. Whether initiated by a webhook or a manual run, the n8n workflow efficiently handles job creation, composition settings (like the 'centered' template), continuous status polling, downloading the processed video (as binary data), and reliable delivery to Google Drive. This specific n8n workflow is perfect for standardizing the backgrounds of AI actors, product demos, or corporate talking head videos.

How it Works

The automation begins with an n8n trigger, specifically the Webhook Trigger for external calls or the Manual Trigger for testing. Input data, consisting of the foreground video URL and background image URL, is consolidated by the Merge Triggers n8n node. The flow then interacts with the video processing API using multiple HTTP Request n8n nodes.


  1. The '1. Create Job' n8n node submits the initial foreground video URL, initiating the background removal process.

  2. The '2. Start Image Composition' n8n node sends the command to composite the foreground onto the specified background image URL, using defined parameters (e.g., template: centered).

  3. The crucial '3. Check Job Status' n8n node starts a polling sequence. The flow enters a loop controlled by the 'Is Complete?' and 'Has Failed?' n8n nodes. If the status is 'processing', the flow pauses using the 'Wait 20s' n8n node before looping back to check the status again.

  4. Upon completion, the '4. Download Video' n8n node fetches the final processed video file as binary data.

  5. The '5. Upload to Google Drive' n8n node securely saves the composed video using a unique filename.

  6. Finally, success or error data is structured and returned to the originating n8n trigger via the Respond to Webhook n8n node or stored for manual execution review.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import the n8n workflow: Copy the provided JSON data and paste it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. API Key Setup (Environment Variable): This n8n workflow requires a dedicated API key for video processing. Set an environment variable named VIDEOBGREMOVERKEY in your n8n settings (Settings -> Variables) and assign your API key as the value. This ensures secure storage, used via the expression ={{ $vars.VIDEOBGREMOVERKEY }} in the n8n node configurations.

  3. Google Drive Credentials: Locate the '5. Upload to Google Drive' n8n node. Click 'Credentials' and connect your Google Drive account, granting n8n the necessary file upload permissions.

  4. Configure Inputs: If using the Manual Trigger for testing, update the 'Sample URLs (Edit Here)' n8n node with your public video and image URLs.

  5. Activate: Save and activate the n8n workflow. If using the Webhook Trigger, copy the provided webhook URL for external integration.

Node Details

Webhook Trigger / Manual Trigger (n8n trigger): Initiates the n8n workflow. The Webhook is configured for POST requests to handle external automation.
Set (Extract Webhook Data / Sample URLs): Prepares and validates the input URLs for the foreground video and custom background image, ensuring the subsequent HTTP Request n8n nodes have clean data.
HTTP Request (1. Create Job): The initial API call to submit the foreground video URL for background removal. It uses the secure X-API-Key header.
HTTP Request (2. Start Image Composition): This n8n node defines the processing parameters, including the background image URL and the composition template (centered).
HTTP Request (3. Check Job Status): Used repeatedly in the polling loop to retrieve the current status of the video job.
If (Is Complete? / Has Failed? / From Webhook?): Core n8n flow control nodes. They manage the state of the job, directing the flow based on whether the status is 'completed,' 'failed,' or still 'processing.'
Wait (Wait 20s): Essential for the polling mechanism, this n8n node pauses the execution for 20 seconds before checking the job status again, preventing unnecessary resource consumption and potential API rate limits.
HTTP Request (4. Download Video): Downloads the final processed MP4 file using the URL provided by the status check. It configures the response to be a file (binary data).


  • Google Drive (5. Upload to Google Drive): Uploads the binary video file using the dedicated Google Drive n8n node, naming it dynamically based on the job ID and timestamp, providing persistent storage.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by
Paul Roussel
Paul Roussel

Featured*