My 04 fxdwg recently started sputtering and
I'll bet you've got that vacuum operated petcock on your bike too. Not saying this is the problem but I've seen more problems with them than I care to mention. They're only on carburetur equipped bikes. You didn't say which you had but if you've got one, I'd check it out.
You can drain the tank and remove the petcock. Check the condition of the screen filter that is in the tank. On the backside of the petcock, the should be a small vacuum hose connected to the petcock. Take this hose and the fuel hose loose. On the backside of the petcock is square plate held on by four screws. Remove the screws and lift the plate. There is a diaphragm, a small spring, and a needle in there. Take the needle out and use compressed air to blow everything out, Rotate the fuel selector lever and make sure both the on and reserve position is clear in the petcock. Now, hold the diaphragm up to the light and stretch is slightly. Look for holes. If you find a hole, replace the diaghragm. If not, reassemble the petcock.
The vaccum hose that supplies vacuum to the petcock is very small. It comes off a large hose that supplies vacuum to the VOES switch under the top tube of the frame. The vacuum is supplied by a nipple on the backside of the carburetor. Check this hose for cracks or being unplugged.
What I suggest is that you replace the petcock with a high quality manually operated petcock. I like the Pingle petcocks. They're expensive but well worth the money. You'll have to get into the habit of turning your fuel off when you stop the bike like the "old school bikers" do. Just a precaution in the event a piece of trash gets in the needle and seat of your carb.
Now, there are other things that could be causing this. A bad gas cap for one. If the vent in your gas cap is bad, a vacuum will build up in the tank and starve the carb for fuel. you can test it in either of two ways. Loosen the cap (don't take it all the way off) and ride the bike. If the problem goes away, buy a new gas cap. Or, the shop method of testing them when you don't have time to ride the bike. Take the cap off, wipe off as much gasoline as you can, stick the threaded part in your mouth and **** and blow on it. If you can **** air and blow air through the cap, it's fine. Now, go find the Scope mouthwash or everyone will call you "Gasoline Breath" for the rest of the day.
If your bike is fuel injected, you might want to check the electric fuel pump. Other than that, I can't help you with the fuel injection. I know nothing about it as Harley is very secretive about that.
Good Luck
Steve