Trigger Klaviyo Shipping Flow Automatically When Zendrop Marks Orders as Shipped
When Zendrop marks an order as shipped, this workflow instantly sends the customer's data and tracking info to Klaviyo to trigger a post-purchase shipping notification flow. No more manually uploading CSVs or delayed shipping emails.
- 1
Catch the Zendrop Shipped Webhook
Add a
Webhooknode as the trigger. Set theHTTP Methodto POST and note the generated webhook URL. In your Zendrop account under Settings > Webhooks, paste this URL and select the 'Order Shipped' event. This node will receive the payload every time an order ships. - 2
Filter for Shipped Status Only
Add an
IFnode connected to the Webhook node. Set the condition to check that{{$json.body.status}}equals the stringshipped(use the exact value Zendrop sends, which may also beShipped). Route the TRUE branch forward and leave the FALSE branch empty to stop non-shipped events. - 3
Shape the Data for Klaviyo
Add a
Setnode after the IF TRUE branch. Create fields:emailmapped to{{$json.body.customer_email}},order_idto{{$json.body.order_id}},tracking_numberto{{$json.body.tracking_number}}, andtracking_urlto{{$json.body.tracking_url}}. This normalizes the payload before sending to Klaviyo. - 4
Create or Update the Klaviyo Profile
Add an
HTTP Requestnode. SetMethodto POST andURLtohttps://a.klaviyo.com/api/profiles/. InHeadersaddAuthorizationasKlaviyo-API-Key YOUR_PRIVATE_KEYandContent-Typeasapplication/json. In theBody(JSON), send{"data":{"type":"profile","attributes":{"email":"{{$json.email}}"}}}. Store your Klaviyo private API key in n8n Credentials and reference it here. This ensures the profile exists before the event is sent. - 5
Send the Shipped Event to Klaviyo
Add a second
HTTP Requestnode. SetMethodto POST andURLtohttps://a.klaviyo.com/api/events/. Use the sameAuthorizationheader with your Klaviyo private key. Set the JSON body to{"data":{"type":"event","attributes":{"metric":{"data":{"type":"metric","attributes":{"name":"Order Shipped"}}},"profile":{"data":{"type":"profile","attributes":{"email":"{{$json.email}}"}}} ,"properties":{"order_id":"{{$json.order_id}}","tracking_number":"{{$json.tracking_number}}","tracking_url":"{{$json.tracking_url}}"}}}}. In Klaviyo, create a Flow triggered by the 'Order Shipped' metric to send your shipping email.
Frequently asked questions
What exact status string does Zendrop send in its webhook payload?
Zendrop typically sends the status as 'shipped' in lowercase, but this can vary. Test the webhook by clicking 'Send Test' in Zendrop and inspect the raw payload in n8n's execution log to confirm the exact value before configuring the IF node condition.
How do I create the Klaviyo flow that this workflow triggers?
In Klaviyo go to Flows > Create Flow > Build Your Own. Set the trigger to 'Metric' and choose 'Order Shipped' (it will appear after the first event fires). Then add an Email step with your shipping confirmation template and include dynamic blocks for tracking_number and tracking_url using Klaviyo's event property variables.
Is my Klaviyo private API key safe in n8n?
Yes. Store it as an n8n Generic Credential (Header Auth) rather than pasting it directly in the node parameters. n8n encrypts stored credentials. Never share your workflow JSON publicly if you have hardcoded keys, and rotate the key immediately if you suspect exposure.