Hi all,
There is a weird edge case with how the REST Proxy handles asynchronous response buffers when a SNIPPET action is used to parse a large JSON payload before a transfer. Theoretically, the script should hold the session state until the REST Proxy returns a 200, but we’ve hit a wall where the variable assignment seems to fail if the external API takes longer than 4 seconds to respond. It’s not a hard timeout error, but the script just moves to the next action with empty variables.
nice-cxone-studio-sdk is what we’re using for the middleware transformation. The logic involves pulling a customer profile, then using a SNIPPET to calculate a routing priority based on the account_tier field. If the API response is slow, the SNIPPET executes, but it’s doing jack all because the variable hasn’t populated yet.
The call is hitting the /api/v1/customer/profile endpoint. We tried wrapping the logic in a loop to check for null values, but that just hangs the script and eventually drops the call.
var profile = RESTProxy.get("/api/v1/customer/profile?id=" + customerId);
if (profile && profile.account_tier === 'Gold') {
routing_priority = 1;
} else {
routing_priority = 5;
}
The logs show the request was sent, but the routing_priority stays at the default value. It’s essentially ignoring the return payload. We’ve bumped the timeout settings in the proxy config, but that didn’t change the behavior for these specific long-running queries.