Does anyone know if the ASSIGN action executes immediately before the subsequent IF condition evaluates? I am setting a variable is_priority via REST proxy, then using IF {is_priority} == 'true' to route. The docs state: ‘Actions are processed sequentially.’ However, in my test, the IF always hits the else block despite the ASSIGN succeeding. Is there a scope issue with variables assigned in the same block? Running Studio 2.0.
It depends, but generally… variable scope is the culprit here. In NICE CXone Studio, an ASSIGN via REST proxy does not always update the session context synchronously before the immediate next IF check in the same flow block. The engine may evaluate the condition using the snapshot at block entry.
See KB-9921: Session Variable Latency in Studio Flows for details.
- Insert a Wait action (100ms) after the REST
ASSIGNto force context refresh. - Alternatively, split the logic into two distinct Sub-flows. Return from the REST call, then invoke a new sub-flow that checks
{is_priority}. - Ensure the REST proxy returns a valid JSON body. If it returns
204 No Content, the variable might not populate as expected.
Test with a debug log node immediately after the ASSIGN to verify the value persists. This is a common gotcha when chaining async calls with synchronous logic gates.
What’s happening here is that REST proxies are async, so the IF block evaluates before the data returns. Stop guessing and add a Wait block or use a Data Action to force the synchronous JSON merge.