Canada’s longest railway strike in a decade has ended after Canadian National Railway Co, the country’s biggest railway, reached a tentative agreement with workers that would help restore grain exports and transportation of chemicals and heating fuel.

The agreement will send thousands of workers back to their jobs after eight days on strike starting on Tuesday, ahead of a vote by union members to ratify the deal. Operations are expected to be in full swing again on Wednesday.

Canada relies on CN and Canadian Pacific Railway to move crops, oil, potash, coal and manufactured goods to ports and the United States.

Justin Trudeau welcomed the deal, the prime minister tweeting: “Thanks to the workers, industry and all Canadians for their patience during these negotiations.”

Details of the agreement were not available but some 3,200 striking conductors and yard workers had been demanding improved working conditions, including rest breaks.

The tentative deal brings relief for Trudeau’s new minority government, which was under pressure to intervene and stop the strike.

“Now we can hope that things can get back to normal in quick fashion. It’s cost a lot of money to farmers already,” said Markus Haerle, chairman of the Grain Farmers of Ontario.

Wet conditions have stalled the harvest across much of Canada. Those crops must be dried before they can be sold, but the rail strike held up deliveries of propane, forcing farmers to use costlier alternatives.

The Teamsters Canada president, François Laporte, praised Trudeau’s Liberal government for allowing the workers to reach a negotiated settlement with CN.

“Previous governments routinely violated workers’ right to strike when it came to the rail industry,” he said. “This government remained calm and focused on helping parties reach an agreement, and it worked.”

Brendan Marshall, vice-president of economic and northern affairs at the Mining Association of Canada, said miners were facing hefty costs due to lost sales and plant disruptions and that it could take a week for every day of disrupted service to restore normal operations.