A solenoid valve is used to control the flow of a fluid - including both gases and liquids - through a pipe. There are different types of solenoid valves. Some have more than one inlet or multiple outlets, allowing them to divert flow or choose between several different fluids.