I've got a simple Cloud Function that responds with either:
{"pasValidate":true}
or
{"pasValidate":false}
I need Cloud Workflows to correctly compare between true and false to take the correct route. I've tried quotes, no quotes, the only part in the documentation is that the variable must be referenced through the "body" part of the response and then use it (really, nothing else in the docs) so this is what I did:
- getData:
call: http.get
args:
url: https://us-central1-ACCOUNT.cloudfunctions.net/Cloud_Function
result: jsonResponse
- evaluateRes:
switch:
- condition: $(jsonResponse.body.pasValidate == "true")
next: logStep1
- condition: $(jsonResponse.body.pasValidate == "false")
assign:
- failLvl: "step1"
next: endFail
After all of this I got the following fail run response:
in step "evaluateRes": {"message":"TypeError: in conditional predicate: expected boolean, got str","tags":["TypeError"]}
I understand that it is getting a string instead of the desired True/False, but at this point, I am daring to ask the community what am I a missing. Perhaps there's something simpler that I am not catching.
Sources: