At the moment there are several bugs in the way conditional expressions are handled. One issue that has caused pain (and significant expense) occurs if more than one graph is generated for a workflow item. The code generator will try and spot common code between the two graphs and ensure it is only executed once. Unfortunately this can mean an expression that was previously conditional is now unconditional - potentially causing an expensive call to an external service.
Fixing this issue HPCC-2844 unfortunately reveals another problem with the way that dependencies are handled.
(Multiple graphs for the same workunit item are typically generated by global scalar expression caching and conditional statements.)
After some discussion the conclusion is that the solution is to ensure that activity evaluation really is as lazy as possible. This requires that a single graph is generated for each workflow item, and that all scalar globals are evaluated and cached in the graph rather than using inline code.