Skip to content

Every 30 minutes

Clean up product images from a sheet queue

Products you list in a sheet get new clean-background images made and attached in WooCommerce.

Runs
Every 30 minutes
Apps
Google Sheets, WooCommerce
AI
Not needed
Access
WooCommerce write; Sheets read+write

Send this to your assistant

Create a ClickRuntime automation: every 30 minutes, take product IDs from my Images sheet that aren't done, remove the background from each product's main image, upload the new image to the product, and mark the row Done.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Product photos taken in a back room or sent by suppliers come with cluttered backgrounds that make a shop look amateur. Editing each one by hand, or paying someone to, is slow and expensive for a small catalogue that keeps growing.

Queueing products in a sheet and having their images cleaned and swapped in automatically gives the whole store a consistent, professional look, one batch at a time.

What you get out of it

  • A consistent, professional store

    Clean backgrounds make products look like they belong to the same catalogue, which builds trust.

  • No photo editing

    Background removal happens through an image service, so nobody spends hours in an editor.

  • You choose what to fix

    Only products you add to the sheet are changed, so you can start with best sellers.

  • The original is kept

    The new image is added as the main image and the original stays in the product gallery.

How it works

What happens, step by step

  1. Every 30 minutes ClickRuntime reads your sheet for products not yet marked Done.

  2. It sends each product's main image to your background-removal service.

  3. The clean image is uploaded to your store and set as the product's main image, keeping the original in the gallery.

  4. The row is marked Done, so the product is not processed again.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect WooCommerce

What you get

RunsEvery 30 minutes
Clean up product images from a sheet queuetoday, 9:00Succeeded
Google Sheets · Images2291 · Acme Ceramic Pour-Over Set · new white-background image set as main image · Done

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Google Sheets and WooCommerce steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
ai_product_images_try_on_background_removal_from_a_sheet_queue.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
import base64
from clickruntime import on_trigger, report_fetched, credentials, http

SHEET_ID, SITE = "your-spreadsheet-id", "https://yourstore.com"

STORE = "https://yourstore.com/wp-json/wc/v3"

def wc(method, path, **kw):
    resp = http.request(method, STORE + path, auth=(credentials.secret("WC_CONSUMER_KEY"), credentials.secret("WC_CONSUMER_SECRET")), **kw)
    resp.raise_for_status()
    return resp.json()

def sheets():
    return build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets().values()

@on_trigger
def run(event):
    rows = sheets().get(spreadsheetId=SHEET_ID, range="Images!A2:B").execute().get("values", [])
    todo = [(n, r[0]) for n, r in enumerate(rows, start=2) if r and r[0] and (len(r) < 2 or r[1] != "Done")][:5]
    report_fetched(len(todo))
    for n, pid in todo:
        p = wc("GET", f"/products/{pid}")
        clean = http.post("https://api.remove.bg/v1.0/removebg", headers={"X-Api-Key": credentials.secret("REMOVE_BG_API_KEY")},
                          data={"image_url": p["images"][0]["src"], "bg_color": "ffffff", "format": "jpg"})
        clean.raise_for_status()
        media = http.post(f"{SITE}/wp-json/wp/v2/media", auth=("shop-admin", credentials.secret("WP_APP_PASSWORD")), data=clean.content,
                          headers={"Content-Disposition": f'attachment; filename="{p["slug"]}-clean.jpg"', "Content-Type": "image/jpeg"}).json()
        wc("PUT", f"/products/{pid}", json={"images": [{"id": media["id"]}] + [{"id": i["id"]} for i in p["images"]]})
        sheets().update(spreadsheetId=SHEET_ID, range=f"Images!B{n}", valueInputOption="RAW", body={"values": [["Done"]]}).execute()
    return {"done": len(todo)}

FAQ

Common questions

Which image service does it use?
An image background-removal service of your choice that offers an API, with its key saved in your ClickRuntime dashboard. This example uses remove.bg.
What happens to the original photo?
It is kept as a gallery image, so you can switch back at any time in WooCommerce.
Can it do virtual try-on images?
Yes, if your chosen image service offers it. Swap the service call and keep the same sheet queue.
What permissions does it need?
WooCommerce write; Sheets read+write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Clean up product images from a sheet queue” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.