I am trying to use variables:exists in my workflow in the source expression like so:

variables:exists(finalState)?${(finalState == "COMPLETED")}:true

But I am getting error
FlowableException: Unknown property used in expression:variables:exists(finalState)?${(finalState == “COMPLETED”)}:true

You need to wrap everything in ${} - you’re trying to write a ternary operator and that’s only possible within an expression.

sure thanks. this worked