Webhook getting triggered multiple times


My project is to send an email notification to the author whenever a new post is published, so I set a webhook for post published, a REST API on AWS API Gateway that used Lambda proxy and a Lambda function to send emails. The problem is that API Gateway was invoked multiple times for the same published post, usually 3 times within a few seconds. I also checked Cloudwatch logs, making sure the invocations were coming from the same webhook trigger. What is the possible cause of this? Any help is appriciated!

@pathos41 there’s a 2 second timeout on the webhook trigger, if your endpoint isn’t responding with a success status within 2 seconds then the trigger request will be retried up to a maximum of 5 times

Hi Kevin,

Thanks for the quick response!

I just tested the endpoint, and the 200 status code got back after about 5 seconds. I’m still new to this, does it mean I have to shorten the lambda function processing time?

Is it possible to change the 2 second timeout to 10 seconds?

Following up to earlier comment, I have put this patch together to resolve my issue to extend timeout various-patches/ghost-webhooks-trigger-extend-timeout.patch at main · influencerTips/various-patches · GitHub

As a note will continue to work on this as patch so that it uses the Ghost config file and as time permits make into pull request.

Wonderful, I think this created an issue for me that resulted in 4 emails going out instead of 1. Is this still not fixed via Ghost config?


For me the there was a downstream service change to use a more responsive service for handling the callback therefore I have not persuade a PR.

1 Like

thanks for the reply, I’m still having the issue, guess I’m going to have to live with making these changes to the source. Thanks

I also had the same problem. The webhook was triggered five times. But I found the reason for that issue. A webhook being triggered five times is a common thing until we added.

return res.status(200).send();

at the end of the function. Once I added this to my Node app, it triggered only once.