Marketing · n8n

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.

difficulty Intermediatesetup 45 minresult Marketers get an automated safety net that keeps discontinued Zendrop products out of active Klaviyo campaigns by suppressing the relevant audience segment in real time.
  1. 1

    Schedule a daily check for discontinued products

    Add a Schedule Trigger node and set the Rule to 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. 2

    Fetch discontinued products from Zendrop API

    Add an HTTP Request node. Set Method to GET and URL to https://api.zendrop.com/v1/products?status=discontinued. Under Authentication choose Header Auth and add your Zendrop API key as Authorization: Bearer YOUR_KEY. The node returns a JSON array of discontinued product objects including their SKUs and titles.

  3. 3

    Extract the product SKU list into a clean array

    Add a Set node to reshape the Zendrop response. Create a new field called skus and 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. 4

    Look up Klaviyo profiles tagged with those SKUs

    Add a second HTTP Request node. Set Method to GET and URL to https://a.klaviyo.com/api/profiles/?filter=any(properties.last_purchased_sku,[{{ $json.skus }}]). Add a header Authorization: Klaviyo-API-Key YOUR_KLAVIYO_KEY and revision: 2024-02-15. This returns all profiles whose last purchased SKU matches any discontinued product.

  5. 5

    Suppress matched profiles in Klaviyo

    Add a third HTTP Request node. Set Method to POST and URL to https://a.klaviyo.com/api/profile-suppression-bulk-create-jobs/. Set Body Content Type to 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.

About this recipe. Recipes on FlowRecipesHub are written for business owners, not developers, and are tested before publishing — how recipes get made. Some ingredient links are affiliate links that cost you nothing — full disclosure.