It's normally a piping designer or engineer's job. The general considerations are:
a. minimum back pressure or back pressure is considered in valve sizing.
b. work place safety. people will not be hurt by sudden blow of air or any other fluid.
c. don't let condensate stay in the pipe.
d. if the fluid is liquid, it should get gack to the process or to a drain (for water).
e. if it's steam, consult a thermo piping engineer since you have to consider not only the above a, b, c but also the stress impact on the piping.