Webhooks goes into a request loop making calls every 5 seconds

I have a webhook configured to send calls only on entry publish and restricted to a particular content type. The call works. But, I find it going into a never ending loop repeating the same request every 5 seconds, even when it has been just 1 publish event.

This is what each request and response look like. Can I change something in the response to avoid the issue ?

Could it be that you are triggering a publish event in the webhook target?

Otherwise the described doesnt make sense to me. Could you share the webhook configuration?

Could it be that you are triggering a publish event in the webhook target

I know this is an old post, but request loops are a problem for me too.

My webhook is only triggered by the Entry.publish event. When entries are published, my webhook saves some data from an external service into an entry field.

The webhook does this using a CMA PATCH request, which puts the entry into “changed” state. I need the entry to stay in “published” state.

Making a second CMA request to the /published endpoint creates an endless loop, like the one described in this post.

Is there a suggested/documented method for webhooks like mine to respond to publish events without creating an endless loop?

I was able to solve this problem by storing the entry id in an external storage. In my case I used redis and so I did not need to store the timestamp but instead set a very short ttl equal to the cool down time. In the endpoint, you can check to see if the entry has already been updated previously and short circuit with a return to prevent the endless loop.

Since I was using Redis, I set a ttl of about 10 seconds to serve as a cool down time. Why do you need a cool down time? If you do not expire the value in Redis, then any subsequent request to update the updated entry will fail because your endpoint will short circuit as it attempts to prevent the endless loop. Why 10 seconds, 10 seconds is within the time frame it takes for Contentful to send another webhook request after your first update and publish event