One of the most common questions asked right before and right after surgery. From a physiological aspect the timing depends on the span of surgery. The more invasion the longer the recovery(but usually a better result).
Injury whether intentional like surgery or accidental initiates wound healing that requires multiple steps; the most relevant to our question is neovascularization. New vessels form that allow many important types of cells to arrive at the site and begin the healing. During this process any activity that promotes a faster heart rate will increase blood flow to all areas of the body including the surgical site that has extra blood vessels. This in turn causes engorgement or fullness that requires time to resolve.
The usual scenario has a cascade that follows a time frame: activity will result in swelling 2-4hrs later, which in turn cause pain another 2-4hrs later. It is not surprising that most people feel pain 4-8hrs after stopping exercise. Usually this phenomenon does not cause harm to the results of the procedure, but one should be aware of the consequences (swelling and pain) when embarking on exercise.
I understand the enthusiasm of complementing the surgery with healthy diet and exercise. In general I recommend at least two weeks of no exercise followed by a GRADUAL return to pre-op levels using your good common sense. For example: if you run 5 miles, try jogging 1 mile and see how you feel. Increase as tolerated.
Exercise is important and should not be eliminated, but does require appropriate adjustments after.