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
- The webhook receives the draft PO id.
- The flow reads the draft PO record and checks
notification_sent; if already sent, it stops. - It sets
notification_sent = true, then in parallel fetches the PO's account brand and its active users. Loop Over Usersreads each user's preferences and checkssend_notificationsandinventory_management.draft_pos.- 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_sentflag: 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_posvalue inuser_settings. Nothing reads it now.