BMW 528 cold idle

,

I have a 99 wagon with 97K miles. When started cold and left to idle, the engine will surge then drop down below normal idle speed. It will do this several times before stalling out. Car runs fine otherwise.