Running a Node.js 18 Lambda to process /api/v2/webhooks/events. The payload contains a unique id field, but I’m seeing duplicate invocations for the same event due to platform retries during cold starts. Is there a standard pattern or SDK helper to check DynamoDB for the id before processing, or do I need to write the raw check logic?
Here’s the current handler. It works but feels brittle. If the Lambda times out after writing to DB but before returning success, does Genesys retry? I don’t want to double-process the call recording URL update.
exports.handler = async (event) => {
const webhookPayload = JSON.parse(event.body);
const eventId = webhookPayload.id;
// TODO: idempotency check
await processEvent(eventId);
return { statusCode: 200 };
};