I’m hitting a wall with basic branching logic in a CXone Studio snippet. The flow is supposed to check an incoming HTTP response code and route based on that, but the variable seems to get clobbered or ignored by the time the IF node runs. I’ve got an HTTP request node returning a status code, and I’m trying to capture that into a variable for a downstream decision.
Here is the snippet logic:
// Step 1: HTTP Request
GET "https://internal-api.example.com/status"
// Step 2: Capture Response
ASSIGN "http_status" TO "{{http_request.status_code}}"
// Step 3: Branching
IF "http_status" == "200"
THEN
ASSIGN "next_node" TO "SuccessPath"
ELSE
ASSIGN "next_node" TO "ErrorPath"
ENDIF
The issue is that http_status consistently resolves to null or an empty string inside the IF condition, even though the HTTP node logs show a 200 OK response. I’ve verified the variable name matches exactly. I’ve tried using {{http_request.body}} to parse the JSON manually, but that feels like a hack. The docs imply that ASSIGN should make the value available immediately in the session scope. Is there a timing issue with how Studio evaluates the http_request object? Or do I need to use a specific data type for the ASSIGN action? I’ve restarted the flow and cleared the cache, but the behavior persists. It’s frustrating because this should be a straightforward pass-through. Any ideas on what I’m missing?