I'm working on integration with our internal systems, however, I have come to the point where I would like to cancel provisioning due to lack of IP addresses in given subnet. Unfortunately, when I have defined it in lifecycle:

payload>lifecycleState> phase : PRE

payload>lifecycleState> state : VMPSMasterWorkflow32.Requested

and exit workflow with an error/exception -> provisioning continues. Is there any way to cancel provisioning process?

Then I read about your output param, but I don't understand var virtualMachineEvent = "BuildFailure" - I thought if you define a workflow output value and pass values between workflow element using INPUT/OUTPUT/ATTRIBUTE variables, you don't use "var"? Anyway, I tried what you did, created an OUTPUT variable called "virtualMachineEvent" and assigned the value in a catch-all exception handler of my vRO workflow but it didn't abort the provisioning.