How to Automate Background Removal for Google Drive Images with n8n

Save hours handling product images by automating background removal from Google Drive using n8n and PhotoRoom API. This workflow downloads images, removes backgrounds with padding, and reuploads them transparently or with color backgrounds.
googleDrive
httpRequest
set
+6
Workflow Identifier: 2238
NODES in Use: set, httpRequest, splitOut, googleDrive, editImage, googleDriveTrigger, splitInBatches, if, merge
Automate background removal with n8n and PhotoRoom API

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Workflow Does

This workflow watches one Google Drive folder for new pictures. It downloads each new picture. Then, it finds out the size of the picture. Next, it sends the picture to the PhotoRoom API to remove the background. You can choose a background color and add padding around the subject. The workflow can keep the original size or resize to a fixed size. After editing, it uploads the new picture back to another Google Drive folder. It adds “BG-Removed-” before the filename. This saves time and makes product images look better.


Who Should Use This Workflow

Anyone who has many product photos in Google Drive and needs to remove backgrounds fast should use this. It is good for online sellers who want clean and same-sized images. If manual editing takes too long or causes errors, this workflow helps fix that. The user must have an n8n account, Google Drive with permission, and a PhotoRoom API key.


Tools and Services Used

  • n8n: Runs the workflow automation.
  • Google Drive: Stores original and edited images.
  • PhotoRoom API: Removes backgrounds and adds padding.

Beginner Step-by-Step: How to Use This Workflow in n8n

Step 1: Import the Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open your n8n editor.
  3. Click on “Import from File” and choose the downloaded workflow.

Step 2: Configure Credentials and Settings

  1. Enter your Google Drive OAuth2 credentials to allow access to files.
  2. Type your PhotoRoom API key into the workflow’s Config node.
  3. Update the Google Drive folder URLs or IDs if needed for input and output folders.
  4. Check and adjust parameters like background color, padding percentage, and output size in the Config node.

Step 3: Test the Workflow

  1. Upload a test image to the input Google Drive folder.
  2. Run the workflow manually or watch for the trigger to activate.
  3. Confirm the edited image uploads correctly with the BG-Removed prefix.

Step 4: Activate for Production

  1. Toggle the workflow to active in n8n.
  2. Confirm the Google Drive Trigger node is enabled.
  3. Let the workflow run automatically whenever new images arrive.

For advanced users, adjust batch settings or concurrency for multiple images. If self hosting n8n, see self-host n8n for setup help.


Workflow Inputs, Processing, and Outputs

Inputs

  • New image file uploaded to a specific Google Drive input folder.
  • PhotoRoom API key for background removal requests.
  • Configuration parameters: background color, padding, keep size choice, and output folder.

Processing Steps

  • Trigger listens for new images.
  • Download image binary data from Google Drive.
  • Use Edit Image node to get width and height of the image.
  • Decide if keeping original size or resizing based on config.
  • Send image and options to PhotoRoom API using HTTP Request node.
  • Receive processed image response.
  • Upload new image with “BG-Removed-” file name prefix back to output Google Drive folder.

Outputs

  • Images with backgrounds removed and new padding applied.
  • Consistent image size if chosen to resize.
  • All processed images stored in Google Drive output folder ready for use.

Edge Cases and Failure Points

  • Missing or wrong PhotoRoom API key causes failure to remove background.
  • Google Drive credentials without write access prevent uploading processed images.
  • Uploaded files that are not images or empty cause errors in size detection or API calls.
  • Incorrect folder paths or IDs stop trigger or upload from working.

Test with supported image files and make sure all keys and folder links are correct. Back up original images before batch processing.


Customizing the Workflow

  • Change background color in Config node by editing bg_color to any CSS color or hex value.
  • Switch keepInputSize to true or false to keep original image size or force to fixed size.
  • Adjust padding value to increase or reduce space around the image subject.
  • Update OutputDriveFolder URL to send images to a different Google Drive folder.
  • Use batch processing options to handle many images efficiently by controlling node concurrency.

Summary of Results

✓ Save time by automating image background removal.
✓ Get images in consistent sizes and styles.
✓ Avoid manual editing errors.
✓ Automatically upload ready-to-use images back to Google Drive.
✓ Easily change background and padding settings for branding needs.

Automate background removal with n8n and PhotoRoom API

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

The Google Drive Trigger node watches a chosen folder for new image files and starts the workflow when a file is added.
The workflow will fail to remove backgrounds because the PhotoRoom API requires a valid API key to process images.
Yes, by setting the ‘keepInputSize’ parameter to true in the Config node, the workflow keeps the original image size during processing.
Edited images are saved to the Google Drive folder specified in the Config node with a filename prefix ‘BG-Removed-‘.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.