The legend of John Henry holds new relevance for workers across all industries.

The steel-driving man of African-American folklore worked on the railroad, hammering spikes into solid rock to create holes for explosives used to clear a path. Henry was indisputably the mightiest worker on Virginia’s C&O, according to 19th-century ballads and work songs.

That is, until a salesman showed up with a steam-powered drill.

Henry’s boss staged a contest between his best worker and the newfangled machine. Henry hollowed out 14 feet to the machine’s 9, but collapsed and died after the whistle blew. The company buried Henry in the sandy soil nearby, and though the song doesn’t say it, the central office probably placed an order for a dozen machines the next day and laid off the rest of the steel-driving men.

Productivity-boosting automation has underlain American business success since the U.S. Patent Office issued the first patent for a potash-making apparatus in 1790. Whenever a company can buy an affordable machine to complete a task performed by a higher-cost human, layoffs will follow.

EARLY EDUCATION: Robotics engineers open horizons for Pasadena students

Modern-day executives feel even greater pressure to automate because their primary obligation is delivering profits to shareholders. With the robotics and artificial intelligence revolution under way, though, they will need to play a role in recycling the thousands of modern-day John Henrys facing their day of obsolescence.

Autonomous vehicles are one example, threatening the largest career field for men: professional driver. But there are more immediate threats to millions of workers.

The future of retail is bleak at best. Recent earnings reports from Macy’s, J.C. Penney and others reveal a dismal holiday season. Online shopping is simply too convenient, and for stores that remain open, FoldiMate has a robot that can fold 25 shirts in five minutes.

Ironically, Amazon is opening brick-and-mortar stores called Amazon Go, but they are almost entirely automated convenience stores that allow shoppers to pick up what they need and leave without encountering a single employee. Robots stock the shelves, and scanners charge your credit card when you leave.

Restaurants also will experience layoffs. A robot can produce 400 pieces of sushi an hour at a Brooklyn restaurant called Big Eye Sushi. McDonald’s is replacing cashiers with kiosks, and machines are flipping burgers. My friend Dan Allford at Houston-based ARC Specialties built a robot that pours draft beer at his Offshore Technology Conference booth just for fun.

Robots are eliminating white-collar jobs too, with algorithms scanning employment and loan applications, while law firms use software to generate contracts, search for evidence and research case law.

In a recent “60 Minutes” interview, venture capitalist and artificial intelligence expert Kai-Fu Lee predicted that technology will eliminate 40 percent of existing jobs by 2040. That’s consistent with previous predictions from financial analysts at Citigroup and researchers at consulting and accounting firm PwC.

This makes sense when you think about how the automobile changed the world. What is different is the pace of job elimination. The robotics and artificial intelligence revolution will create new jobs, but the change is happening quicker than our economy and educational system can cope.

The U.S. has 7 million job openings and 6 million people looking for work. The problem is that American workers do not have the technical skills employers need, particularly in software development, machine learning and robotics engineering.

Smart corporations are teaming up with community colleges and universities to train workers in jobs of the future, whether it is cybersecurity in San Antonio or robotics in Houston. But too many executives expect the government to magically produce graduates with the skills they need. They are in for a disappointment.

THE ALTERNATIVE: Robots took your job? Fix the robots.

The business community must intervene in adult education for the short term, but also in early education and public schools to hit long-term goals. The majority of high school graduates are unprepared for college or a career, and only 42 percent of Texans have obtained any kind of post-high school certificate by age 34.

“The Ballad of John Henry” is ultimately a protest song, decrying the capitalist’s overriding mission to maximize profits, even if it means sacrificing an exemplary employee. All laborers should heed the wisdom of the narrator’s oath at the end: This old hammer killed John Henry. But it won't kill me; it won't kill me.

Employers should recognize they need to play a role in closing the skills gap. The only way to ensure they have the workers and customers they need is to take some responsibility for the changes they are bringing to our society.

Chris Tomlinson writes commentary about business, economics and policy.

chris.tomlinson@chron.com

twitter.com/cltomlinson