In a bowl, stir together the mashed potatoes, egg (if using), green onions, flour and salt and pepper to taste until completely combined.
Heat a skillet over medium heat. When hot, add a little bit of butter or olive oil to coat the pan, just enough to cover the whole surface.
The amount of flour needed will depend on the consistency of the potatoes to begin with. If needed add more flour till the batter is thick enough that you'll be able to flip it when it's on the pan.
For vegan / paleo / Whole30, make sure to use olive oil instead of butter.
For grain-free / paleo / Whole30, cassava flour works great.
For gluten-free, any gluten-free baking mix that you'd use as a replacement for all-purpose flour would probably work.