Eventbridge deduplication strategy failing on idempotency keys

Why is this setting causing duplicate consumer invocations despite valid idempotency keys?

i am orchestrating event-driven data actions using aws eventbridge as a bridge between genesys cloud and our internal postgres db. the goal is to trigger a custom data action whenever a conversation status changes. however, i am seeing duplicate events hitting my consumer lambda, causing race conditions in our db updates.

i have configured the eventbridge rule to capture genesys-cloud-conversations events. the source payload includes a unique event_id and conversation_id. my consumer lambda uses this event_id as a dynamodb lock key for idempotency. logic:

def handler(event, context):
 event_id = event['detail']['event_id']
 # check dynamodb for existing event_id
 if db.exists(event_id):
 return {'statusCode': 200, 'body': 'duplicate'}
 # process and write lock
 db.write(event_id)
 trigger_genesys_data_action(event)

the issue is that for every single genesys event, i receive two identical payloads from eventbridge within milliseconds of each other. the lambda processes both because the dynamodb write is not yet visible to the second invocation (eventual consistency issue) or the lock check fails due to timing.

i suspect the genesys cloud eventbridge integration is retrying or publishing duplicates due to a transient network blip, but the eventbridge rule itself has no deduplication window configured for genesys-cloud-conversations source.

is there a native setting in the genesys cloud eventbridge configuration or the eventbridge rule pattern to enforce deduplication before it hits the target? or do i need to implement a stricter locking mechanism in the consumer? the current idempotency_key in the genesys webhook config seems to be ignored for eventbridge targets.

json sample of the duplicate payload:

{
 "source": "genesys.cloud",
 "detail-type": "Conversation Status Change",
 "detail": {
 "event_id": "evt-12345-unique",
 "conversation_id": "conv-98765",
 "status": "ended"
 }
}

any insights on how to handle this at the integration level?

Have you tried:

  • Enabling deduplication on the SQS FIFO queue backing the Lambda?
  • Setting IdempotencyKey in the EventBridge rule payload structure?
  • Checking if Genesys is retrying due to non-200 responses from your Lambda?
{
 "IdempotencyKey": "${id}",
 "Source": "genesys-clou"
}

This is caused by EventBridge retrying the event because your Lambda returns a non-2xx status during the initial invocation.

Check your Lambda handler for unhandled exceptions or long cold starts that trigger timeouts.

{
 "IdempotencyKey": "${event.id}",
 "Source": "genesys-cloud"
}