This workflow corresponds to n8n.io template #14531 — we link there as the canonical source.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "qdNJA9Ym3LDwvOmh",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "(Retail) Auto-Tag High-Risk SKUs",
"tags": [],
"nodes": [
{
"id": "66dde7a1-4cda-4399-9499-c611a6ba86b1",
"name": "Daily inventory risk check",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-1280,
-1376
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 6
}
]
}
},
"typeVersion": 1.2
},
{
"id": "29126940-ef8d-4fda-b91f-6112a1bb95c8",
"name": "Get last 14 days orders ",
"type": "n8n-nodes-base.wooCommerce",
"position": [
-992,
-1376
],
"parameters": {
"options": {
"after": "={{ new Date(Date.now() - 14 * 24 * 60 * 60 * 1000).toISOString()}}",
"before": "={{ new Date().toISOString() }}",
"status": "completed"
},
"resource": "order",
"operation": "getAll",
"returnAll": true
},
"credentials": {
"wooCommerceApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "7270f91a-6221-43ae-b558-de4eabdfb697",
"name": "Get product details",
"type": "n8n-nodes-base.wooCommerce",
"position": [
-704,
-1376
],
"parameters": {
"options": {},
"operation": "getAll"
},
"credentials": {
"wooCommerceApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "01830bd7-0151-4c92-809a-8819ff97a1f8",
"name": "Process Products one by one",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-480,
-1376
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "b4c0f619-5e59-4339-93cb-b6bfa4b36181",
"name": "Calculate Sales & Risk level",
"type": "n8n-nodes-base.code",
"position": [
-192,
-1552
],
"parameters": {
"jsCode": "// Product coming from Split In Batches\nconst product = $input.first().json;\n\n// Orders coming from \"Get many orders1\"\nconst orders = $items(\"Get last 14 days orders \").map(i => i.json);\n\nlet unitsSold = 0;\n\nfor (const order of orders) {\n for (const li of order.line_items || []) {\n if (\n li.product_id === product.id ||\n li.variation_id === product.id\n ) {\n unitsSold += li.quantity;\n }\n }\n}\n\nlet risk = \"OK\";\nif (unitsSold >= 2) risk = \"Watchlist\";\nif (unitsSold >= 6) risk = \"High-Risk\";\nif (unitsSold >= 10) risk = \"Critical\";\n\nreturn [{\n json: {\n product_id: product.id,\n product_name: product.name,\n sku: product.sku,\n stock_status: product.stock_status,\n units_sold_last_14_days: unitsSold,\n risk_level: risk\n }\n}];\n"
},
"typeVersion": 2
},
{
"id": "06c6fac5-00aa-4428-bd63-3e05b438cdca",
"name": "Split product by risk level",
"type": "n8n-nodes-base.switch",
"position": [
0,
-1584
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "7affd809-b0cc-470d-9aaf-0f4e3e82ef5d",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.risk_level }}",
"rightValue": "Watchlist"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "e4aa4342-fbdf-41fc-993c-5cc6b9d29b9f",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.risk_level }}",
"rightValue": "High-Risk"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "319d99a2-407a-41b3-a37f-2f1a72bc8673",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.risk_level }}",
"rightValue": "Critical"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b698734a-c84b-4fa2-a15a-7012aa5c7a93",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.risk_level }}",
"rightValue": "OK"
}
]
}
}
]
},
"options": {}
},
"typeVersion": 3.3
},
{
"id": "90de4c50-16f3-4e62-9e43-00f6eeed2bb4",
"name": "Prepare watchlist products",
"type": "n8n-nodes-base.set",
"position": [
272,
-1744
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a83125a5-61d5-4b18-8e08-dff8db148c7b",
"name": "product_id",
"type": "number",
"value": "={{ $json.product_id }}"
},
{
"id": "f2960968-9d40-436c-bfd3-74e790b7f665",
"name": "tag",
"type": "string",
"value": "={{ $json.risk_level }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "97b45b60-1be3-4cbe-bd45-adfe1203e66d",
"name": "Prepare High-risk products",
"type": "n8n-nodes-base.set",
"position": [
272,
-1568
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a83125a5-61d5-4b18-8e08-dff8db148c7b",
"name": "product_id",
"type": "number",
"value": "={{ $json.product_id }}"
},
{
"id": "f2960968-9d40-436c-bfd3-74e790b7f665",
"name": "tag",
"type": "string",
"value": "={{ $json.risk_level }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "5bb2c325-7714-48a0-9bdb-73b903f8e7ac",
"name": "Prepare Critical products",
"type": "n8n-nodes-base.set",
"position": [
272,
-1360
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a83125a5-61d5-4b18-8e08-dff8db148c7b",
"name": "product_id",
"type": "number",
"value": "={{ $json.product_id }}"
},
{
"id": "f2960968-9d40-436c-bfd3-74e790b7f665",
"name": "tag",
"type": "string",
"value": "={{ $json.risk_level }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "126a6257-3428-4eb8-93ad-15f443ce8f7e",
"name": "Update Product tag as Watchlist",
"type": "n8n-nodes-base.wooCommerce",
"position": [
496,
-1744
],
"parameters": {
"imagesUi": {},
"resource": "product",
"operation": "update",
"productId": "={{ $json.product_id }}",
"metadataUi": {},
"dimensionsUi": {},
"updateFields": {
"tags": [
74
]
}
},
"credentials": {
"wooCommerceApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "4325229f-517b-47cd-aafc-b5effc494ea4",
"name": "Update Product tag as High-risk",
"type": "n8n-nodes-base.wooCommerce",
"position": [
496,
-1568
],
"parameters": {
"imagesUi": {},
"resource": "product",
"operation": "update",
"productId": "={{ $json.product_id }}",
"metadataUi": {},
"dimensionsUi": {},
"updateFields": {
"tags": [
75
]
}
},
"credentials": {
"wooCommerceApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "86d847af-bb21-4f28-94d0-786135649e94",
"name": "Update Product tag as Critical",
"type": "n8n-nodes-base.wooCommerce",
"position": [
496,
-1360
],
"parameters": {
"imagesUi": {},
"resource": "product",
"operation": "update",
"productId": "={{ $json.product_id }}",
"metadataUi": {},
"dimensionsUi": {},
"updateFields": {
"tags": [
76
]
}
},
"credentials": {
"wooCommerceApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "9e0a7f91-1a33-4c8e-b14d-e5bb694e2027",
"name": "Combine tagged products",
"type": "n8n-nodes-base.merge",
"position": [
784,
-1584
],
"parameters": {
"numberInputs": 3
},
"typeVersion": 3.2
},
{
"id": "bc79f689-645d-4554-854d-9f9088fedbe4",
"name": "Prepare data for Alerts",
"type": "n8n-nodes-base.set",
"position": [
992,
-1568
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "f70f6f5d-8b6c-4575-8320-67e3a4ca5643",
"name": "id",
"type": "number",
"value": "={{ $json.id }}"
},
{
"id": "a44acc50-d5b2-446e-9a91-b7c270dcd834",
"name": "sku",
"type": "string",
"value": "={{ $json.sku }}"
},
{
"id": "005d1e73-b3b5-4f4b-9163-5f18dcaea4ab",
"name": "units_sold_last_14_days",
"type": "number",
"value": "={{ $('Split product by risk level').item.json.units_sold_last_14_days }}"
},
{
"id": "81f76126-7e36-4cb8-bdef-0a32efb8164f",
"name": "Risk",
"type": "string",
"value": "={{ $json.tags[0].name }}"
},
{
"id": "67a2a837-eb7c-4a2e-8e04-28c13bdf6c8e",
"name": "name",
"type": "string",
"value": "={{ $json.name }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "eb2c08e3-912c-4d50-838f-acad689499c7",
"name": "Build slack alert message",
"type": "n8n-nodes-base.code",
"position": [
1184,
-1568
],
"parameters": {
"jsCode": "const items = $input.all();\n\nif (!items.length) {\n return [];\n}\n\nlet message = `Inventory Risk Alert (Last 14 Days)\\n\\n`;\nmessage += `${items.length} product(s) require attention:\\n\\n`;\n\nfor (const item of items) {\n const { id, name, sku, units_sold_last_14_days, Risk } = item.json;\n\n\n message += `\u2022 ${name} (ID: ${id})\\n`;\n message += ` SKU: ${sku || 'N/A'}\\n`;\n message += ` Sold: ${units_sold_last_14_days || 0}\\n`;\n message += ` Risk: ${Risk}\\n\\n`;\n}\n\nreturn [{\n json: {\n slack_message: message.trim()\n }\n}];\n"
},
"typeVersion": 2
},
{
"id": "c6fdf508-0629-4963-a33f-f72d04461f76",
"name": "Notify team for Inventory alert",
"type": "n8n-nodes-base.slack",
"position": [
1456,
-1312
],
"parameters": {
"text": "={{ $json.slack_message }}",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "list",
"value": "C09S57E2JQ2",
"cachedResultName": "n8n"
},
"otherOptions": {
"includeLinkToWorkflow": false
}
},
"credentials": {
"slackApi": {
"name": "<your credential>"
}
},
"typeVersion": 2.3
},
{
"id": "2d9d3ab2-1c22-4b07-934d-57a6e1883dbc",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1360,
-1472
],
"parameters": {
"color": 7,
"height": 256,
"content": "Starts the workflow automatically on Schedule to review product sales and stock risk."
},
"typeVersion": 1
},
{
"id": "8110e78d-98f7-47f0-b110-7e8f9f039158",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1104,
-1504
],
"parameters": {
"color": 7,
"width": 832,
"height": 320,
"content": "## Get Orders & Products Process\n**Get last 14 days orders:** Fetches all completed WooCommerce orders from the last 14 days to calculate product sales.\n**Get product details:** Fetches product information like name, SKU and stock status from WooCommerce.\n**Process Products one by one:** Processes each product individually to calculate sales and risk level accurately."
},
"typeVersion": 1
},
{
"id": "5d6618c9-e57d-4bc2-8afa-2738ad7af821",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
-1728
],
"parameters": {
"color": 7,
"width": 432,
"height": 368,
"content": "## Analyze Sales & Classify Risk\nAnalyzes product sales from the last 14 days, determines risk level and routes products to the correct action path."
},
"typeVersion": 1
},
{
"id": "7ef1b9e3-ae72-4751-a283-4c25d0495246",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
208,
-1904
],
"parameters": {
"color": 7,
"width": 448,
"height": 720,
"content": "## Apply Inventory Risk Tags\nThis step checks how risky each product is and adds the correct label (Watchlist, High-Risk or Critical) to the product in the store so it\u2019s easy to see which items need attention."
},
"typeVersion": 1
},
{
"id": "0a9fe7ba-33e2-4282-8a8a-d5720ca10fb4",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1392,
-1408
],
"parameters": {
"color": 7,
"height": 288,
"content": "Sends the inventory risk alert message to the Slack channel for the team to review."
},
"typeVersion": 1
},
{
"id": "8f3d9f1f-bd67-44ba-9037-d6b335dc1acd",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
688,
-1792
],
"parameters": {
"color": 7,
"width": 672,
"height": 432,
"content": "## Prepare Inventory Alert\n\n**Combine tagged products:** Combines all tagged products (Watchlist, High-Risk, Critical) into one list for reporting.\n**Prepare data for Alerts:** Keeps only required fields like product name, units sold and risk level for Slack alerts.\n**Build slack alert message:** Creates a clean, readable inventory risk alert message using product sales data."
},
"typeVersion": 1
},
{
"id": "7886bd52-aa46-4937-ab69-757a43bbc791",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1936,
-2016
],
"parameters": {
"width": 480,
"height": 640,
"content": "## How it Works\n\nThis workflow automatically checks your WooCommerce store every day and reviews product sales from the last 14 days. It counts how many units of each product were sold and assigns a risk level **OK** for normal sales, **Watchlist** when sales start increasing, **High-Risk** when stock may run out soon and **Critical** when immediate attention is needed. Based on this risk level, the workflow updates each product in WooCommerce with the correct tag, combines all risky products into a single list and sends a clear Slack alert showing the product name, units sold and risk level, helping you quickly identify fast-selling or low-stock items without manually checking reports.\n\n\n\n## Setup Steps\n\n**1.** Connect your **WooCommerce account** (API credentials)\n\n**2.** Make sure product **Tags exist** in WooCommerce\n(Watchlist, High-Risk, Critical)\n\n**3.** Set the **sales thresholds** if needed (inside the \u201cCalculate Risk\u201d node)\n\n**4.** Connect your **Slack account** and choose a channel\n\n**5.** Set the **schedule time** (default: once daily)\n\n**6.** Activate the workflow "
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "b1295c33-1462-4131-9543-427d9468b126",
"connections": {
"Get product details": {
"main": [
[
{
"node": "Process Products one by one",
"type": "main",
"index": 0
}
]
]
},
"Combine tagged products": {
"main": [
[
{
"node": "Prepare data for Alerts",
"type": "main",
"index": 0
}
]
]
},
"Prepare data for Alerts": {
"main": [
[
{
"node": "Build slack alert message",
"type": "main",
"index": 0
}
]
]
},
"Get last 14 days orders ": {
"main": [
[
{
"node": "Get product details",
"type": "main",
"index": 0
}
]
]
},
"Build slack alert message": {
"main": [
[
{
"node": "Notify team for Inventory alert",
"type": "main",
"index": 0
}
]
]
},
"Prepare Critical products": {
"main": [
[
{
"node": "Update Product tag as Critical",
"type": "main",
"index": 0
}
]
]
},
"Daily inventory risk check": {
"main": [
[
{
"node": "Get last 14 days orders ",
"type": "main",
"index": 0
}
]
]
},
"Prepare High-risk products": {
"main": [
[
{
"node": "Update Product tag as High-risk",
"type": "main",
"index": 0
}
]
]
},
"Prepare watchlist products": {
"main": [
[
{
"node": "Update Product tag as Watchlist",
"type": "main",
"index": 0
}
]
]
},
"Process Products one by one": {
"main": [
[],
[
{
"node": "Calculate Sales & Risk level",
"type": "main",
"index": 0
}
]
]
},
"Split product by risk level": {
"main": [
[
{
"node": "Prepare watchlist products",
"type": "main",
"index": 0
}
],
[
{
"node": "Prepare High-risk products",
"type": "main",
"index": 0
}
],
[
{
"node": "Prepare Critical products",
"type": "main",
"index": 0
}
],
[]
]
},
"Calculate Sales & Risk level": {
"main": [
[
{
"node": "Split product by risk level",
"type": "main",
"index": 0
}
]
]
},
"Update Product tag as Critical": {
"main": [
[
{
"node": "Combine tagged products",
"type": "main",
"index": 2
}
]
]
},
"Notify team for Inventory alert": {
"main": [
[
{
"node": "Process Products one by one",
"type": "main",
"index": 0
}
]
]
},
"Update Product tag as High-risk": {
"main": [
[
{
"node": "Combine tagged products",
"type": "main",
"index": 1
}
]
]
},
"Update Product tag as Watchlist": {
"main": [
[
{
"node": "Combine tagged products",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
slackApiwooCommerceApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow automatically monitors product sales in your WooCommerce store, detects fast-selling items, applies risk tags and sends a clear alert to Slack—so you never miss products that need attention.
Source: https://n8n.io/workflows/14531/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
This workflow automatically checks your WooCommerce store’s last 24 hours of revenue, top-selling products, and cancelled orders on a daily schedule. It sends Slack notifications when sales cross a de
This workflow automates the process of managing product inventory levels, categorizing them into low stock and urgent low stock, sending alerts to Slack and creating Jira issues for urgent low stock p
This workflow is designed for engineering teams, project managers, and IT operations who need consistent visibility into team availability across multiple projects. It’s perfect for organizations that
This workflow is an automated system that tracks End-of-Life (EOL) dates for software and technologies used across your projects. It eliminates the need to manually monitor EOL dates in spreadsheets o
This workflow continuously monitors the Meta Ads Library for new creatives from a specific competitor pages, logs them into Google Sheets, and sends a concise Telegram notification with the number of