Custom SQL Functions return types mismatch column type
Hi,
I've been trying to implement some custom SQL functions into the expression editor, but keep encountering one issue that interferes with a clean implementation.
The function will return the correct value in the correct type, but the workflow table will choose the wrong type for the column, throwing this:

When I attempt to run a pretty simple function:

I've been able to work around this by wrapping the function a couple ways, for example:


But attempting to just call it as is (or pretty much any custom function), it will default the column to either an int or a string.
Is this a known tricky thing to work around, or am I doing something wrong? DB is postgresql.