How to Schedule a Daily Inventory Sync
Set up a workflow that runs daily to keep inventory levels synchronized.
What This Integration Does
Most stores don't need real-time inventory sync, but they do need a reliable nightly reset that catches anything that drifted during the day. This workflow pulls authoritative stock levels from your source of truth (warehouse, ERP, or central database) and pushes them to your e-commerce store overnight, ensuring you start every morning with accurate availability for the customer-facing site.
The workflow runs at a quiet hour (typically 02:00 local time), reads inventory from the source, sets absolute levels in the store, and reports the run. Because it pushes absolute levels rather than deltas, it's self-healing: any drift introduced by mid-day promotions, manual edits, or transient API failures is corrected by morning.
Prerequisites
- An inventory source connection: MongoDB, NetSuite, or another ERP / database.
- A destination store connection: Shopify, WooCommerce, or BigCommerce with inventory write permission.
- A SKU mapping so every source SKU resolves to the right variant / inventory item in the destination store.
- Optional: a Slack connection for run summary alerts.
Step 1: Schedule Trigger
Drop a Trigger node and set it to Schedule, daily at 02:00 in your local timezone. The trigger fires at a quiet hour when site traffic is low and store APIs are most responsive.
Step 2: Fetch Authoritative Inventory
Add a Connector node to read the source:
- netsuite
run-suiteqlagainst theitemtable to read on-hand quantity per item per location - mongodb
find-documentson your centralinventorycollection
Return a flat list of { sku, available, locationId } records.
Step 3: Load the SKU Mapping
Add a Connector node calling mongodb find-documents on a sku_mapping collection that links each canonical SKU to its store-specific identifiers (Shopify inventoryItemId + locationId, WooCommerce productId, BigCommerce variantId). Hold this in a variable for the loop.
Step 4: Update Each Product in the Store
Wrap the inventory list in a Loop and call the right store tool:
- shopify
adjust-inventorywith the mappedinventoryItemId,locationId, and the absoluteavailablelevel - woocommerce
update-productsettingstock_quantityandmanage_stock = true - bigcommerce
update-productsettinginventory_level
Capture success / failure for each call into an in-memory results array.
Step 5: Log the Run
Write the run summary to mongodb insert-documents in an inventory_sync_runs collection: start time, end time, total SKUs, successes, failures, plus an array of failed SKUs with error messages. This audit log makes it easy to see drift trends and diagnose the occasional bad run.
Step 6: Notify the Team
Add a Connector node calling slack send-message with a short summary: "Inventory sync complete. 4,213 SKUs updated, 0 failures." On any failure above a threshold, send a louder alert to the operations channel so the team can investigate before the store opens.
Tips
- Push absolute levels, not deltas. Daily syncs are about correcting drift; deltas compound the error.
- Run at 02:00 local, not UTC. A "daily" UTC schedule fires at a different local hour twice a year due to DST.
- If the source dataset is large, page through it instead of loading everything into memory.
run-suiteqlpaginates naturally. - Combine with an intra-day delta sync (every 15 minutes for fast movers) to get both responsiveness and overnight correction.
Common Pitfalls
- SKU mapping gaps. Anything missing from the mapping silently drops. Periodically diff the source SKU list against the mapping and alert on new SKUs.
- Multi-location stores. Decide whether the source level represents one location or all locations summed. Misalignment here causes the most painful oversells.
- Rate limits during the run. 50k SKUs on Shopify's GraphQL admin API needs throttling. Sleep between batches or chunk by location.
- WooCommerce's
manage_stockflag. If false on a product,stock_quantitywrites are silently ignored.
Testing
Set a known canonical level on three test SKUs (e.g. 42), run the workflow manually, and confirm the store shows 42 for those SKUs. Run again immediately; nothing should change. Then enable the daily schedule and let it run overnight.