Mix the pesto ingredients in a food processor and blend until smooth.
Bring a pot of salted water to a boil
Mix the water and potato flakes in a bowl and stir until it becomes mashed potatoes. Season with salt. Stir in the egg and flour and mix to form the dough.
Transfer dough to a work surface and knead for a minute or less until it comes together. Don't over knead.
Cut the dough into 4 equal pieces. Form them into logs and sprinkle with flour. Use a dowel that is a similar width as the sausages and wrap the dough around it, pushing it against the work surface on 4 sides to flatten and form it into a square. Make sure the top touches. Drop the whole thing into the boiling water and cook about 4 - 5 minutes. Remove from water and carefully remove the dough from the dowel. Put the bun on an oiled surface and repeat with the rest of the dough balls.
In a large frying pan, heat the butter over medium heat. Add in the onions and cook about 40 minutes, stirring occasionally, and adjusting the heat as needed until deeply caramelized.
Meanwhile, cook the sausages in a pan on medium heat with a little oil to brown and cook through.
Put the cooked sausages into the "buns" and sear them on all 4 sides in a hot nonstick pan with plenty of oil or butter.
Remove from the pan, top with the onions and pesto, and serve.
