National Commerce Docs
n8n flows

Delete Voided Shipment Labels (Daily)

Removes shipment records from Supabase whose ShipHero labels were voided on a given day for a given brand.

This flow removes shipment records from Supabase whose ShipHero labels were voided on a given day for a given brand, keeping the Shipments table clean of voided labels.

At a glance

  • Status: Active.
  • Trigger: Webhook (responds immediately) and a manual Test trigger. Called by the Missing Shipment Data Pull flows with date, cursor, and brand_id.
  • Runs on: One brand and one day per call.
  • Talks to: ShipHero GraphQL (per-brand token) and Supabase.

How it works

  1. Choose Trigger To Use merges the payload (webhook body or test defaults) and stores the args in execution custom data for debugging.
  2. Get Brand For Shipment fetches the brand's ShipHero token, and cursor nodes prime pagination.
  3. Get Voided Shipments From Shiphero (ShipHero GraphQL shipments(voided: true, date_from/date_to)) pages 100 at a time; a guard checks for errors, and after run-index ≥ 49 it stops and waits to restart, otherwise it keeps paging.
  4. It loops shipments, then shipping labels; for each label's tracking number, Find Shipment Record looks it up in Shipments.
  5. If found, Delete Voided Shipment removes it by id; otherwise it stores the not-found id for debugging.

Notes

  • Designed to be invoked per-brand by the data-pull flows rather than run standalone. It includes an unconnected all-brand scaffold.
  • It uses $execution.customData to record payload args and not-found ids for debugging.

On this page