Whisk the flour and water together in a small saucepan until smooth. Place over a medium/low heat and whisk constantly until the mixture has thickened to a paste that is gloopy.
Scrape it into a bowl, cover with clingfilm directly on the surface to prevent a skin from forming and leave to cool to room temperature.
To make the dough, place the flour in the bowl of your stand mixer, fitted with a dough hook. Add the yeast, salt, and sugar and stir gently to combine.
Whisk together the cooled tangzhong, egg and milk in jug and add it to the dry ingredients.
Mix everything together (on speed 2 if using a kitchenaid) for 5 minutes until it forms a smooth dough.
Add the butter and mix until it is fully incorporated, this takes around 12 minutes using speed 4 on a kitchenaid. Keep going until the dough pulls away from the sides of the bowl,
Cover the bowl with clingfilm and leave to rise for 1-2 hours until well doubled in size. Alternatively, place it in the fridge to rise overnight. If you refrigerate it, the following day let it come up to room temperature for about half an hour before continuing.
Once the dough has risen, punch it down and fold it in on itself a couple of times. Turn out onto a lightly floured surface, and roll it out to around 25cm by 40cm.
Spread pesto all over the dough,use as much or as little as you like, the flavour can be subtle after baking, so I would use plenty, leave a strip at the bottom long edge of the dough which is bare. Brush this bare strip with a small amount of water. Starting from the long side away from you, roll up the dough tightly to make one giant log. Using a large sharp knife, cut the log of dough in half lengthwise, leaving about an inch of dough uncut at the top. "Braid" the two halves of dough together by simply putting one half over the other, then again and again. Pinch the ends together and gently transfer the loaf to the loaf pan.
Loosely cover the loaf with oiled cling-film and leave in a warm, humid place to prove (but not over 24 C). Let it prove for 2 1/2 to 3 hours, until the loaf has almost doubled in size.
If you press the dough gently with a finger the indentation should spring back slowly but remain visible. If it springs back quickly it needs to prove for a little longer. Preheat the oven while the dough is rising to 180C/350F/gas mark 4.
Brush the top of the dough with some of the beaten egg, be sure not to drag the pesto or ruin the braiding.
Bake on the lower middle shelf of the oven for 30-40 minutes until well risen and the top of the bread has gone golden. The internal temperature should reach 94C on a probe thermometer. Cover the bread with foil partway through baking if it starts to get too dark.
Transfer to a wire rack and leave to cool completely before slicing.