We need the rest of the model number & at least the year of the unit, because some older units have points & coil ignition & some have electronic ignition.
Some have electronic governor & some manual gear driven, so the complete model number is important.
Tell you what happened to mine one time.
Ours has the electronic governor & the little plastic piece broke that connects the throttle rod from the carb to the governor arm, would crank & idle fine but when I tried to manually throttle the engine up, it would shut the ignition off & kill the engine.
Lot of different things on the Onan genset, have to work together before the engine will stay running. Like if the gen not producing ac when your trying to start it up, the regulator wont let the ignition keep working once you release the start switch.
If yours is new enough to be electronic, then how your saying it is doing, sounds like the plastic piece broke on the governor rod so the governor not working & the ignition is shutting it down.
Neil