You may have a floating obstruction in the tank. I did....
twice. Insect gets in the tank, floats around until it floats over the fuel outlet, shutting off fuel to just a dribble....not enough to allow the engine to run until it fills the filter bowl again....then it will start and run until the next time it floats over the outlet.
To check, next time engine stops and you see the filter bowl half full, pull the line off coming from the tank. Lot of flow....obstruction is not the problem. Little flow ? You have the above. Pull the line off the tank, stick a small screwdriver (or something) up in the tank outlet and you'll get hosed with fuel when you move the obstruction out of the way.
Cure is remove the tank, dump upside down, and blow it out. Second time, I bought a Rigid inspection camera (Home Depot) and stuck the lighted probe down in the tank after draining (tank still on tractor)....I could see a wasp in the tank right over the 1/4" outlet. Long 'grabber' tong tool reached it and removed.
I then added this to my tank: (which is what tanks OUGHT to come with to start with)
Cut the plastic nipple off the plastic tank....drilled a hole a bit small than the outside threads of this adapter, forced it into the hole cutting new threads. Screwed a 1/4" brass barb fitting in the internal part, connected line back to it. End of problem.