I’m trying to query an external SQL database from a CXone Studio Snippet using the DBConnector action. The SQL query itself is super simple, just a SELECT on a single table with a WHERE clause. When I run it in SSMS, it takes like 10ms. But in the Studio script, the DBConnector step always times out after 5 seconds.
Here is the code snippet I’m using:
ASSIGN sqlQuery = "SELECT * FROM CustomerInfo WHERE CustomerId = '" + session.customer.id + "'"
DBConnector.ExecuteQuery(connectorId: "my-prod-db", query: sqlQuery, timeout: 5000)
The error returned is a generic TIMEOUT_EXCEPTION. I’ve checked the DBConnector configuration in CXone, and the connection test passes fine. The firewall allows traffic on port 1433. I even tried increasing the timeout to 30000ms, but it still fails at exactly 5000ms. It feels like the timeout parameter in the ExecuteQuery method is being ignored or capped.
Is there a known limit on how long DBConnector will wait for a response? I’ve seen some old forum posts mentioning a hard cap, but nothing official in the docs. I need this lookup to happen before routing the call. If the DBConnector is too slow, I might have to move this logic to a webhook, but that adds latency to the call flow.
Any ideas why the timeout parameter isn’t working as expected?