If you exercise in the morning, you should avoid coffee for at least a few hours and go with another drink that gives you the same level of energy. Why?
Like alcohol, coffee is a diuretic. This means it makes you want to urinate more. If you have already lost water after working out, you do not need a beverage that dehydrates you further through urination.
Second, coffee can interfere with recovery. You already know that your body needs certain nutrients after exercise. Coffee can temporarily interfere with nutrient absorption, an effect that is more pronounced when it comes to iron.
If you must drink coffee, wait about 30–60 minutes after your workout and drink water first to dehydrate. Also, have a small snack after working out before taking coffee to sidestep the issue of the coffee interfering with the absorption of nutrients.