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.
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
Every 30 minutes ClickRuntime reads your sheet for products not yet marked Done.
It sends each product's main image to your background-removal service.
The clean image is uploaded to your store and set as the product's main image, keeping the original in the gallery.
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
Build your own
Need it to work differently?
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
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?
What happens to the original photo?
Can it do virtual try-on images?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Write SEO titles and descriptions for your products
Products you list in a sheet get AI-written SEO titles and meta descriptions in WooCommerce, with progress tracked in the sheet.
See how it worksAdd products to WooCommerce from a sheet
New rows in your product sheet become WooCommerce products with AI-written descriptions, and stock changes in the sheet are kept in sync.
See how it worksBuild customer lists for new-category campaigns
When you add a new product category, customers who bought related products are pulled into a sheet, ready for a campaign.
See how it worksKeep exploring
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.