The massive port workers’ strike that has shut down all the major dockyards on the Eastern seaboard of the U.S. and the Gulf coast is highlighting a fear held by many workers: Eventually, we will be replaced by machines.

The International Longshoremen’s Association, which represents the approximately 45,000 dock workers who walked off the job Tuesday, is testing whether it’s possible to fight back.

The union is demanding, along with hefty pay raises, a total ban on the automation of gates, cranes and container-moving trucks in its ports. But it’s unclear whether they’ll be able to stave off a trend that has seeped into virtually every workspace.

The growth of automation and technological advances have created tension between workers and management since the Industrial Revolution, when machines first began to manufacture goods that had previously been made by hand. And with the growing use of artificial intelligence, the group of jobs workers perceive as threatened with disruption is ever-widening.

“You cannot bet against the march of technology,” said Yossi Sheffi, director of the MIT Center for Transportation & Logistics. “You cannot ban automation, because it will creep up in other places.”

It’s not the first time that port workers have resisted automation. In 1960, as ports on the West Coast introduced machinery to move cargo once moved by hand, the union representing longshoremen negotiated protections for workers, including assurances the current workforce would not be laid off, according to the International Longshore & Warehouse Union.

Harry Bridges, who led the union at the time, negotiated pay increases and job security arrangements for some of the workers, said Adam Seth Litwin, associate professor of industrial and labor relations at Cornell University.

“He saw that this was going to become potentially a real problem if he didn’t try to get ahead of it,” Litwin said. “Essentially what he was saying was, ‘I recognize the reality of what’s happening here, and the way to best represent my members is to make sure that they are protected.’”

The downside was that as port machinery became more common, the size of the union eroded precipitously over the years.

Some dockyards outside the U.S are far more automated and efficient, especially ports in Dubai, Singapore and Rotterdam, Sheffi said. Mexico is building a highly automated port that could compete with U.S. ports.

Some unions have negotiated that employees must receive guaranteed employment protection if companies bring in technologies that could make their jobs obsolete. Others have bargained for employers to provide tuition reimbursement or retraining programs so workers can shift into other roles when machines come in.

“The trick is to make it over time, not to do it haphazardly,” Sheffi said.

In its current contract, the ILA has a provision that requires the union’s agreement if the ports add any automation, essentially giving the ILA veto power. But ILA President Harold Daggett has said the union wants a stronger ban.

When health care giant Kaiser Permanente switched from paper to digital medical records a decade ago, dozens of unions bargained together to ensure workers wouldn’t lose jobs or face wage reductions as a result of the technology deployment. Drivers who moved boxes of medical records to warehouses and librarians who retrieved paper files who were trained and reassigned to roles such as medical librarians or coders, Litwin said.

“They ultimately all got pay increases because they ended up being in jobs that ended up being more highly skilled,” Litwin said.

When companies embrace artificial intelligence, it doesn’t always result in workers losing jobs. In some cases the productivity gains enabled by automation or AI make workplaces more profitable, enabling them to hire even more workers.

But unions aren’t taking any chances. In September, video game performers reached an agreement after striking with 80 games that provided protections around exploitative uses of artificial intelligence.

Last year, Hollywood screenwriters concerned that scripts would soon be written by artificial intelligence won protections against the use of AI after a five-month strike.

“More and more people who thought they were immune from automation are probably looking to groups like the longshoremen and thinking, ‘Wait a second, actually, I may not be that far removed from this,’” Litwin said.