Shopify + WooCommerce: inventory stays in sync
Your inventory can be “right” in Shopify and still be wrong in WooCommerce. Then a customer buys the last item twice, support gets the angry email, and you’re stuck refunding orders you could’ve prevented.
This kind of inventory sync automation hits store owners first, but ops managers and the marketing person running promos feel the fallout too. If you sell the same catalog in Shopify and WooCommerce, this workflow keeps stock aligned and gives you a clean paper trail.
You’ll see how the workflow compares stock, applies updates to the right store, logs every change to Google Sheets, and emails you when something looks off.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Shopify + WooCommerce: inventory stays in sync
flowchart LR
subgraph sg0["⏰ Hourly Reconciliation Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "⏰ Hourly Reconciliation Trig..", pos: "b", h: 48 }
n1["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>📥 Platform Webhook Receiver"]
n2@{ icon: "mdi:swap-vertical", form: "rounded", label: "📝 Parse Trigger Data", pos: "b", h: 48 }
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>🛍️ Fetch Shopify Inventory"]
n4["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>🛒 Fetch WooCommerce Inventory"]
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>🔀 Merge All Platform Data"]
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>🔍 Compare & Identify Discrep.."]
n7@{ icon: "mdi:swap-horizontal", form: "rounded", label: "❓ Has Discrepancies?", pos: "b", h: 48 }
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>📋 Split Discrepancies for AI.."]
n9["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>📝 Prepare Update Actions"]
n10@{ icon: "mdi:swap-horizontal", form: "rounded", label: "🚨 Needs Manual Review?", pos: "b", h: 48 }
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/code.svg' width='40' height='40' /></div><br/>🔀 Split Updates by Platform"]
n12@{ icon: "mdi:swap-horizontal", form: "rounded", label: "🔀 Route Updates to Platforms", pos: "b", h: 48 }
n13["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>🛍️ Update Shopify"]
n14["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>🛒 Update WooCommerce"]
n15["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>🔀 Merge Update Results"]
n16@{ icon: "mdi:database", form: "rounded", label: "📊 Log to Google Sheets Audit", pos: "b", h: 48 }
n17@{ icon: "mdi:swap-horizontal", form: "rounded", label: "📧 Send Notification?", pos: "b", h: 48 }
n18@{ icon: "mdi:message-outline", form: "rounded", label: "✉️ Send Alert Email", pos: "b", h: 48 }
n19["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/webhook.dark.svg' width='40' height='40' /></div><br/>📤 Return Response"]
n7 --> n8
n7 --> n19
n13 --> n15
n18 --> n19
n2 --> n3
n2 --> n4
n17 --> n18
n17 --> n19
n14 --> n15
n15 --> n16
n10 --> n16
n10 --> n11
n9 --> n10
n5 --> n6
n1 --> n2
n1 --> n9
n11 --> n12
n16 --> n17
n12 --> n13
n12 --> n14
n3 --> n5
n4 --> n5
n0 --> n2
n6 --> n7
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n7,n10,n12,n17 decision
class n16 database
class n1,n3,n4,n13,n14,n19 api
class n6,n8,n9,n11 code
classDef customIcon fill:none,stroke:none
class n1,n3,n4,n5,n6,n8,n9,n11,n13,n14,n15,n19 customIcon
The Problem: Inventory Drifts Across Shopify and WooCommerce
If you’re selling on two platforms, stock drift is almost guaranteed. A return gets processed in one store but not the other. A manual adjustment is made during a rush. A bulk update imports weirdly, and suddenly your “5 in stock” product is actually at zero. The worst part is the delay: you usually find out after an oversell, not before it. Then you’re cleaning up orders, editing listings, and trying to figure out which number was ever correct in the first place.
The friction compounds. Here’s where it breaks down.
- Checking Shopify and WooCommerce product-by-product turns into a weekly ritual that eats about 2 hours.
- Manual “quick fixes” create new mistakes, especially when two people update stock on the same day.
- You end up overselling during promotions because the faster store doesn’t wait for the slower one.
- When something goes wrong, there’s no audit trail, so you can’t confidently answer “what changed and when?”
The Solution: Automatic Stock Sync + Logged Exceptions
This workflow gives you a reliable inventory handshake between Shopify and WooCommerce. It runs on a schedule (your “inventory pulse”) or fires instantly from a webhook when a platform reports a change. n8n pulls stock data from both stores, combines the feeds, then compares the numbers to spot mismatches. If it’s a clean, safe update, it builds the right action and pushes the correction back to the store that’s out of date. Every update gets written to Google Sheets so you can review what happened later. And when a mismatch looks risky or needs a human decision, the workflow flags it and emails you through Gmail so it doesn’t quietly rot in the background.
The workflow starts with a timer or webhook and normalizes the incoming payload. Then Shopify and WooCommerce stock levels are fetched and merged into one comparison set. Finally, updates are applied where appropriate, results are logged to Google Sheets, and Gmail sends an alert if review is needed.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you manage 200 SKUs across Shopify and WooCommerce. A basic manual routine is checking stock in one store, checking the other, then adjusting. Even at 1 minute per SKU to verify and fix, that’s about 3 hours when you do a full sweep. With this workflow, you set the inventory pulse (for example, every hour), and the system handles the comparison and updates automatically. Your “work” becomes reviewing the occasional Gmail alert and scanning the Google Sheets log, which is usually about 10 minutes.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Shopify for reading and updating stock levels.
- WooCommerce to fetch inventory and apply corrections.
- Google Sheets for audit logging and review history.
- Gmail to send exception and mismatch alerts.
- Shopify + WooCommerce API keys (create them in each platform’s developer/API settings).
Skill level: Intermediate. You’ll connect accounts, paste API keys, and map fields like SKU and stock quantity.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
A schedule or webhook starts the run. The workflow can fire on a timer (“Scheduled Inventory Pulse”) for steady syncing, or it can react instantly when a webhook sends a platform change.
Inventory is pulled from both storefronts. n8n uses HTTP requests to retrieve Shopify stock and WooCommerce stock, then normalizes the data so you’re comparing like-for-like (usually SKU plus quantity).
Differences are detected and turned into actions. A code step calculates variance, an If check decides what’s a real discrepancy, and another code step builds the actual “update this item” instructions. Some mismatches can be marked for manual review, which is frankly a good guardrail.
Updates, logs, and alerts happen automatically. Updates are routed to Shopify or WooCommerce, results are merged, then everything is written to Google Sheets. If the alert condition is met, Gmail sends a message and the workflow returns a clear webhook response.
You can easily modify the sync frequency to match how fast your catalog moves. You can also adjust what counts as “manual review needed” so you’re not bothered by harmless edge cases. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Schedule & Webhook Triggers
Set up the two entry points so the workflow can run on a timer or respond to platform webhooks.
- Open ⏰ Scheduled Inventory Pulse and set the schedule rule to run every hour (the node uses Interval with Field set to
hours). - Open 📥 Incoming Platform Webhook and set Path to
inventory-webhook, HTTP Method toPOST, and Response Mode toresponseNode. - Note the parallel flow: 📥 Incoming Platform Webhook outputs to both 📝 Map Trigger Payload and 📝 Build Update Actions in parallel.
Step 2: Connect Shopify and WooCommerce Data Sources
Normalize the trigger payload and pull product data from Shopify and WooCommerce in parallel.
- In 📝 Map Trigger Payload, set assignments: triggerType to
={{ $json.body ? 'webhook' : 'schedule' }}, sku to={{ $json.body?.sku || 'ALL' }}, platform to={{ $json.body?.platform || 'ALL' }}, and syncMode to={{ $json.body?.sku ? 'single' : 'full' }}. - In 🛍️ Retrieve Shopify Stock, set URL to
https://{{ $env.SHOPIFY_STORE }}.myshopify.com/admin/api/2024-01/products.jsonand enable query parameterslimit=250andfields=id,title,variants. - In 🛒 Retrieve Woo Stock, set URL to
={{ $env.WOOCOMMERCE_URL }}/wp-json/wc/v3/productsand enable query parametersper_page=100andstatus=publish. - Confirm parallel execution: 📝 Map Trigger Payload outputs to both 🛍️ Retrieve Shopify Stock and 🛒 Retrieve Woo Stock in parallel.
Credential Required: Connect your httpHeaderAuth credentials in 🛍️ Retrieve Shopify Stock.
Credential Required: Connect your httpBasicAuth credentials in 🛒 Retrieve Woo Stock.
Tip: Ensure environment variables like SHOPIFY_STORE and WOOCOMMERCE_URL are defined in n8n so the request URLs resolve correctly.
Step 3: Set Up Inventory Variance Processing
Combine platform feeds, detect discrepancies, and split them into individual items for downstream actions.
- In 🔀 Combine Platform Feeds, set Mode to
combineto merge Shopify and WooCommerce responses. - Open 🔍 Detect Stock Variance and keep the provided inventory normalization and comparison code (no parameter changes required).
- In ❓ Discrepancy Check, confirm the condition uses Left Value
={{ $json.summary.discrepanciesFound }}with Operationgtand Right Value0. - In 📋 Segment Variances for AI, keep the code that splits each discrepancy into separate items for downstream processing.
Step 4: Configure Update Actions and Store Routing
Translate discrepancy items into update actions, route by store, and push inventory updates in parallel.
- In 📝 Build Update Actions, keep the code that parses AI decisions and constructs platform update payloads.
- In 🚨 Manual Review Needed?, confirm the condition checks
={{ $json.requiresManualReview }}equalstrue. - In 🔀 Separate Updates by Store, keep the code that splits update items into individual platform updates.
- In 🔀 Route Updates by Store, confirm the rules route
={{ $json.platform }}to outputsshopifyandwoocommerce. - In 🛍️ Apply Shopify Update, set URL to
=https://{{ $env.SHOPIFY_STORE }}.myshopify.com/admin/api/2024-01/inventory_levels/set.json, Method toPUT, and body parameters: location_id={{ $env.SHOPIFY_LOCATION_ID }}, inventory_item_id={{ $json.variantId }}, available={{ $json.newQuantity }}. - In 🛒 Apply Woo Update, set URL to
={{ $env.WOOCOMMERCE_URL }}/wp-json/wc/v3/products/{{ $json.productId }}, Method toPUT, and JSON Body to={ "stock_quantity": {{ $json.newQuantity }} }. - Note the parallel execution: 🔀 Route Updates by Store outputs to both 🛍️ Apply Shopify Update and 🛒 Apply Woo Update in parallel.
Credential Required: Connect your httpHeaderAuth credentials in 🛍️ Apply Shopify Update (already configured in the workflow).
Credential Required: Connect your httpBasicAuth credentials in 🛒 Apply Woo Update.
Step 5: Configure Audit Logging, Alerts, and Webhook Response
Merge update results, log audits to Google Sheets, send alerts when needed, and return webhook responses.
- In 🔀 Combine Update Results, set Mode to
combineso Shopify and Woo results are merged. - In 📊 Write Audit to Sheets, set Operation to
appendOrUpdate, Sheet Name toAudit Log, and Document ID to={{ $env.GOOGLE_SHEETS_AUDIT_ID }}. Map columns using the provided expressions like={{ $json.sku }},={{ $json.platform }}, and={{ $now.toISO() }}. - In 📧 Alert Required?, confirm the boolean check uses
={{ $json.aiDecision?.requiresManualReview || $json.severity === 'critical' }}equalstrue. - In ✉️ Dispatch Alert Email, set Send To to
={{ $env.NOTIFICATION_EMAIL }}, Subject to=🚨 Inventory Sync Alert: {{ $json.sku }}, and Message to the HTML template provided in the node. - In 📤 Return Webhook Result, set Respond With to
jsonand Response Body to={{ { "success": true, "summary": $('🔍 Detect Stock Variance').item.json.summary, "discrepanciesProcessed": $('📝 Build Update Actions').all().length, "updatesApplied": $('🔀 Combine Update Results').all().length, "timestamp": $now.toISO() } }}.
Credential Required: Connect your Google Sheets credentials in 📊 Write Audit to Sheets.
Credential Required: Connect your Gmail credentials in ✉️ Dispatch Alert Email.
Step 6: Test and Activate Your Workflow
Validate both trigger paths and confirm updates, audit logs, and alerts behave as expected.
- Manually execute ⏰ Scheduled Inventory Pulse to verify the scheduled path runs through 📝 Map Trigger Payload, pulls data, and logs to 📊 Write Audit to Sheets.
- Send a POST request to the 📥 Incoming Platform Webhook URL with a sample payload to validate the webhook path and the JSON response from 📤 Return Webhook Result.
- Confirm a successful run creates rows in the
Audit Logsheet and sends email alerts only when 📧 Alert Required? evaluates to true. - Activate the workflow by toggling it to Active once testing is successful.
Common Gotchas
- Shopify credentials can expire or require the right scopes for inventory. If updates fail, check the app permissions in Shopify Admin and re-auth in n8n.
- If you’re using Wait nodes or your store APIs are slow during peak hours, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Google Sheets logging can silently break if a column name changes. Confirm the “Write Audit to Sheets” mapping still matches your header row before trusting the audit trail.
Frequently Asked Questions
About 30 minutes if your API keys are ready.
No. You’ll connect Shopify, WooCommerce, Google Sheets, and Gmail, then confirm your SKU and quantity fields line up.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also want to consider any Shopify/WooCommerce API limits, although most stores won’t hit them with an hourly sync.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, but you’ll keep the same logic and swap the notification step. Replace the “Dispatch Alert Email” (Gmail) node with a Slack node, then wire it to the existing “Alert Required?” decision so only real exceptions notify your team. Common customizations include changing the sync frequency, adding a “do nothing” path for tiny variances, and writing extra fields (like product name and URL) into the Google Sheets audit.
Usually it’s an expired token or missing inventory permissions in the Shopify app settings. Reconnect Shopify in n8n, confirm the app has access to inventory endpoints, and verify you’re hitting the right store domain. If failures happen only during big runs, you may be running into rate limits, so spacing requests out can help.
Thousands, assuming your API limits and server resources are reasonable.
Often, yes, because this is not just “if X then Y.” You’re merging two feeds, calculating variance, branching on exceptions, then writing an audit log, which is the kind of workflow that gets awkward (and expensive) in simpler tools. n8n also gives you a self-hosting option, which means you’re not paying per tiny step when you scale. Zapier or Make can still be fine if you only want a basic low-stock alert or a single two-step sync. If you’re unsure, Talk to an automation expert and you’ll get a straight recommendation.
Once this is running, stock mismatches stop being a surprise. The workflow handles the repetitive checks, logs the truth in Google Sheets, and nudges you only when something genuinely needs attention.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.