Webhook events coming out of order `onTicketUpdate` trigger

Hi there,

We are currently using Freshdesk for our ticket management system. We have configured a custom app for the onTicketUpdate trigger when the responder on the ticket is updated and also use webhook automation when ticket fields get updated. Unfortunately, these webhook events are coming out of sequence for instance, the event a1 which let’s say was for agent update (responder update) is coming after g1 (group update) on the ticket even though the sequence is correctly maintained on Freshdesk. Also, we have tried to remove this ordering issue by utilizing the updated_at timestamp field coming in webhook events but for both events, this updated_at ticket field is coming as the same making it difficult for us to differentiate between both the events. Can anything be suggested on how to solve this?

Hi @Karan_Bhatia,

Welcome to the Freshworks Developer Community! :tada:

The product events, such as the onTicketUpdate event, will not be in sequence and, in fact, can also occur in parallel with another event that happened in the product since it utilizes serverless functions to trigger the event.

Could you share more context around the need for the sequence and what these different events happen in your use case?

Hi @Raviraj,

After onTicketUpdate triggers, we are making sure we are consuming the same updates in our systems as well and since these events are not in order there are inconsistencies getting created. I would want to understand why the sequence is not guaranteed. Also, if not then can a sequence ID be sent with each of the events? If I am not understanding it wrong, then according to you, the webhook events are just the indicators that the ticket got updated and we should pull the latest data?

Hi @Raviraj

Any help/update on this?

@Karan_Bhatia I understand that these might create some confusion if an external system relies on the sequence of these events. Our platform doesn’t guarantee the sequence.

The reason why there’s no consistent sequence is our system talks with different products, triggering events to the same pool of events and handling the events for many apps in our marketplace. Due to the scale of our platform, multiple servers will pick up the events, process them, and deliver them to the Marketplace apps.
Since the events might also have split-second differences and be processed in parallel, an event that happened later might have been processed and delivered faster than the previous event that occurred in the product due to multiple reasons such as size of the payload, conditional cases, and no. of apps and automation subscribed to them.

We do not have any sequence ID in the current payload of the product events. However, there’s a timestamp attached to each event payload.

If you could explain the scenario that your app and system are built for, we could find out if there are any ways to solve this problem.

Hi Raviraj,

So, according to you, these webhook events are just pure indicators that there is a ticket update that has happened if the order is not guaranteed? How do you suggest consuming these events and making updates in our system if the order is not guaranteed since we also have rate limits on Freshdesk’s APIs?

The event timestamp as well as the updated_at timestamp both come as the same from your end for two events received in a small timeframe for whom the updates would have happened in split seconds. There is no way for us to differentiate these events. What do you suggest if the sequence ID cannot be sent in these events to differentiate between them?

@Karan_Bhatia This could be an issue only in the scenarios where the events are triggered in a split-second time difference.

We can analyze further with your app use case and this specific scenario and how this can be resolved.

We can schedule a call to have a deeper discussion.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.