using microflow you can achieve
1. Retrieve list 2. Aggregate list-count
it will store in count variable
What do you want to achieve by counting rows in a grid? It would be easier to answer if you explain the usecase. For grids the number of rows visible can be set in the modeler itself.
If you want to use a count function in microflow, you can use the aggregate list action activity and pass the list which you want to count records of.