National Commerce Docs
n8n flows

Notify: New Draft PO Created

Retired. Used to email brand users when a new draft purchase order was created, respecting their notification preferences.

When a new draft purchase order appeared, this flow emailed the relevant brand users. It honored each user's notification preferences and sent only once per PO.

Retired on October 7, 2026

The flow is unpublished in n8n, so its webhook no longer answers and the email cannot be sent. The Draft PO Created Notification setting was removed from Notification Settings at the same time. Its only caller was Hourly: Create Draft POs, which was turned off on September 24, 2026. Drafts created by hand or by the assistant never called it. The flow is kept in n8n, not archived or deleted.

At a glance

  • Status: Inactive (unpublished October 7, 2026)
  • Trigger: Webhook (POST /webhook/4d6d3f71-ca60-4ef5-8a66-34651953b801), not listening while unpublished.
  • Runs on: Nothing. It ran on a call from Hourly: Create Draft POs when that flow created a new draft PO.
  • Talks to: Supabase (Draft POs, Brands, userRoles, user_settings, Auth Admin API); Gmail.

How it works

  1. The webhook receives the draft PO id.
  2. The flow reads the draft PO record and checks notification_sent; if already sent, it stops.
  3. It sets notification_sent = true, then in parallel fetches the PO's account brand and its active users.
  4. Loop Over Users reads each user's preferences and checks send_notifications and inventory_management.draft_pos.
  5. For opted-in users it fetches the email through the Supabase Auth Admin API and sends a branded HTML notification via Gmail linking to the purchase-orders page.

Notes

  • Idempotent via the notification_sent flag: one email per PO.
  • Per-user opt-in gated on two preference flags.
  • Users who saved their preferences before the setting was removed still have a draft_pos value in user_settings. Nothing reads it now.

On this page