In a food processor,, combine the rest of the ingredients except and egg and use the pulse function to chop so that the onions are finely chopped but not blended. You don't want the onions to break down too much and end up releasing water. If you do notice any excess water in the mixture, tilt the food processor to drain it or dab with a paper towel.
Add the chopped onion mixture to the mashed potatoes and taste and adjust salt and seasoning. Lastly, add the egg and mix well. Ideally, allow this mixture to rest, covered, in the refrigerator for 20-30 minutes (though I often skip this step). If you feel that they are not holding the shape as much as you'd like, add breadcrumbs, if needed.
Using your hands, shape about 1/3 cup of the mixture into a flat, round patty about 2 ½ inches in diameter. Continue with the rest of the mixture. You should have 10-12 patties.
Place the egg and breadcrumbs (if using) in shallow bowls so that you can dip them as you cook. Heat a large skillet, frying pan, or cast iron pan over medium-high heat. Add enough oil to lightly coat the bottom of the pan.
Dip both sides of each patty into the egg wash, and then the breadcrumbs, if using. Place 4-5 patties in the pan and allow them to cook for 3-4 minutes on each side, using a spatula to turn them over. Reduce heat as necessary.
Remove from the pan, and place on a plate lined with a paper towel to absorb any extra oil. Repeat until you have finished pan-frying all the patties. Cook any leftover egg in the remaining oil and serve with the patties.
Transfer to a serving platter and serve with a side of raita or chutney.