Caramelized onions: dice both onions in a fairly small dice.
Add oil to a large pan over medium heat then add onions and a pinch of salt.
Reduce heat to medium-low and cook onions, stirring often for 20 minutes.
After 20 minutes, your onions should be tan-colored, but not browned. You might start to see dark brown spots forming on the bottom of the pan though, and if you do see that, add a tablespoon of water or two to the pan with the onions and use that water to stir the dark parts at the bottom to keep things from burning.
Continue cooking the onions over medium-low heat for another 10 or 15 minutes. Remember: if you see dark spots or dry areas on the pan, add a tablespoon of water. The water should cook off quickly but it will help to temper the pan temperature and help the onions to cook through without burning.
After your onions are sufficiently browned remove them from the pan to a container to cool.
Dough: in a large bowl or the bowl of your mixer, weigh out and add your all-purpose flour, salt, potato flour and instant yeast and stir to combine all of your dry ingredients making sure there are no clumps.
Add three tablespoons of caramelized onions to the dry ingredients.
Weigh the rest of your ingredients and add them to the bowl.
If using a stand mixer, knead for 8 minutes on medium speed. If you are kneading by hand, you will need about 15 minutes of kneading after all the ingredients are incorporated together.
The dough will be a bit sticky.
Place your dough in a lightly oiled bowl and cover. Let dough rise in a warm place for 1 to 1.5 hours. The dough should be doubled in size.
Remove dough from bowl to a lightly oiled counter and divide into 6 pieces. I like to weigh my buns at this point to keep them all fairly consistently sized and I usually get 6 buns that are all between 85 and 90 grams each.
Roll each of your six pieces of dough on the counter until you have 6 balls.
Add each ball to a parchment lined sheet pan.
Press down the top of each ball with a lightly oiled hand or the lightly oiled bottom of a mixing cup or small pan. If you want very tall and round buns, don't flatten at all. If you want medium height but still rounded buns press down only a little. If you want flat buns like you see in fast food restaurants, you should flatten each one fairly flat.
Cover your buns with lightly greased plastic wrap or a second sheet pan flipped over on top of the pan you're using.
Let shaped buns rise for another hour or hour and a half until they are nearly doubled in size.
Near the end of your final proofing time, pre-heat your oven to 375 degrees F (177 C).
Caramelized onion and poppy seed topping: in a small bowl mix your whole egg with one tablespoon of water. Paint each bun with the egg wash and then carefully sprinkle diced bits of caramelized onion and poppy seeds on top of each bun. The egg wash will help the buns darken and they also help the caramelized onions and poppy seeds stick to the top of each bun.
Bake your buns for 15 to 20 minutes rotating the sheet pan half way through the baking time. I typically bake for 7 minutes and then rotate and come back in another 7 minutes to see what my level of brownness looks like. At that point your buns should be done all the way through, you're just trying to get them to the color you prefer.
Remove buns from oven and let cool fully before slicing.
Notes:
You can caramelize the onions in advance if you want. Store the onions in the fridge for no more than four or five days.