Genesys Webhook 504 Gateway Timeout handling

Hey folks,

My custom webhook endpoint keeps timing out with a 504 from the Genesys platform when the downstream service is slow. I need to implement a dead letter queue pattern to retry these failed deliveries without blocking the main thread.

Here’s the current Node.js handler using Express:

app.post('/genesys-webhook', async (req, res) => {
 try {
 await processEvent(req.body);
 res.status(200).send('OK');
 } catch (error) {
 console.error('Processing failed', error);
 res.status(500).send('Error');
 }
});

The issue is that processEvent takes longer than Genesys allows, causing the 504. I want to:

  • Acknowledge receipt immediately to Genesys
  • Queue the event in Redis for retry logic
  • Implement exponential backoff for failed attempts

Has anyone built a reliable retry mechanism for Genesys webhooks? Looking for best practices on queue design and error handling.

The 504 happens because Genesys waits for your HTTP 200 before marking the event as delivered, so if processEvent blocks, the connection drops. You need to acknowledge immediately and offload the work, like this:

app.post('/genesys-webhook', (req, res) => {
 res.status(200).send('OK');
 queue.add(req.body); // Async queue
});