If this is a petrol engine, it might be indicating a misfire, problem with either ignition or injection, so the codes need to be read to determine the fault and diagnose the cause.
Same applies for diesel, unless it is a diesel with a diesel particulate filter (DPF), which has to regenerate frequently. When the DPF regenerates, there is often a warning light that flashes to indicate this operation. Is that what you saw?