Latch Node seems not to work as expected

Maybe the flags I’m setting need to be ‘treat as JSON’ so the true and false are not ‘true’ and ‘false’?

You are correct that the underlying issue is that the flags are strings instead of booleans. When Losant evaluates expressions, it follows the rules of JavaScript:

> if("false") { console.log('this is true'); }
this is true

Like you said, you can fix this by using the ‘treat as JSON’ option, which will cause the values to be parsed as booleans. Alternatively, you can change the conditions to check for strings:

{{working.setLatch}} === 'true'

But that still doesn’t answer why it went through the true side even though it was already latched.

The reason it took the true path is because the reset expression also evaluated to true. Whenever the reset expression evaluations to true, the latch resets and that invocation of the node will take the true path. Based on how the latch expression evaluations, it may or may not then re-latch.