02 Dodge Ram 4.7l

Hi, when my truck has been running for awhile and you slow down completely at like a stop sign it boggles down and shuts off. The rpms lower then just stops. I am not sure what it could be. Could be multiple just wondering your best guess? Also after a couple minutes it fires right back up no problem and runs great.