Preheat oven to 350 F.
Melt butter in a medium skillet over medium heat. Sauté onion and cabbage until soft, about 10 minutes. Remove from heat and strain off any excess liquid. Boil water and mix in mashed potato flakes, mayonnaise, and mustard.
In a large bowl, mix pastrami, cabbage, and mashed potato mixtures. Roll out pastry dough to 10 x 10 inches and cut into eight 5 x 5-inch squares. Liberally fill each square of dough with potato-pastrami filling. Fold corners diagonally two at a time, stretching pastry to close comfortably, then pinch at the top. Fold open corners clockwise and push together to seal.
Place on a lightly greased baking sheet. Brush each knish with egg wash and sprinkle with sesame seeds. Bake for 25 to 30 minutes or until golden.
Per serving: 508 calories, 32 grams fat (9 grams saturated fat), 50 milligrams cholesterol, 637 milligrams sodium, 42 grams total carbohydrates, 2 grams fiber, 14 grams protein.