National Commerce Docs
n8n flows

Insert Customers by Order

Inactive backfill that creates end-customer records from ShipHero order addresses and links each order to its customer.

A one-off backfill that populates end-customer (Amazon buyer) records from ShipHero order shipping addresses and links each Supabase order to its customer record.

At a glance

  • Status: Inactive
  • Trigger: Manual ("When clicking 'Test workflow'"). No production trigger.
  • Runs on: Hand-run migration and backfill only.
  • Talks to: ShipHero (GraphQL); Supabase (Orders, End Customer (Amazon buyer)).

How it works

  1. Supabase reads Orders (getAll, limit 500), then Get Order Details From Shiphero fetches the shipping address per order number.
  2. Loop Over Items iterates orders; Supabase1 tries to find an existing End Customer (Amazon buyer) by full name plus address line 1.
  3. If1 branches on whether the customer was found.
  4. Not found: insert a new End Customer row, then update the order's End Customer (Amazon buyer)_id.
  5. Found: update the existing customer's order date, then link the order.

Notes

  • Inactive migration/backfill utility.
  • Dedupes customers by name plus address before inserting.

On this page