Hi @sangeethaneelavannan1,
From what I remember from my own invoke code experience is that unlike to traditional code for invoking you don’t need to return any data. You will be able to grab what is necessary from the code using Argument defined in activity properties.
As an example to your code:
Instead of return row you need to perform assignment like someVariable = row where this variable is defined as an output argument in properties for Invoke Code.