Well before Krugman, it was Kurt Vonnegut. In 1952, he published his first novel Player Piano, which describes a society where most jobs are automated. There's a sharp class divide between the few "managers and engineers" who work and most people who live in an unemployed underclass.
It's very prescient and very very good. Highly recommend.