It could well be the CTS, coolant temperature sensor, this is what tells the ecu, electronic control unit what to do fuelling wise based on temperature throttle other sensor input etc.
This is to be found on the thermostat housing, you'll easily know if you have the right one as unplugging it with the engine running will cause the fan/s to come on.
There is another in the same area which is also a temp sensor, but this is for the gauge and nothing to do with the engine's running.
It could be a number of other things though, particularly with it being an auto, there is so much more load on the engine at idle from the auto box they are very sensitive to running lean, so I'd also get the co checked and look for the usual suspects like air leaks, especially on the dreaded "T" connector rear of head underside linked into the pcv system.
tabetha