Studio ASSIGN action overwriting variable inside IF block causing logic error

I’m running into a weird scoping issue with the ASSIGN action inside an IF block in . The goal is to set a routing target based on a JSON attribute from the interaction context, but the variable keeps reverting to the default value after the block closes.

Here is the structure:

  1. ASSIGN routing_target = “default_queue”
  2. IF interaction.attributes.priority == “high”
  • ASSIGN routing_target = “vip_queue”
  • Log: “Set to VIP”
  1. END IF
  2. Log: routing_target
  3. ROUTE using routing_target

The logs show “Set to VIP” clearly when the condition is met. However, the next log shows default_queue. It feels like the ASSIGN inside the IF block is happening in a local scope or something, and it doesn’t persist to the main flow.

I’ve tried:

  • Using different variable names for the inner assignment.
  • Moving the ASSIGN before the IF block and just updating it inside.
  • Checking if the attribute path is correct by logging interaction.attributes.priority directly (it prints “high”).

The JSON payload coming in looks like:

{
 "attributes": {
 "priority": "high",
 "source": "web"
 }
}

Is there a specific way to force the variable update to persist outside the conditional block? Or am I missing a basic rule about how handles variable state in branches? I don’t see any error messages, just the wrong value downstream.

Also, tried using the REST Proxy to update the interaction attributes directly, but that feels heavy for just routing logic. Just want to fix this flow first.