I want to create a zap with branching logic. I want to do this since the gateway/REST API am using supports addition of only one web hook. I require a Zap that can perform Action 'A' when suppose trigger returns an event with 'event_type' = 'alpha' and Action 'B' will be performed when the same trigger returns an event with 'event_type' = 'beta'
example:
if trigger_A.output.event_type = 'alpha'
then 'Send mail' to 'abc@xyz.com'
else if trigger_A.output.event_type = 'beta'
then 'Send message' to 'Slack'
else
post in 'Facebook' trigger_A.output.message
Is this possible with a single Zap?
NOTE that I cannot add multiple webhooks to my REST API, and hence I cannot have multiple Triggers, and I can use use maximum 1 Zap.
Any help from the forum would be appreciated.
edit: This answer is outdated. See the other answer about Zapier's first-party support for Paths.
David here, from the Zapier Platform team.
I've got good news and bad news! The bad: this is not currently possible out of the box. It's being discussed internally and we have nothing further to say about it at this time.
The good news is that the workflow you describe is possible, but it'll take a few zaps:
Zap A: Webhooks (catch) -> Code -> Webhooks (post)
Zap B: Webhooks (catch) -> Gmail (send mail)
Zap C: Webhooks (catch) -> Slack (send message)
Zap D: Webhooks (catch) -> Facebook (create new post)
The steps are as follows:
event_type
url
variable based on the event type. Zaps B,C,D each have a unique url for their trigger, all of which are known to Zap A.So there you have it! Not pretty, but certainly doable.
Let me know if you've got any other questions!