WestJet and the union representing its airline pilots reached a deal, narrowly avoiding a work stoppage that would have begun Friday.

The development in the negotiations came ahead of the strike deadline, but flight disruptions weren’t entirely avoided, as WestJet had already begun grounding most of its fleet on Thursday in preparation for the potential labour action.

Here’s what you need to know about the situation.

WHAT’S HAPPENING NOW

The Air Line Pilots Association, which represents 1,800 pilots at WestJet and its Swoop subsidiary, said union leaders voted to approve an agreement-in-principle.

Union leadership said the proposed contract delivers better job security and compensation and more flexible work schedules. Representative Bernard Lewall said the offer will help retain and attract pilots at WestJet. Union members will vote on the contract in the coming days.

WestJet, meanwhile, said it will take some time for its operations to ramp up, as it had already grounded the majority of its 737 and 787 planes as of Thursday morning in anticipation of the 3 a.m. strike deadline.

The shutdown has affected dozens of routes within Canada, and to the U.S. and other overseas locations. Flights with the WestJet Encore regional service and the WestJet-owned Sunwing Airlines have not been affected.

The airline is advising that travellers keep checking the status of their flights.

WHAT WAS THE BACKGROUND

The pilots’ union issued a 72-hour strike notice earlier this week, and WestJet issued a lockout notice in response.

Both sides were negotiating throughout the week ahead of the 3 a.m. MDT deadline on Friday.

WHAT BOTH SIDES WERE SAYING

Compensation, job protection and scheduling were the biggest issues at play in the strike notice, according to union leader Lewall.

WestJet, meanwhile, said its pilots were already highly compensated compared to other airlines in Canada, and that paying salaries comparable to U.S. pilot groups would put the company at risk.

With files from The Canadian Press.