Solved

Flow not triggering, webhook not sending

  • 16 November 2022
  • 2 replies
  • 277 views

Badge +1

Hello

 

I want to trigger a flow when a user joins the list Newsletter. 

 

Currently the user is being added to the list Newsletter successfully with double opt in, and single opt in, but in either case, the flow is not triggering, resulting in my webhook not sending.

 

I can see that the user is added to the list on my dashboard, so why would the flow not trigger?

 

When I send this webhook as a test manually from the Klaviyo dashboard, it sends successfully to my server.

 

A screenshot of the Flow I wish to trigger

 

I have deleted the test user from my Newsletter list and retried several times. A double opt in email sends, I click to opt in, I am added to the Newsletter list, and still, the Flow above is not triggered. Again, single and double opt in functionality has been tested with the same result.

 

My code for adding a user to the Newsletter list which is successful:

...
const url = `https://a.klaviyo.com/api/v2/list/<LIST ID>/subscribe?api_key=${process.env.KLAVIYO_PRIVATE_KEY}`;

const options = {
method: 'POST',
headers: {accept: 'application/json', 'content-type': 'application/json'},
body: JSON.stringify({
profiles: [
{email: req.body.email}
]
})
};

fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));

...

 

icon

Best answer by fddev 16 November 2022, 17:50

View original

2 replies

Badge +1

Hello all

 

I solved my issue. I had to delete the profile entirely that I was using to test this functionality. I deleted my profile from my Klaviyo dashboard, not just from the list Newsletter, but the entire profile. I then cleared my own database and retried the process to trigger the flow.

 

And it worked like a charm. Single and double opt in.

Userlevel 7
Badge +60

Hey @fddev 

I am so happy you were able to figure this out on your own! You are absolutely right, contacts can only receive a list-triggered flow once. If someone is removed from a list and then re-added to that same list, they will not re-trigger the flow. For example, if someone unsubscribes from your newsletter list and then re-subscribes, they will not receive the welcome series again.

Thanks for sharing this with the community!

Reply