⚙ Operations Hub

gmantri
Participant

Workflow webhook triggering multiple times

We have configured a webhook as part of a workflow that sends "deals" data to our API endpoint (API endpoint gets the data, queries our database and sends out an email). What we are noticing is that the webhook is triggering multiple times (we are receiving multiple emails as a result of that).

 

We looked at the code and nothing seems out of ordinary there. We looked at the workflow logs and there again we could not find anything.

 

I am wondering if anybody else is facing the same issue. How do we go about  debugging this issue?

 

Any help regarding this will be highly appreciated.

 

Regards

3 Replies 3
gmantri
Participant

Workflow webhook triggering multiple times

@Mike_Eastwood - Many thanks for your reply. I am wondering if there's documentation available on "how quick is quick"? In other words, how long does HubSpot waits to get a response back from the webhook endpoint. Based on the documentation provided here, it is my understanding that HubSpot will wait for 30 seconds to get a response back. It is definitely not the case in our situation.

 

Only thing I can think of is the 3 second wait time to establish a TCP connection. But if the TCP connection is timing out, then we should not be receiving any text messages. Right?

 

Screen Shot 2022-05-31 at 4.53.08 PM.png

 

Also, are there any logs available which can tell that if HubSpot failed to establish a TCP connection or the request got timed out? I was not able to find that.

0 Upvotes
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Workflow webhook triggering multiple times

Interesting @gmantri 

 

My experience is the normal Webhooks (called from a Subscription not a Workflow*) were retrying within less than a second for the first retry... in this docs it says at the bottom of the page:

Notifications will be retried up to 10 times. These retries will be spread out over the next 24 hours, with varying delays between requests. 

I've had good experiences with the Webhook Subscriptions. Maybe you could trigger your API on Deal creation?

 

Mike

 

*I haven't played with Workflow Webhooks yet.

 

0 Upvotes
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Workflow webhook triggering multiple times

Hi @gmantri 

 

The HubSpot API is super persistent and not very patient (like me). Basically, the API hits your enpoint and if it doesn't get a reply really quickly it assumes you're not listening and hits the endpoint, and again... No reply, it does it again (up to 10 times).

 

So what we did was receive the JSON, and thank the HubSpot API with a speedy reply. Then pass the JSON to a Job Queue to do the work at it's leisure.

 

AND, you'll see in the JSON the retry number. So you can check if it's the first time it's sent the info, or the second, third, etc. and handle any duplicates calls accordingly.

 

Have fun

Mike