This article was drafted with AI help and reviewed by the author.
Most integration monitoring watches for errors. A webhook returns 500. A node fails. Someone gets a Slack alert.
Warehouse integrations also fail without any error at all. An order is released and the WMS never picks it up. A shipment is confirmed in the warehouse and never reaches the store. A channel shows 40 units of a SKU that the warehouse counted down to 12 last night. Nothing failed, so nothing alerted.
The fix is a scheduled job that asks a different question. Not "did anything break?" but "do the systems still agree?" This post builds that job in n8n. It covers which comparisons to run, how to stop the job itself from going silent, and how to track a mismatch across days so it does not get lost.
The Code node below is illustrative. It was syntax-checked and run locally with a small harness that mimics $(). It has not been run inside n8n or production-tested.
The four questions to ask every day
A warehouse integration moves orders out and moves shipments and stock back. So a daily check needs to cover both directions.
- Released but not acknowledged. The store or ERP released an order. Does the WMS know about it?
- Released but not shipped. The WMS has the order. Has it shipped within your agreed time, or been cancelled?
- Shipped on one side only. Does every WMS shipment have a matching fulfillment in the store? Does every store fulfillment have a WMS shipment behind it?
- Stock that disagrees. Does each channel show what the WMS has on hand, after reservations and safety stock?
The second half of question 3 matters more than it looks. A store fulfillment with no WMS shipment usually means some flow marked the order shipped on release. The customer already has a tracking email for a box that has not moved.
Workflow shape
``text Schedule Trigger (daily, 07:00 workflow time zone) -> HTTP Request: Released Orders -> HTTP Request: WMS Orders (Execute Once) -> HTTP Request: WMS Shipments (Execute Once) -> HTTP Request: Store Fulfillments (Execute Once) -> HTTP Request: WMS On Hand (Execute Once) -> HTTP Request: Reservations (Execute Once) -> HTTP Request: Channel Stock (Execute Once) -> Postgres or Sheets: Open Findings (Execute Once) -> Code: Reconcile (Run Once for All Items) -> Switch on status open -> upsert findings row by key resolved -> mark row resolved -> Summary to Slack or email ``
Three n8n details decide whether this works.
Time zone. Official n8n docs say the Schedule Trigger uses the workflow time zone if one is set, and otherwise the instance time zone. The self-hosted default is America/New York. Set the workflow time zone explicitly so "07:00" means the warehouse's morning.
Execute Once. Nodes in a chain run once per incoming item. If Released Orders returns 300 items, the next HTTP Request would run 300 times. Official node settings include Execute Once, which runs the node once with the first item. Turn it on for every fetch node after the first.
Always Output Data. In a chain, a node that returns no items can stop the nodes after it. On a reconciliation job that is the worst possible failure, because an empty WMS response is exactly what you want to notice. Official docs say Always Output Data makes the node return an empty item instead. Turn it on for the fetch nodes, then filter those empty items out in the Code node.
Pull each source with a time window that is a little wider than the comparison. For example, compare the last 7 days of releases, but fetch 10 days of shipments. Otherwise an order released on day 7 and shipped on day 8 looks like a mismatch.
The Code node
Official n8n docs say $("Node Name").all() returns the output items of a named node. In Run Once for All Items mode, the Code node runs a single time and returns an array of items, each with a json key.
The node names in rows() must match your canvas exactly.
```javascript // n8n Code node, mode: Run Once for All Items const SETTINGS = { settleMinutes: 120, ackGraceMinutes: 30, shipSlaHours: 48, stockTolerance: 0, minRows: { released: 1, wmsShipments: 1, wmsOnHand: 1 } }
// Fetch nodes use Always Output Data, so an empty result arrives as one empty item. function rows(nodeName) { return $(nodeName) .all() .map(item => item.json) .filter(json => Object.keys(json).length > 0) }
function reconcile(src, settings, now) { const findings = [] const minutesAgo = iso => (now - new Date(iso).getTime()) / 60000 const add = (type, ref, detail) => findings.push({ key: ${type}:${ref}, type, ref, detail })
for (const [name, min] of Object.entries(settings.minRows)) { if ((src[name] || []).length < min) { add("source_silent", name, Expected at least ${min} rows, got ${(src[name] || []).length}) } }
const wmsOrders = new Map(src.wmsOrders.map(o => [String(o.orderid), o])) const shippedOrders = new Set(src.wmsShipments.map(s => String(s.orderid))) const storeFulfilled = new Set(src.storeFulfillments.map(f => String(f.shipmentid))) const wmsShipmentIds = new Set(src.wmsShipments.map(s => String(s.shipmentid)))
for (const order of src.released) { const id = String(order.orderid) const age = minutesAgo(order.releasedat) if (age < settings.ackGraceMinutes) continue
const wms = wmsOrders.get(id) if (!wms) { add("releasednotacknowledged", id, Released ${Math.round(age)} min ago, unknown to WMS) continue } if (wms.status === "cancelled") continue if (!shippedOrders.has(id) && age > settings.shipSlaHours * 60) { add("releasednotshipped", id, Released ${Math.round(age / 60)} h ago, WMS status ${wms.status}) } }
for (const s of src.wmsShipments) { if (minutesAgo(s.shippedat) < settings.settleMinutes) continue if (!storeFulfilled.has(String(s.shipmentid))) { add("shippednotfulfilled", s.shipment_id, WMS shipped order ${s.order_id}, store has no fulfillment) } }
for (const f of src.storeFulfillments) { if (!wmsShipmentIds.has(String(f.shipmentid))) { add("fulfilledwithoutshipment", f.shipmentid, Store fulfilled order ${f.order_id}, WMS has no shipment) } }
const reserved = new Map(src.reservations.map(r => [r.sku, Number(r.reserved)])) const channel = new Map(src.channelStock.map(c => [c.sku, Number(c.available)])) for (const stock of src.wmsOnHand) { const expected = Math.max(0, Number(stock.onhand) - (reserved.get(stock.sku) || 0) - Number(stock.safetystock || 0)) const shown = channel.get(stock.sku) if (shown === undefined) { add("skumissingonchannel", stock.sku, WMS on hand ${stock.on_hand}, channel has no listing) } else if (Math.abs(shown - expected) > settings.stockTolerance) { add("stockmismatch", stock.sku, Channel shows ${shown}, expected ${expected}) } }
return findings }
function withAge(findings, openRows, today) { const firstSeen = new Map(openRows.map(r => [r.key, r.first_seen])) const current = new Set(findings.map(f => f.key)) const dayMs = 86400000
const open = findings.map(f => { const since = firstSeen.get(f.key) || today const ageDays = Math.round((new Date(today) - new Date(since)) / dayMs) return { ...f, status: "open", firstseen: since, agedays: ageDays } }) const resolved = openRows .filter(r => !current.has(r.key)) .map(r => ({ ...r, status: "resolved", resolved_on: today }))
return [...open, ...resolved] }
const now = Date.now() const today = new Date(now).toISOString().slice(0, 10)
const sources = { released: rows("Released Orders"), wmsOrders: rows("WMS Orders"), wmsShipments: rows("WMS Shipments"), storeFulfillments: rows("Store Fulfillments"), wmsOnHand: rows("WMS On Hand"), reservations: rows("Reservations"), channelStock: rows("Channel Stock") }
const findings = reconcile(sources, SETTINGS, now) const report = withAge(findings, rows("Open Findings"), today)
return report.map(r => ({ json: r })) ```
Why each setting exists
ackGraceMinutes gives the WMS time to accept a fresh release. Without it, every order released in the last few minutes shows up as unknown.
settleMinutes does the same for shipments. A confirmation can take a while to reach the store. Do not flag a shipment from ten minutes ago.
shipSlaHours is a business number, not a technical one. Agree it with operations. A 48-hour value is only an example.
stockTolerance starts at zero. Raise it only if you understand why the numbers can differ, for example a known delay between the WMS snapshot and the channel read.
minRows is the check that catches silence in the job itself. If the WMS API returns zero shipments on a normal weekday, that is not a clean day. It is a broken feed, an expired token, or a filter that is wrong. The job reports source_silent instead of a reassuring "0 mismatches".
Track findings across days
A daily report that lists the same 30 mismatches every morning gets ignored by the second week. So the job stores findings, not just reports them.
Each finding has a stable key such as released_not_shipped:1001. The Open Findings node reads yesterday's open rows. withAge() keeps the original first_seen date and works out age_days. Any open row that no longer appears is marked resolved.
That gives you three useful views without any extra tooling:
- New today, which is where you look first.
- Open for more than N days, which is where the process is broken.
- Resolved today, which tells you a fix worked.
Upsert rows by key in Postgres or a sheet. Give each row an owner column. The question of who owns reconciliation stops being abstract. It becomes a column with a real name in it.
The stock check is a check, not a sync
The Code node recomputes available stock as on hand minus reservations minus safety stock. That is only so it can compare. It must not push that number to the channel.
If the reconciliation job also writes stock, you now have two systems calculating availability. That is one of the failures you are trying to detect. When the check finds a mismatch, fix the system that owns the number, then let the next run confirm it.
Also make sure the rule in the Code node matches the real rule. If your order system applies channel allocation, the check needs the same allocation. Otherwise every SKU looks wrong.
Limitations
Partial shipments are counted as shipped in this sample. An order with one of three lines shipped will not show as released_not_shipped. A line-level comparison needs shipment lines in the WMS Shipments response.
The stock comparison assumes the WMS and channel reads happen close together. Fast-moving SKUs can differ for honest reasons between two API calls.
Large catalogs and order volumes may not fit in one Code node run. Page the sources and split the job by warehouse or SKU range if you hit memory or time limits.
API endpoints, field names, and the findings table are placeholders. The code was run locally with a small $() stub, not inside n8n.
Takeaways
- Errors tell you something broke. A daily comparison tells you something stopped.
- Check both directions: orders out, shipments and stock back.
- A store fulfillment with no WMS shipment is a loud bug hiding in a quiet place.
- Set the workflow time zone, use Execute Once on fetch nodes, and use Always Output Data so an empty source still reaches the Code node.
- Treat zero rows from a busy source as a finding.
- Store findings with a stable key and an age, so old problems do not blend into the noise.
- Never let the check write the numbers it is checking.
This job assumes someone already decided which system owns each number. The system-of-record map and the inventory sync choices behind that are laid out in this WMS integration playbook.
Top comments (1)
Silent failures are the expensive ones in supply-chain work — the order that never reaches the WMS doesn't raise an alert, it just quietly becomes a missed shipment. I like the both-directions check here, especially flagging a store fulfillment with no matching WMS shipment, and treating zero rows from a busy source as a finding rather than a clean bill of health. In the EDI world I work in at SignalEDI, ageing findings with a stable key is what keeps the same mismatch from being re-discovered every morning instead of actually getting fixed.