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