CXone Studio DBConnector action timing out on large table scan

Hey everyone, running into a bit of a wall with the DBConnector action in Studio. We’re trying to do a simple lookup against our customer DB to check loyalty status before routing to a specific queue. The connection string works fine in the test tab, but once we drop it into a flow with a WHERE clause, it times out every single time.

The table has about 50k rows. We’re using the standard SQL query syntax. Here’s the snippet I’m feeding into the action:

SELECT loyalty_tier, last_purchase_date
FROM customer_profiles
WHERE mobile_number = '#session.data.callerID#'
LIMIT 1

I’ve verified that #session.data.callerID# is populated correctly earlier in the flow. The error I’m getting back isn’t a SQL error, but a generic Studio execution error:

Error Code: 504 Gateway Timeout
Message: Action 'DB_Lookup_Loyalty' exceeded maximum execution time of 3000ms.

I’ve tried adding an index on the mobile_number column on the DB side, which helped the raw query speed up to under 100ms in DBeaver, but Studio still chokes on it. Is there a known limit on the DBConnector action regarding table size or is this purely a network latency issue between the CXone region and our on-prem DB? We’re in the East region if that matters. Any pointers on how to debug the actual SQL execution time from the Studio side would be appreciated.

2 Likes