Heat a large frying pan and add the chopped walnuts and chilli flakes (if using). Cook for 5 minutes until the walnuts start to go golden. Transfer to a bowl and set aside.
At the same time, cook the pasta according to the pack instructions, adding the tenderstem broccoli for the last 2-3 minutes.
Add the oil to the frying pan and fry the onion for 5-7 minutes until it starts to caramelise. Add the crushed garlic and cook for another minute.
Add the cannellini beans and the chopped rosemary to the frying pan and cook for few minutes.
Remove 1 cup of the cooking water from the pasta pan and add it to the bean mixture. Add the lemon zest and juice, then with a potato masher, break down the beans until you have a creamy sauce. Season with salt and pepper, and cook for a few minutes until the sauce thickens up. If the sauce is too thick, add a little more of the pasta water.
Remove the tenderstem broccoli from the pasta pan with a slotted spoon and set aside, keeping it warm. Drain the pasta and add to the pan containing the sauce. Mix well.
Divide the pasta and sauce between 2 plates, arrange the tenderstem broccoli and walnuts on top and finish with a sprinkle of parsley.