My escape is running rough it does have high mileage but has been maintain well on 2004 Ford Escape

The engine act like it was cold but as I drove it the engine light flashed. It acted like it was struggling to increase speed it leveled out and then when I came to a stoplight, it idle roughly. When accelerated it began the roughness again. I had no problems yesterday. Whats going on!

Asked by for the 2004 Ford Escape
have it scan tested for codes