Automatically Exclude Discontinued Zendrop Products from Klaviyo Campaigns
When a product is discontinued in Zendrop, this workflow fetches the affected SKUs and adds matching Klaviyo profiles to a suppression list, preventing embarrassing out-of-stock promotions from reaching customers.
- 1
Schedule a daily check for discontinued products
Add a
Schedule Triggernode and set theRuleto run once per day at a time that suits your team, such as 07:00. This node kicks off the workflow automatically every morning so your Klaviyo lists stay current without manual effort. - 2
Fetch discontinued products from Zendrop API
Add an
HTTP Requestnode. SetMethodto GET andURLtohttps://api.zendrop.com/v1/products?status=discontinued. UnderAuthenticationchooseHeader Authand add your Zendrop API key asAuthorization: Bearer YOUR_KEY. The node returns a JSON array of discontinued product objects including their SKUs and titles. - 3
Extract the product SKU list into a clean array
Add a
Setnode to reshape the Zendrop response. Create a new field calledskusand set its value to the expression{{ $json.products.map(p => p.sku).join(',') }}. This produces a comma-separated string of discontinued SKUs that the next node can use as a Klaviyo segment filter. - 4
Look up Klaviyo profiles tagged with those SKUs
Add a second
HTTP Requestnode. SetMethodto GET andURLtohttps://a.klaviyo.com/api/profiles/?filter=any(properties.last_purchased_sku,[{{ $json.skus }}]). Add a headerAuthorization: Klaviyo-API-Key YOUR_KLAVIYO_KEYandrevision: 2024-02-15. This returns all profiles whose last purchased SKU matches any discontinued product. - 5
Suppress matched profiles in Klaviyo
Add a third
HTTP Requestnode. SetMethodto POST andURLtohttps://a.klaviyo.com/api/profile-suppression-bulk-create-jobs/. SetBody Content Typeto JSON and paste the body:{ "data": { "type": "profile-suppression-bulk-create-job", "attributes": { "profiles": { "data": {{ $json.data.map(p => ({ type: 'profile', id: p.id })) }} } } } }. Add the same Klaviyo auth header. Klaviyo will suppress every matched profile, excluding them from future campaign sends.
Frequently asked questions
What Zendrop API endpoint should I use to find discontinued products?
Use the products list endpoint with a status filter: GET https://api.zendrop.com/v1/products?status=discontinued. Check your Zendrop developer docs for the exact parameter name as it may vary by account tier.
Will suppressed Klaviyo profiles receive any emails at all?
No. Once a profile is added to Klaviyo's global suppression list they will not receive any campaign or flow emails until you manually unsuppress them. Use a dedicated suppression list instead if you want the exclusion to be temporary and reversible per campaign.
How do I unsuppress profiles if a product comes back in stock?
You can extend this workflow by adding a parallel branch that calls the Zendrop API for products returning to active status and then calls the Klaviyo unsuppress endpoint (DELETE on the suppression resource) for the same profiles, effectively reversing the process automatically.