The docs state: “If your endpoint returns a 5xx status code, Genesys Cloud will retry the webhook delivery up to three times with exponential backoff.”
I’m building a token service that consumes real-time conversation events via webhook. We have a downstream dependency that occasionally spikes latency, causing our endpoint to return 502 Bad Gateway. After the three retries, the event drops. I need to implement a dead letter queue (DLQ) pattern to capture these failed payloads for manual reprocessing.
Here’s the current handler snippet:
app.post('/webhook/genesys', (req, res) => {
// Process token validation
const isValid = validateToken(req.body);
if (!isValid) return res.status(401).send('Unauthorized');
// Async processing
processEvent(req.body).catch(err => {
console.error('Processing failed', err);
// If this throws 500, GC retries
throw err;
});
res.status(200).send('OK');
});
Is there a way to intercept the failed retry attempts directly from the webhook configuration? Or do I need to wrap this in a separate service that acknowledges receipt immediately and then handles the async work with its own DLQ logic? The current setup feels fragile.