Hi RubberGrubber.
Welcome to the HP forum!
I understand that you have an auto shutdown issue. Here is a link to Troubleshooting an Overheating and Auto Shutdown Issue. You stated you have flashing lights, so I am also providing Computer Does Not Start and the LEDs Blink or the Computer Beeps that may assist you. Please let me know if this has helped.