Filtering EventBridge conversation.end events by queue name

We are setting up an EventBridge rule in AWS to capture Genesys Cloud conversation endings. The goal is to trigger a Lambda function only when a conversation ends for a specific queue, Support-US, so we can push metrics to New Relic.

The issue is that the EventBridge event payload for conversation.end does not seem to include the queue ID or name directly in the top-level attributes. I tried filtering on detail.queueId, but that field isn’t present in the event JSON.

Here is the EventBridge rule pattern I am testing:

{
 "source": ["genesys.cloud"],
 "detail-type": ["conversation.end"],
 "detail": {
 "queueId": ["12345678-1234-1234-1234-123456789012"]
 }
}

When I test this with a sample event from the EventBridge console, it returns no matches. The actual event payload looks like this:

{
 "id": "abc-123",
 "source": "genesys.cloud",
 "account_id": "12345",
 "region": "us-east-1",
 "detail-type": "conversation.end",
 "time": "2023-10-27T14:00:00Z",
 "detail": {
 "conversationId": "conv-xyz",
 "endedAt": "2023-10-27T14:00:00Z",
 "participants": [
 {
 "id": "part-1",
 "type": "agent",
 "queueId": "12345678-1234-1234-1234-123456789012"
 }
 ]
 }
}

The queue ID is nested inside detail.participants[0].queueId. EventBridge filtering doesn’t support deep array indexing like that in the rule pattern.

Is there a way to filter this at the EventBridge level, or do I need to process all conversation.end events in the Lambda and filter there? I’d prefer to avoid the cold start cost for every event if possible.

Here is the Lambda handler snippet for context:

exports.handler = async (event) => {
 const queueId = event.detail.participants[0]?.queueId;
 if (queueId !== '12345678-1234-1234-1234-123456789012') {
 return; // Skip
 }
 // Send to New Relic
};

This works, but it feels inefficient to invoke the function for every queue. Is there a better way to structure the EventBridge rule?