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.
@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?
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.
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.