Variable in flows

I have a script where I change a bool Variable. I can see the Variable changing in the script but when I use it in advanced flow it always return the default value (false). Looks like the value on the Variable is not transfered from the script?

If you don’t have a specific reason to use variables, just use Homeyscript tags. Which can also be used in flows.
This is so much easier and straightforward: