When you say the check engine light is flashing. Do you mean it comes on and stays on then goes out intermittently or it is steadily flashing?
If it is flashing steadily, you don't want to drive it until you pull codes again and fix what most likely will be a misfire. This flashing check engine light means you are doing potential catastrophic damage to the engine and or exhaust because there is a server misfire.
This will also explain the rough idle and running condition.
Please pull the codes and send me what you find and we can go from there. Thanks
Friday, May 31st, 2019 AT 7:37 PM