Webhooks start firing double

Hi community.

I have created a webhook for an Online customer which fires for appointment.created.

From time to time it start firing double, and continues to do so until something is done. Last time this morning. It worked fine yesterday, so something must have happened during the night.

It's easy to fix. You just have to set the state of the webhook to 2 (inactive), and then 1 again (active). But it's annoying that this is something that manually has to be done.

Any suggestions to how this can be debugged?

RE: Webhooks start firing double

Hi Kasper,

This is the first time I have heard of this type of problem and therefore have to conclude it is customer specific. 

Assuming that's true, and assuming it's the same appointment ID that is sent, then I recommend you start looking into possible scenarios where such a thing could occur. 

  1. Is there more than one webhook for appointment.created event? Due to security, applications can only see webhooks they themselves create, including CS.
  2. Is the webhook handler itself creating modifying the appointment that would retrigger the webhook?
  3. Is there a CRMScript Trigger for the Before or After Save Appointment event could perhaps be modifying the appointment?
  4. Any other automation instrumentation that could be interfering with this?

Best regards.


Av: Tony Yates 31. aug 2021

RE: Webhooks start firing double

Hi Tony. Thank you for responding.

If it helps the customer is Cust23825. I'm pretty sure they only have this one webhook. At least its the only one showing up using webhookAgent.GetAllWebhooks("","",0).

The event-data tell me that Event is 'activity.created' with the same PrimaryKey, and they have the same timestamp. There is no triggers. Furthermore both show up in the tracing.

At this point it has started about 5 times with no pattern, of what I can decide. 

Av: Kasper Rosenlund 31. aug 2021

RE: Webhooks start firing double

Hi Kasper,

Like Tony said, the WebHookAgent only returns the webhook that are 'owned' by the current app, not all.

So calling the WebHookAgent from CRMScript will only return webhooks registered using CRMScript.

Retrieving all the webhooks registered using dynamic archive provider doesn't work since the table is blacklisted

Av: David Hollegien 31. aug 2021