n8n flows
Update On-Hand Inventory Counts
Keeps Supabase inventory in sync with real-time available quantities from ShipHero, per warehouse and base SKU.
This flow keeps Supabase Inventory Units_Remaining_in_Stock in sync with real-time available quantities from ShipHero, per warehouse and Base SKU.
At a glance
- Status: Active.
- Trigger: Schedule (every 30 min), a WeWeb sign-in webhook, a "draft PO replen finished" webhook, an Execute Workflow call from Purchase Order Update Handler, and a manual Test trigger.
- Runs on: Every warehouse and its inventory rows.
- Talks to: ShipHero GraphQL (per-brand token), Supabase, and WeWeb.
How it works
- It loads all warehouses, all base SKUs, and all brands into memory for lookup.
- It loops warehouses; for each,
Get Inventory Records For Warehousefetches itsInventoryrows. Prepare Inventory Arrayfilters out rows with a nullbase_sku_idand enriches each with its_inventory_skuand_shiphero_access_tokenfrom the in-memory maps.- It loops inventory rows;
Get Base SKU On-Hand QTY In Warehousecalls ShipHero GraphQLwarehouse_products(sku, warehouse_id)with the brand token. Update Available Quantity For Inventorywrites ShipHero'savailablevalue toUnits_Remaining_in_Stock.
Notes
- Per-row Supabase lookups are disabled in favor of the in-memory enrichment map for performance.
- It writes ShipHero's
availablefield, not the rawon_handvalue.
Related
- Purchase Order Update Handler calls this flow as a sub-workflow after a PO update.
- Missing Shipment Data Pull 2.0 (Backup): sibling shipment-graph reconciliation.
- SKU Information Handler: the shared SKU-resolution service.
- Error Handler is the shared error workflow.
- Features: Inventory, Shipments. See also Data flows.
Backfill Missing Product SKUs
A manual maintenance flow that repairs shipment line items with a null Product SKU by re-fetching them from ShipHero.
Notify: Shipment Cost Exceeded
Emails brand users when an order's actual shipping-label cost exceeds its postage threshold, with a ShipHero unit-count guard against false positives.