You need more information abnout your plan. A tankless heater would be subject to freezing in an unheated barn. They also have difficulty keeping temperature at low flow rates. Heating a room to contain one would be more of a waste of energy than using a standard tank to heat the water in an unheated area. In either case, you would use a pressure-balanced temperature-limited valve to prevent surprises and possible high-velocity groomers.