Roll out puff pastry into a 12’’x12’’ square. Divide the sheet into 12 squares and place each of them in a lightly greased muffin tin and refrigerate for 20 minutes.
In a medium saucepan, melt butter over medium-low heat. Add grapes, rosemary, and walnuts and sauté until softened and fragrant, 8-10 minutes. Remove from heat and set aside.
Take muffin tin out of the refrigerator. Working quickly, evenly divide the sautéed grapes into each cup. Brush the exposed edges of the pastry with egg wash, then top each cup with the grated Gruyere cheese, about 1 Tbsp. If the tin and puff pastry no longer feel chilled, place in the refrigerator for 5 minutes.
Bake cups for 20-25 minutes, or until puffed and golden brown. Remove from the oven and serve warm.