Model & Serial? Ford or Kubota engine?
Most likely a fuel cutoff solenoid wired into the carb, but that's to cut off fuel when the engine isn't running (or running on LPG). If your carb keeps flooding while running, I'd be dropping the bowl and see if debris is gumming up the needle or float and not letting it seat. If it's sat for extended periods of time with cheap fuel in it, could also be full of ethanol "dust" which will gum them up pretty bad.