TL;DR = We ran into an issue with how workflows handle integer values assigned to boolean operators while working with Professional Services to build out a workflow and I agreed to share this here for further review…
We’re trying to figure out if this is a problem with how InsightConnect interprets Booleans from Python steps in our workflow or if we were just doing something incorrectly. This issue was “solved” by returning an explicit value of “True” or “False” instead of “0” or “1”, but we thought it strange that returning an integer for a Boolean variable in a workflow did not result in the value being correctly converted to it’s True/False equivalent. Based on our testing, we believe this is not necessarily a “bug”, but just an oversight in nuances between how Python and the InsightConnect backend (Golang?) interpret integer values for boolean variables.
To reproduce:
- Our python script checks the domain from the sender of an email
- If sender domain matches our whitelist, a value for “1” (Python equivalent for True) is returned to boolean variable in the workflow
- A Filter step in the workflow checks the boolean variable and should allow the workflow to proceed if it is True
Issue:
- The workflow “should proceed” because the “1” value returned from Python is equivalent of “True”
- However, the workflow does not proceed because the “1” value returned from the Python script is not interpreted as “True” by the InsightConnect backend