Cook the spaetzle al dente in salted water. Meanwhile, cut the boiled ham into cubes and the onion into rings. Fry both together with butter.
Mix the cream with the instant stock and the spices cold. Mix the spaetzle with the ham and onions and place in a large baking dish. Pour the cream over it and sprinkle with cheese. Bake in a preheated oven with fan-assisted air at approx. 200 ° C for 10 minutes.