Cook the spaghetti following packet directions or until al dente. Drain well.
Meanwhile , cook the pumpkin in water for 10-15 minutes or until tender. When pumpkin is cooked add the green beans to pot and blanch them for 2 minutes and then put in a ice bathe to stop cooking and retain the colour. Set aside.
While pumpkin is cooking, heat oil in a large frying pan over high heat. Cook chicken, in batches, for 5 minutes or until browned and almost cooked through. Transfer to a heat proof bowl.
Cook onion in frying pan, stirring for 3 minutes or until onion is tender.
Return chicken to pan with the spaghetti and pesto and green beans. Cook stirring, for 5 minutes or until well combined and chicken is cooked through. Add the pumpkin and toss to combine.Season.