Bring 3-4 l salted water (1 teaspoon salt per litre) to the boil. Clean and wash the broccoli and divide into florets. Peel onions and cut into strips. Add tortelloni and broccoli to boiling water and cook for about 2 minutes.
In the meantime, preheat the oven (electric cooker: 200 °C/circulating air: 180 °C/gas: see manufacturer). Pluck the ham into fine pieces. Grate cheese roughly. Cut garlic in half and use the cut surfaces to grate a casserole dish. Carefully drain the tortelloni and broccoli and allow to drain. Mix with onions and ham and spread in the dish. Chop the nuts coarsely and sprinkle over the top.
Mix crème fraîche, eggs, cream and almost half the cheese. Season with salt and pepper. Pour egg cream evenly over the tortelloni mixture. Sprinkle with the rest of the cheese. Bake in a hot oven for about 20 minutes until golden brown.