National Commerce Docs
n8n flows

Pulling Purchase Orders

Bulk-imports all purchase orders and their line items from ShipHero into Supabase.

A manual backfill utility. It pulls every purchase order and its line items from ShipHero into Supabase, reconciling PO records, line items, warehouses, and the Case/Base SKU catalog links.

At a glance

  • Status: Inactive (manual trigger only)
  • Trigger: Manual ("When clicking 'Test workflow'").
  • Runs on: On demand, as a one-off backfill.
  • Talks to: ShipHero (GraphQL); Supabase (Inventory Purchase Orders, Inventory Purchase Order Line Items, Warehouses, Case SKUs, Base SKUs).

How it works

  1. Get Purchase Orders From Shiphero fetches up to 100 POs with nested line items and product data.
  2. A homemade counter loop iterates POs one at a time.
  3. Per PO, the flow finds the record by purchase_order_uuid and creates or updates it in Inventory Purchase Orders.
  4. It finds the warehouse by warehouse.legacy_id and links it to the PO if not already linked.
  5. A second counter loop creates or updates each PO line item in Inventory Purchase Order Line Items.
  6. For SKU resolution it finds or creates the Case SKU, derives and finds or creates the Base SKU (with weight) from ShipHero, then links line item to Case SKU to Base SKU.

Notes

  • Appears to be the manual backfill predecessor to the webhook-driven Purchase Order Update Handler.
  • Uses homemade counter loops rather than SplitInBatches.

On this page