Genesys Cloud webhooks are hammering my Node.js endpoint with 502s. The platform retries aggressively, but my server crashes under the load before I can even process the backlog. I need to offload these failures to a dead letter queue immediately. Here’s the current handler:
app.post('/webhook', async (req, res) => {
try {
await processEvent(req.body);
res.status(200).send();
} catch (err) {
res.status(500).send();
}
});
How do I intercept the 5xx and push to SQS without blocking the response?