Running into concurrency limits on our Lambda handler that processes CXone interaction events pushed via EventBridge. The volume spikes during peak hours and we’re seeing significant throttling despite setting the reserved concurrency to the max allowed.
Here’s the basic structure of the handler:
exports.handler = async (event) => {
for (const record of event.detail) {
await processInteraction(record);
}
return { statusCode: 200 };
};
The processInteraction function calls the CXone API to update contact attributes. Each call takes about 200ms. When 500 events arrive in a second, the Lambda can’t keep up and EventBridge starts retrying, which just makes the queue worse.
Is there a pattern for batching these updates or should I be using SQS as a buffer between EventBridge and Lambda? The current setup feels fragile.
{
"source": "com.nice.cxone.interaction",
"detail-type": "Interaction Updated",
"detail": [
{
"interactionId": "12345",
"updatedAttributes": { "status": "completed" }
}
]
}