First make the filling: peel, core and finely chop the apples. Put them in a small sauce pan, then add the lemon juice, margarine, cinnamon, vanilla and sugar. Cook for about 5 minutes until the apple softens - but don’t let it become jam-like! Set it aside.
Unroll the pastry onto a lightly floured surface.
Using a 8/10 cm diameter mug or cookie cutter, stamp out circles from the pastry.
Fill half of each circle with some apple filling, leaving a small rim. (Do not overfill!)
Turn the unfilled half over the filled half and push the edges of pastry together with a small fork. Cut a small cross on top of each half-moon pie to allow the steam to escape.
Brush them with the beaten egg, if used, then sprinkle them with some cinnamon sugar.
Line the air fryer basket (or both if you have double baskets) with parchment paper or spray the shelf with some oil. Place the apple pies in the air fryer basket(s), leaving enough space between them. Keep the rest in the fridge.
Set the air fryer to "bake" at 170°C (350 F) and bake the pies for about 7-8 minutes until golden brown. Depending on your machine, you might need to turn them over after 4 minutes to ensure the pastry has baked evenly.
Remove them from the basket and bake more pies.
Serve the mini pies warm, with custard or ice-cream, or at room temperature.