I'm designing a system where I need to fill and exhaust air from an an air bag. The air will be supplied from a dc motor. As of right now I've been considering placing a 2 way solenoid valve for air to flow into the bag and then open the valve without the motor on to release the air into the atmosphere. Will this work, or does air only flow in one direction in a 2 way solenoid valve? Sorry if it's a bit too general, I'd be happy to answer any questions. Thanks for your help!
A typical 2 way solenoid valve would not restrict airflow towards one direction. So in your case is perfectly valid, since you will be removing the pressure from the inlet.
What you would normally do if you wanted to prevent backflow is to place a check valve.
Below is a cutout of typical two way valve operation states.