Substring in workflow expression block

I am trying to take a substring from a Module field. In the expression block I have tried:
target: myVar
type: String
expression: substring(record.values.AccountName, 1, 3)

but receive the error:
workflow 238983435060772867 step 4 execution failed: expression “substring(record.values.AccountName, 1, 3)” failed: expected type int for parameter 1 but got int64

I have also tried setting two variables:
target: start, type: Integer, expression: 1
target:end, type: Integer,expression: 3

then using:
substring(record.values.AccountName, start, end)

but effectively the same error:
workflow 238983435060772867 step 4 execution failed: expression “substring(record.values.AccountName, start, end)” failed: expected type int for parameter 1 but got int64

parameter 1 is “record.values.AccountName” or “start”/“end”?

I believe parameter 0 is “record.values.AccountName”
parameter 1 is “start”
and parameter 2 is “end”.

To test this i tried:
substring(1,3,record.values.AccountName) and received

workflow 238983435060772867 step 4 execution failed: expression “substring( 1, 3, record.values.AccountName)” failed: expected type string for parameter 0 but got float64

I upgraded to the latest version. This is still an issue both in workflows and Field value expressions. I believe it is a bug.

It would appear so; here is the function signature.

There is some casting weirdness. I’ll make one of us fix this; most likely in the 2021.3.10 patch release.