Skip to main content

Hi,

I am building an integration (a Zapier application) with API that does not support conditional webhook; so it fires all events on a configured webhook and provides a type of event fired in a POST body, json, a kind of:
{
   event_type: “xxx”, 
   event_specific_data” {

      xxxxxxxxx
   }
}

 

I build an UI, a combo with multiple choice, with the list of event_types to choose. 

How can I prevent from firing trigger based on selected in UI types and and event type? In other words, can I stop running workflow programmatically based on some business rules.

Thank you!

Hi @Dmitry Karpezo 

In short, yes this is possible. You will need to check in your Perform request the event type before returning anything. https://platform.zapier.com/cli_tutorials/resthooks#step-3-write-the-perform-function 

Assuming the input variable in the trigger is also called event_type your check might look something like this

 


Hey Dmitry,

Yep, GetUWired has it right here. If you’re using CLI, then the check would be in your trigger’s read_hook method