My F-150 did the same thing. I am running a K&N Filter and the oil built up over time on the throttle plate and caused exactly what you are describing. I just removed the TB and cleaned it with a rag with Isoproply Alcohol and it has ran fine since.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I had a similar problem on a Chevy Tahoe. Took it to the dealer and had Throttle Body Cleaned.$100 and it was fixed.. My symptoms were: truck battery voltage would drop when I applied the brakes.. Truck ran great on the gas but idled as if it wanted to cut off.. Happened a couple of times thru the years I had it.. Each time I had the throttle body cleaned and it fixed it. Not sure, just giving you some options