Running into a weird scope issue with our CXone Studio script. We’ve got a Node.js backend hitting the /api/v2/cxone-studio/scripts endpoint to deploy a new IVR flow, but the logic is breaking at runtime.
Here’s the setup. I’m using an ASSIGN action to set a temp variable based on the caller’s input, then immediately checking it with an IF action to route to the right queue. The JSON payload for the script node looks like this:
{
"id": "assign_temp",
"name": "Set Priority",
"type": "ASSIGN",
"properties": {
"destination": "${temp.priority}",
"value": "${input.priority_level}"
}
},
{
"id": "check_priority",
"name": "Route by Priority",
"type": "IF",
"properties": {
"expression": "${temp.priority} == 'HIGH'",
"trueNodeId": "high_queue",
"falseNodeId": "low_queue"
}
}
When I test this in the sandbox, it works fine. But in production, about 10% of calls where input.priority_level is null are still routing to high_queue. It’s like the temp.priority variable isn’t resetting between calls, or maybe the ASSIGN isn’t overwriting the previous value if the input is empty?
I’ve tried adding a null check in the ASSIGN value field like ${input.priority_level || 'LOW'}, but that just feels like a band-aid. Is there a specific way to force a variable reset in Studio, or am I missing something about how the IF expression evaluates empty strings vs nulls in the CXone engine?
Also, the API docs don’t mention any timeout or state persistence for temp variables across the same session, so I’m flying blind here.