πŸ“ Remove Google Drive photo backgrounds and log results to Google Sheets with LassoCut

⚑ 0 views Β· πŸ“ File Management

Description

Quick overview

This workflow monitors a Google Drive folder for new images, removes their backgrounds using LassoCut, saves the cut-outs back to Drive, and logs processing details (including errors and credits used) to a Google Sheets log.

How it works

  1. Triggers every minute when a new file is created in a specified Google Drive folder, or runs manually to process all files already in that folder.
  2. Lists files in the input folder (for manual runs) and filters to JPEG/PNG/WebP images that are 22 MB or smaller.
  3. Processes images one at a time by downloading each file from Google Drive and sending it to LassoCut to remove the background.
  4. Uploads the cut-out image to a Google Drive output folder using a β€œ-cutout” filename and moves the original file to a done folder.
  5. If downloading, background removal, or uploading fails, moves the original file to a failed folder and captures the error details.
  6. Appends one row per image to Google Sheets with links, dimensions, detected type, credits charged, and a processed/failed status.
  7. Builds a run summary that counts processed and failed images and totals the credits used.

Setup

  1. Install the community node package n8n-nodes-lassocut and create a LassoCut API credential with your LassoCut API key.
  2. Add Google Drive OAuth2 credentials for the Google Drive trigger and Drive actions, and a Google Sheets OAuth2 credential for the Google Sheets append step.
  3. Create four Google Drive folders (input, output, done, failed) and paste their IDs/URLs into the workflow settings, then select the same input folder in the Google Drive trigger.
  4. Create a Google Sheets spreadsheet (with a tab name matching the configured sheet name, such as β€œLog”) and paste its ID/URL into the workflow settings.

Requirements

Customization

Additional info

Built by the founder of LassoCut, who maintains the verified n8n-nodes-lassocut node.

πŸ”— Nodes Used

Google Sheets, Google Drive, Google Drive Trigger, Filter

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup