A rotary machine includes a rotating shaft which is rotatably provided around an axis, a casing which covers the rotating shaft from an outside in a radial direction and in which a gas flow path extending in a circumferential direction is formed, a drain pipe which is connected to a lower portion in a vertical direction of the casing and communicates with the gas flow path, an adjusting valve which is provided in the drain pipe and adjusts a flow state of a fluid in the drain pipe, and a gas flow pipe which is connected to the drain pipe at a position closer to a connection portion between the casing and the drain pipe than the adjusting valve and through which the seal gas flows.