Unfortunately, I can’t think of any union that has succeeded in protecting itself against replacement by automation.
They certainly succeed at protecting their industries when they can’t be replaced, but there really isn’t a remedy for an employer who is willing to not have a workforce.
I think a system where basically all workers are in a union works very well to ensure that labor has fair conditions. This isn’t unheard of and exists in real places.
To be fair I probably didn't pick the best example. Blacksmiths are still needed by the very small number of well-off people who enjoy horse ownership. When you have a horse that needs shoeing, you want to hire a craftsman who was trained by their predecessors to uphold a venerable and specialized tradition, not some incompetent rando who is going to injure your horse or get themselves kicked in the head.
Then, once the job's done, you want that person off your payroll and out of your life. You don't care too much about the cost of labor, you just need it done right the first time. I can imagine a craft union being suitable for providing access to that kind of labor.
But driving cars and trucks around... yeah, no, that's a robot's job, sorry.
Thanks to unions we have things like 8 hours work day, it used to be 16 hours during 19th century. Thanks to unions we have things like job safety so industrial machinery won't rip you apart. Thanks to unions, company will give you tools for doing your job. I can go on and on.
Have a look on videos from Pakistan, India, Bangladesh or other part of south east Asia, where people are working in environment which can easily injure them or kill them. That's how European factories were looking like before unions have become to be a thing. Unions are direct consequence of greed of 19th century capitalists who refused to invest even bare minimum into safety and pay their workers properly while not working them to death.
> Thanks to unions we have things like 8 hours work day, it used to be 16 hours during 19th century. Thanks to unions we have things like job safety so industrial machinery won't rip you apart. Thanks to unions, company will give you tools for doing your job. I can go on and on.
This is the March of Dimes syndrome. Unions had noble goals at first, which they've fully accomplished (things like occupational safety rules are now the law for all employees, union or non-union), so they no longer have any useful purpose and their continued existence is now a net negative.
Unions in America are not like unions in other places.
The negative aspects of unions in America are by legislative design, too. Laws have been passed to make unions work more poorly for workers and increase their unpopularity.
There is no such thing as higher wages without a corresponding increase in price or decrease in profits. Amazon could handle a delivery drivers' union - but on the other end you have groups like the ILWU who are single handedly responsible for the US coming last in any measure of port efficiency in the developed world.
Then, when the ILWU strikes, they get to hold the entire economy for ransom and extract concessions for a job that all of America would benefit from automating.
You don't really need to engage with the process and its statistically proven to hurt fewer people.