Hi all ![]()
I’m Jerome, I built LassoCut (background removal) and maintain the n8n-nodes-lassocut node, which n8n verified last week, so it’s now available directly on n8n Cloud (search “LassoCut” in the nodes panel).
I wanted to share a workflow I use to test it on a WooCommerce store, in case it’s useful to someone:
1. Every hour (or on demand) it lists the products.
2. It skips products that have no image or were already processed (a `lassocut_processed` custom field).
3. For each remaining product: downloads the main image, removes the background on white (JPG, the format most marketplaces want), uploads the result to the WordPress media library and sets it as the main product image. The original photo stays in the gallery and the alt text is kept.
4. Failures (broken image URL, no credits left…) are collected in a summary instead of stopping the run, and the product is retried next time.
5. Runs are capped (20 products by default), so a large catalogue is processed in chunks.
A second run on the same store processes nothing and uses no credits, which was the main thing I wanted to get right.
Setup: WooCommerce REST API key (read/write), a WordPress application password for the media upload, and a LassoCut account (free accounts get 50 previews a month; a full-size image is 1 credit).
The workflow JSON is attached. Happy to answer questions or take suggestions, especially from people processing big catalogues.
{
“name”: “Remove backgrounds from new WooCommerce product images with LassoCut”,
“nodes”: [
{
“parameters”: {
“content”: “## Remove backgrounds from new WooCommerce product images with LassoCut\n\n### Who it’s for\nWooCommerce store owners who want every product photo on a clean white background for their shop, Google Shopping, Amazon or eBay, without editing images by hand.\n\n### How it works\n1. Every hour (or Run now) reads your Settings.\n2. Get all products lists the catalogue. Products that already carry the lassocut_processed marker or have no image are skipped, and each run is capped (20 products by default).\n3. For each product, the main image is downloaded, LassoCut removes the background and puts the product on white (JPG).\n4. The new image is uploaded to the media library and becomes the main product image. The original stays in the gallery and in the library, and the product gets the marker so it is never processed (or billed) twice.\n5. A failed product (broken image, no credits left…) is recorded and the loop moves on. Build run summary counts processed products, failures and credits used.\n\n### Setup\n1. Install the verified community node n8n-nodes-lassocut (Settings > Community nodes).\n2. Create a free account at https://www.lassocut.com and add your API key as a LassoCut API credential.\n3. WooCommerce > Settings > Advanced > REST API: create a Read/Write key and add it as a WooCommerce API credential (used by Get all products and Set as main product image).\n4. Users > Profile > Application Passwords: create one and add it as a Wordpress API credential (username + application password) on Upload to media library.\n5. Put your store URL in Settings. Your store must use https (WooCommerce keys are refused over plain http).\n6. Test with Run now, then publish the workflow.\n\n### Requirements\n- WooCommerce 5+ on https, and a LassoCut account. Free accounts get 50 previews a month (up to 10 a day). A full-size result costs 1 credit. Credit packs start at $9 for 100 credits, and credits never expire.\n\n### How to customise\n- Settings: background colour (ffffff, f5f5f5…), size (preview is free for tests), format, marker name, products per run, keep the original in the gallery or not.\n- Replace the schedule with a WooCommerce Trigger (product.created) if n8n has a public URL.\n- Send the summary to Slack or email after Build run summary.\n- To redo a product, delete its lassocut_processed custom field.\n\n### Disclosure\nBuilt by the founder of LassoCut, who maintains the n8n-nodes-lassocut node.”,
“height”: 860,
“width”: 760
},
“id”: “6c75b809-639b-5acb-9e22-67e95f3d3502”,
“name”: “Sticky Note - Overview”,
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
-800,
0
]
},
{
“parameters”: {
“content”: “## 1. Start and settings\nRuns every hour, or now from the editor. Edit Settings first: store URL, background colour, size, format, marker name and products per run.”,
“height”: 460,
“width”: 440,
“color”: 7
},
“id”: “8a65faea-8ad1-5fb7-8ea7-94448ce3d5b9”,
“name”: “Sticky Note - Start”,
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
-20,
0
]
},
{
“parameters”: {
“content”: “## 2. Find products to process\nLists all products, keeps those with an image and without the marker, and caps the run so a large catalogue is processed in chunks over several runs.”,
“height”: 460,
“width”: 660,
“color”: 7
},
“id”: “1cdf0c1b-34d1-5368-ab71-db79805119f0”,
“name”: “Sticky Note - Find”,
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
440,
0
]
},
{
“parameters”: {
“content”: “## 3. One product at a time\nEach product goes through the steps on the right and comes back here, whether it worked or failed.”,
“height”: 460,
“width”: 260,
“color”: 7
},
“id”: “cd9413bc-6054-5991-b05c-ccf25539e4c6”,
“name”: “Sticky Note - Loop”,
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
1120,
0
]
},
{
“parameters”: {
“content”: “## 4. Remove the background\nDownloads the main image and sends it to LassoCut: the product on a white background, as a JPG ready for marketplaces.”,
“height”: 460,
“width”: 480,
“color”: 7
},
“id”: “c4542567-7097-5349-807f-01e4e8ee0cb8”,
“name”: “Sticky Note - Cutout”,
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
1400,
0
]
},
{
“parameters”: {
“content”: “## 5. Save to WooCommerce\nUploads the new image to the media library, makes it the main image (original kept in the gallery) and adds the lassocut_processed marker.”,
“height”: 460,
“width”: 700,
“color”: 7
},
“id”: “2c198902-c89a-513c-af91-7e9986f136ef”,
“name”: “Sticky Note - Save”,
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
1900,
0
]
},
{
“parameters”: {
“content”: “## Failures\nA broken image URL, a LassoCut error (no credits left, rate limit) or a WordPress error is recorded here. The product is not marked, so it is retried on the next run.”,
“height”: 380,
“width”: 1200,
“color”: 3
},
“id”: “9e6f959f-e76c-51a9-9a10-251ba25b7119”,
“name”: “Sticky Note - Errors”,
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
1400,
480
]
},
{
“parameters”: {
“content”: “## 6. Run summary\nCounts processed and failed products and the credits used. Connect a Slack, Gmail or Send Email node here to get the report.”,
“height”: 380,
“width”: 260,
“color”: 7
},
“id”: “ca4895f7-4866-5130-9b9c-f4d79225801b”,
“name”: “Sticky Note - Report”,
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
1120,
480
]
},
{
“parameters”: {
“rule”: {
“interval”: [
{
“field”: “hours”
}
]
}
},
“id”: “1b9f00b0-fb97-575c-aacf-b8ecee60ad85”,
“name”: “Every hour”,
“type”: “n8n-nodes-base.scheduleTrigger”,
“typeVersion”: 1.2,
“position”: [
40,
200
]
},
{
“parameters”: {},
“id”: “a088a9de-0921-5dc2-a357-1fff4e6a9df8”,
“name”: “Run now”,
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
40,
360
]
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “8a550056-6369-5724-9f6d-2a17ea724dcc”,
“name”: “storeUrl”,
“value”: “https://your-store.com”,
“type”: “string”
},
{
“id”: “7841c0bd-c690-52a8-b61b-ee31bc90efca”,
“name”: “backgroundColor”,
“value”: “ffffff”,
“type”: “string”
},
{
“id”: “a95748aa-b765-5871-9024-60724de4ab2c”,
“name”: “size”,
“value”: “full”,
“type”: “string”
},
{
“id”: “d6660a23-f4f0-5eb0-896a-801442baef5d”,
“name”: “format”,
“value”: “jpg”,
“type”: “string”
},
{
“id”: “ca1fbc10-a7c9-5cbc-a2d4-8993c37b601a”,
“name”: “markerKey”,
“value”: “lassocut_processed”,
“type”: “string”
},
{
“id”: “be16b760-a091-5428-a1f8-7e53a8bce75e”,
“name”: “maxProductsPerRun”,
“value”: 20,
“type”: “number”
},
{
“id”: “db3f5d72-c6d8-51b1-9088-51011161c72a”,
“name”: “keepOriginalInGallery”,
“value”: true,
“type”: “boolean”
}
]
},
“options”: {}
},
“id”: “81a9a48a-0c8a-5d3b-a976-a4b68e364d93”,
“name”: “Settings”,
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
260,
280
]
},
{
“parameters”: {
“resource”: “product”,
“operation”: “getAll”,
“returnAll”: true,
“options”: {}
},
“id”: “188d548d-5550-523c-b262-7b8e32db5205”,
“name”: “Get all products”,
“type”: “n8n-nodes-base.wooCommerce”,
“typeVersion”: 1,
“position”: [
500,
280
]
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “1c77df65-87ad-59b1-b8f3-3e4bd8cc18e5”,
“leftValue”: “={{ ($json.images || ).length > 0 }}”,
“rightValue”: “”,
“operator”: {
“type”: “boolean”,
“operation”: “true”,
“singleValue”: true
}
},
{
“id”: “34f65539-3068-528f-9b3b-3d9d01668947”,
“leftValue”: “={{ ($json.meta_data || ).some(m => m.key === $(‘Settings’).first().json.markerKey) }}”,
“rightValue”: “”,
“operator”: {
“type”: “boolean”,
“operation”: “false”,
“singleValue”: true
}
}
],
“combinator”: “and”
},
“options”: {}
},
“id”: “bc34052a-5781-5096-828e-3b0e7c637f9e”,
“name”: “Keep products to process”,
“type”: “n8n-nodes-base.filter”,
“typeVersion”: 2.2,
“position”: [
720,
280
]
},
{
“parameters”: {
“maxItems”: “={{ $(‘Settings’).first().json.maxProductsPerRun }}”
},
“id”: “c615af1f-dede-595e-b7c4-6d64e48fc5bb”,
“name”: “Cap products per run”,
“type”: “n8n-nodes-base.limit”,
“typeVersion”: 1,
“position”: [
940,
280
]
},
{
“parameters”: {
“batchSize”: 1,
“options”: {}
},
“id”: “628a197d-75e8-5787-ad79-eb29446a6aa3”,
“name”: “Loop over products”,
“type”: “n8n-nodes-base.splitInBatches”,
“typeVersion”: 3,
“position”: [
1200,
280
]
},
{
“parameters”: {
“url”: “={{ $json.images[0].src }}”,
“options”: {
“response”: {
“response”: {
“responseFormat”: “file”
}
},
“timeout”: 60000
}
},
“id”: “457d9a58-ead6-5ba0-a772-474dd579a954”,
“name”: “Download main image”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
1460,
280
],
“onError”: “continueErrorOutput”
},
{
“parameters”: {
“binaryPropertyName”: “data”,
“options”: {
“background”: “={{ $(‘Settings’).first().json.backgroundColor }}”,
“format”: “={{ $(‘Settings’).first().json.format }}”,
“size”: “={{ $(‘Settings’).first().json.size }}”,
“type”: “product”
}
},
“id”: “da0fc553-2d58-551e-a511-69d3db141101”,
“name”: “Remove background with LassoCut”,
“type”: “n8n-nodes-lassocut.lassocut”,
“typeVersion”: 1,
“position”: [
1680,
280
],
“onError”: “continueErrorOutput”
},
{
“parameters”: {
“method”: “POST”,
“url”: “={{ $(‘Settings’).first().json.storeUrl.replace(/\/$/, ‘’) }}/wp-json/wp/v2/media”,
“authentication”: “predefinedCredentialType”,
“nodeCredentialType”: “wordpressApi”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “Content-Disposition”,
“value”: “=attachment; filename=”{{ $(‘Loop over products’).item.json.slug || (‘product-’ + $(‘Loop over products’).item.json.id) }}-white.{{ $(‘Settings’).first().json.format }}“”
},
{
“name”: “Content-Type”,
“value”: “={{ { jpg: ‘image/jpeg’, png: ‘image/png’, webp: ‘image/webp’ }[$(‘Settings’).first().json.format] }}”
}
]
},
“sendBody”: true,
“contentType”: “binaryData”,
“inputDataFieldName”: “data”,
“options”: {}
},
“id”: “2d64bae4-0f2e-5cc7-9f1b-7869b45a8758”,
“name”: “Upload to media library”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
1960,
280
],
“onError”: “continueErrorOutput”
},
{
“parameters”: {
“method”: “PUT”,
“url”: “={{ $(‘Settings’).first().json.storeUrl.replace(/\/$/, ‘’) }}/wp-json/wc/v3/products/{{ $(‘Loop over products’).item.json.id }}”,
“authentication”: “predefinedCredentialType”,
“nodeCredentialType”: “wooCommerceApi”,
“sendBody”: true,
“specifyBody”: “json”,
“jsonBody”: “={{ JSON.stringify({\n images: [{ id: $json.id, alt: $(‘Loop over products’).item.json.images[0].alt || $(‘Loop over products’).item.json.name }]\n .concat(($(‘Settings’).first().json.keepOriginalInGallery ? $(‘Loop over products’).item.json.images : $(‘Loop over products’).item.json.images.slice(1)).map(i => ({ id: i.id }))),\n meta_data: [\n { key: $(‘Settings’).first().json.markerKey, value: $now.toISO() },\n { key: ‘lassocut_original_image_id’, value: String($(‘Loop over products’).item.json.images[0].id) }\n ]\n}) }}”,
“options”: {}
},
“id”: “a1d7dcea-9c4e-5231-97e0-097ba71e5a3e”,
“name”: “Set as main product image”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
2180,
280
],
“onError”: “continueErrorOutput”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “7260cac8-bd4c-5c4d-8f85-3a1f74f0b206”,
“name”: “product_id”,
“value”: “={{ $(‘Loop over products’).item.json.id }}”,
“type”: “number”
},
{
“id”: “b0261260-ebc3-521b-8a40-d996b0aefd9a”,
“name”: “product”,
“value”: “={{ $(‘Loop over products’).item.json.name }}”,
“type”: “string”
},
{
“id”: “d0e36380-e17e-52cf-b3dc-afa8a0d00d79”,
“name”: “status”,
“value”: “processed”,
“type”: “string”
},
{
“id”: “6421d110-b85b-5863-b1fe-0c394b4a5c38”,
“name”: “new_image_id”,
“value”: “={{ $json.images[0].id }}”,
“type”: “number”
},
{
“id”: “ec645001-2cbf-5645-8e80-901d0f0d76c9”,
“name”: “credits_charged”,
“value”: “={{ $(‘Remove background with LassoCut’).item.json.credits_charged ?? 0 }}”,
“type”: “number”
}
]
},
“options”: {}
},
“id”: “31497b1b-7be8-5793-bb8b-dc654aa381dd”,
“name”: “Record success”,
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
2400,
280
]
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “80750d5b-ac54-505b-a0c6-74e72a036602”,
“name”: “product_id”,
“value”: “={{ $(‘Loop over products’).item.json.id }}”,
“type”: “number”
},
{
“id”: “fd9fe45f-6045-577f-a83e-9e081ff0480a”,
“name”: “product”,
“value”: “={{ $(‘Loop over products’).item.json.name }}”,
“type”: “string”
},
{
“id”: “03adf651-b864-588a-93f4-5d04b9d88f53”,
“name”: “status”,
“value”: “failed”,
“type”: “string”
},
{
“id”: “4b347760-db94-5186-92c1-5c35e0d9670e”,
“name”: “step”,
“value”: “={{ $prevNode.name }}”,
“type”: “string”
},
{
“id”: “d771fd96-840b-58bf-a056-f387a1627f02”,
“name”: “error”,
“value”: “={{ typeof $json.error === ‘object’ ? ($json.error.message || JSON.stringify($json.error)) : ($json.error || ‘Unknown error’) }}”,
“type”: “string”
},
{
“id”: “bef1fd71-46b2-5e69-8162-547073813184”,
“name”: “credits_charged”,
“value”: 0,
“type”: “number”
}
]
},
“options”: {}
},
“id”: “9b43438c-a6c7-56da-aae8-6528d4dd3413”,
“name”: “Record failure”,
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
1960,
700
]
},
{
“parameters”: {
“jsCode”: “// One item per product comes back from the loop\nconst results = $input.all().map(item => item.json);\nconst processed = results.filter(r => r.status === ‘processed’);\nconst failed = results.filter(r => r.status === ‘failed’);\nconst creditsUsed = processed.reduce((sum, r) => sum + (Number(r.credits_charged) || 0), 0);\nconst outOfCredits = failed.some(r => /credit/i.test(r.error || ‘’));\n\nconst lines = [\n LassoCut run: ${processed.length} product image(s) replaced, ${failed.length} failed, ${creditsUsed} credit(s) used.,\n …failed.map(r => - ${r.product} (#${r.product_id}) failed at \"${r.step}\": ${r.error}),\n];\nif (outOfCredits) {\n lines.push(‘Out of credits: buy a pack at LassoCut pricing: credit packs, no subscription (credits never expire). Failed products are retried on the next run.’);\n}\n\nreturn [{\n json: {\n processed: processed.length,\n failed: failed.length,\n credits_used: creditsUsed,\n out_of_credits: outOfCredits,\n failures: failed,\n message: lines.join(‘\n’),\n },\n}];”
},
“id”: “de5f8ced-3a41-5fe1-b500-b64530156a9c”,
“name”: “Build run summary”,
“type”: “n8n-nodes-base.code”,
“typeVersion”: 2,
“position”: [
1200,
700
]
}
],
“connections”: {
“Every hour”: {
“main”: [
[
{
“node”: “Settings”,
“type”: “main”,
“index”: 0
}
]
]
},
“Run now”: {
“main”: [
[
{
“node”: “Settings”,
“type”: “main”,
“index”: 0
}
]
]
},
“Settings”: {
“main”: [
[
{
“node”: “Get all products”,
“type”: “main”,
“index”: 0
}
]
]
},
“Get all products”: {
“main”: [
[
{
“node”: “Keep products to process”,
“type”: “main”,
“index”: 0
}
]
]
},
“Keep products to process”: {
“main”: [
[
{
“node”: “Cap products per run”,
“type”: “main”,
“index”: 0
}
]
]
},
“Cap products per run”: {
“main”: [
[
{
“node”: “Loop over products”,
“type”: “main”,
“index”: 0
}
]
]
},
“Loop over products”: {
“main”: [
[
{
“node”: “Build run summary”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “Download main image”,
“type”: “main”,
“index”: 0
}
]
]
},
“Download main image”: {
“main”: [
[
{
“node”: “Remove background with LassoCut”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “Record failure”,
“type”: “main”,
“index”: 0
}
]
]
},
“Remove background with LassoCut”: {
“main”: [
[
{
“node”: “Upload to media library”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “Record failure”,
“type”: “main”,
“index”: 0
}
]
]
},
“Upload to media library”: {
“main”: [
[
{
“node”: “Set as main product image”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “Record failure”,
“type”: “main”,
“index”: 0
}
]
]
},
“Set as main product image”: {
“main”: [
[
{
“node”: “Record success”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “Record failure”,
“type”: “main”,
“index”: 0
}
]
]
},
“Record success”: {
“main”: [
[
{
“node”: “Loop over products”,
“type”: “main”,
“index”: 0
}
]
]
},
“Record failure”: {
“main”: [
[
{
“node”: “Loop over products”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“settings”: {
“executionOrder”: “v1”
},
“meta”: {
“templateCredsSetupCompleted”: false
},
“tags”:
}
