Heat oven to 400ºF. Line 2 to 3 baking sheets with parchment paper, and set aside. The number of baking sheets will depend on the brand of puff pastry (it's size) and your resulting yield.
In a small skillet over medium heat olive oil. Add onion, garlic, and chili flakes. Cook until softened and translucent, about 3 to 4 minutes. Remove from pan, transfer to a mixing bowl and set aside to cool.
Add the spinach and artichokes to the mixing bowl. Stir in Gruyère and Parmesan. Season with salt and pepper to taste.
Unfold or unroll one of the two puff pastry sheets on lightly floured surface. Lightly flour both sides of the pastry if it seems wet or sticky at all. If the pastry is folded, make sure the seams are running vertically and the “ugly” side is facing you. The long side of the pastry should be at the top and bottom of your work surface, with the shorter sides on the left and right. Top with half the vegetable-cheese mixture, leaving a ½-inch border.
In small bowl beat egg with 1 tablespoon water. Brush the furthest edge with a little egg wash. Starting at the end closest to you, roll up pastry, jelly-roll-style, sealing the roll with the egg wash edge. Roll neither tightly nor too loosely. You want enough looseness for the puff pastry inside the coil to have room to expand, but tight enough that the fillings don’t completely fall out when you transfer to baking sheets. Repeat with the other puff pastry sheet and the remaining filling. If the rolls seems soft, freeze them for about 10 to 15 minutes to firm up and allow for easier slicing.
Cut each roll into ½-inch-thick slices, using the puff pastry’s seams to guide you, if they exist. Lay slices flat 2-inches apart on parchment-lined baking sheets. Lightly brush with egg wash on the sides and top of each roll. You may want to you more of a dabbing motion so you don't dislodge any of the filling or get big drips of egg on your pan. Bake 25 to 30 minutes, or until golden, rotating the sheets from top to bottom and front to back partway through.
Depending on the resistance of your parchment paper brand these will either slide right off is stick a little in the middle where the cheese melts, but gently pry them free with a spatula with minimal effort. Serve warm or at room temperature. These are best the day they are made.