The Biden administration narrowly avoided an infrastructure calamity on Thursday by brokering a tentative contract agreement between railroads and their workers, keeping the nation’s rail system intact. 

The breakthrough comes after years of contentious negotiations and just before nearly 125,000 rail workers were set to strike as soon as Friday. Workers will now vote on whether to ratify the contract.

Here are five things to know about the railroad deal:

Unions secured hard-fought concessions 

The agreement aims to address rail workers’ concerns about unsafe working conditions and obstacles to taking time off, the two largest railroad unions said Thursday. 

The contract would allow workers to take time off for doctors’ appointments or other scheduled events without being penalized under railroads’ attendance policies, a key sticking point in negotiations. Workers complained that they often face roadblocks to taking even unpaid time off for any reason.

It would mandate two-person crews, another win for workers who warned about dangerous consequences of forcing workers to operate trains solo.

The deal also places new caps on workers’ health care costs, unions said.

“We listened when our members told us that a final agreement would require improvements to their quality of life as well as economic gains,” the Brotherhood of Locomotive Engineers and Trainmen and the SMART Transportation Division said in a statement. 

Workers would receive 24 percent raises over five years, back pay and cash bonuses. Those terms are largely unchanged from recommendations released by a White House-appointed board last month. 

The contract dispute isn’t over yet 

Rail workers will soon vote on the tentative deal, and if any of the unions reject it, the nation will once again brace for a railroad strike.

Workers had largely opposed the presidential board’s contract recommendations, which ignored their demands for better quality of life and working conditions. 

A recent survey from the SMART Transportation Division found that 78 percent of the union’s railroad workers would have rejected that contract. Another survey from grassroots group Railroad Workers United found that 9 in 10 railroad workers opposed it. 

The International Association of Machinists and Aerospace Workers said Wednesday that its 4,900 railway workers voted to reject the Biden administration-appointed board’s contract. It delayed a strike until Sept. 29 to allow more time for negotiations.

It’s unclear whether the revamped contract announced Thursday does enough to win over workers, who eagerly awaited the specific terms of the deal. 

A strike would devastate the US economy

A walkout would shut down the nation’s rail network, which carries nearly one-third of all cargo shipments, bringing large sections of the U.S. economy to a halt. 

Huge amounts of food, clean water, fertilizer, fuel, lumber, packaged goods, finished cars and other products would not make it to their destinations, limiting supply and driving up prices.

A shutdown would also ravage supply chains as containers piled up at ports.

It would cost the economy $2 billion dollars per day, according to estimates from the Association of American Railroads. Another estimate from the Michigan-based Anderson Economic Group found that it would cost consumers far less: $60 million on the first day and $90 million on the second. 

Some railroads began to limit the transport of perishable food and fertilizer this week in anticipation of a strike, rattling the U.S. agricultural sector, which called on lawmakers to resolve the strike threat as soon as possible. 

Commuter rail systems, which rely on freight rail lines, were also preparing for widespread service disruptions.

In response to Thursday’s deal, Amtrak said Thursday that it would restore long-distance lines that it suspended this week. 

The Biden administration intervened in last-ditch effort

Labor Secretary Marty Walsh joined union and railroad negotiators for more than 20 straight hours to help spearhead a compromise, while President Biden also personally weighed in on talks. 

Biden wanted to avoid massive economic disruptions just before November’s midterms and the holiday shopping season. For weeks, the White House urged both parties to compromise for the sake of the nation’s economy, which is still struggling with red-hot inflation. 

“This is a great deal for both sides, in my opinion,” Biden said Thursday. 

Congress no longer needs to act, for now

Congress this week was preparing to step in and use their authority to block the strike, but lawmakers were divided on how to intervene. 

GOP senators on Wednesday pushed for a bill to force unions to accept the terms outlined by the presidential board, but Democrats blocked the resolution, arguing that negotiators should be given up until Friday’s deadline to reach a deal.  

Speaker Nancy Pelosi (D-Calif.) said Thursday that Democrats on the House Transportation and Infrastructure Committee were ready with legislation to prevent a railroad shutdown if negotiations collapsed. 

“Thankfully this action may not be necessary,” Pelosi said in a statement. 

If workers in any of the rail unions vote to reject the tentative agreement, the issue could come back before Congress.