Solved

Is it possible to identify which Flow triggered a specific webhook?

  • 23 November 2022
  • 10 replies
  • 249 views

Badge +3

For context, I would like set up a Klaviyo webhook with a Flow and when handling the webhook request, I would like to be able to identify which Flow was responsible for triggering the webhook from the handler side. Can this be done? 

icon

Best answer by alex.hong 26 November 2022, 01:51

View original

10 replies

Userlevel 7
Badge +58

Hi there @nickriley ,

Thanks for sharing to the Community.

Please review our guide to adding webhooks to Flows to help troubleshoot where the error may be. You can also troubleshoot using an application like Postman to diagnose where the error may lie.
 
I apologize that I cannot be of more assistance here! I would also recommend Understanding Klaviyo Webhooks for more general information on how webhooks can be used in Klaviyo Flows. 

Badge +3

Hi @nickriley , Can you provide some further information on this? It is possible to set up a list/segment-triggered flow (please see here: Guide to Creating a List-Triggered Flow ) and also a metric-triggered flow (please see Guide to Creating a Metric-Triggered Flow ), but not a flow triggered by a webhook. Can you please provide some further information so we can see if there is a workaround available for you?

 

@alex.hong, in this case, I wouldn’t want to trigger a flow by a webhook. I would like to make a general webhook handler for Klaviyo Flows where I can identify which Flow sent the request to my destination URL, and do this on the handler side. Perhaps being able to send the event or Flow ID in the webhook JSON payload configured in the Klaviyo Flow UI if possible?

Userlevel 7
Badge +58

Hi @nickriley ,

We do have plans to release Webhook actions for Flows later this year. In the meantime, you can visit our Help Center article: Track and Identify API Reference This will walk you through how to use the API for tracking people and the events or actions they take. You can then essentially accomplish the same things as you can with Webhooks - it's just a different method of setting the code up.

I believe there should be an option to add a webhook action underneath an Update Profile Property flow block. 

Additionally, maybe this is something you can chat about with our Support team so they can take a closer look into your account and setup which we cannot do here on Community.

 

Thanks!

Badge +3

Thanks, @alex.hong . You can set up a webhook action in a Flow, but currently the only information that can be sent to a webhook destination is profile properties and event properties. Unfortunately, we maintain a Klaviyo integration on behalf of several Shopify merchants so polling the track and identity endpoint isn’t a very efficient workaround.

 

To summarize, Flows can be set up with different triggers. We really just need a way of sending the trigger type in the webhook request. When listing events using the newest API version, the event has the following properties:
 

"event_properties": {
...
"$flow": "<FLOW_ID>",
"$event_id": "<EVENT_ID>"
...
},
...

The `$flow` property could potentially be a viable workaround, as we could use the API to determine more about what flow triggered the webhook, however, ‘$flow’ isn’t always available and it’s never available as an event property when viewing the event from the Flow UI.  

Userlevel 7
Badge +58

Hi @nickriley ,

You can try including the flow ID in the payload. All Flows should have an ID. This is assigned programmatically every time a Flow is created and I've never come across a case where this hasn't been created. You can get the Flow IDs for each flow through this API endpoint: https://a.klaviyo.com/api/v1/flows?api_key=(private API Key). 

 

Badge +3

Results of attempting to include `$flow` in the webhook payload. Previewing the webhook: 

Note the populated “None”.

Badge +1

hello there,

were there any changes\progress for this? we are also looking to add the flow id \ flow name into the payload that is sent in the webhook call to our servers.

any help is appreciated.

thanks..

Userlevel 7
Badge +36

Hi @unique-username-007,

 

At this time, there is not functionality that allows this use case - however, I will certainly forward this feedback to our Product team and update the thread if anything changes.

 

Here are the developer docs for using webhooks with Klaviyo:

 

Best,

Brian

Just wanted to +1 this request - we’re also looking for a way to pass the flow ID over webhooks. We are looking for a way to aggregate webhook events on our server without the brand needing to specify a unique identifier as part of the webhook setup.

One simple suggestion to achieve this could be to automatically pass the flow ID that triggered the webhook action as a header, similar to how headers can be manually passed through today. 

Badge +1

Hey @Brian Turcotte  - checking if there are any news on this ?

 

appreciate any help here…

Thanks

Reply