That plants need nutrients has been known pretty much as long as humans have been growing them, but it was not until the 1840s that Justus von Liebig identified the role of nitrogen.
Prior to artificial fertilisers, farmers would typically use plant nutrients mainly from sources such as faeces and urine.