Negotiations between WestJet and unionized pilots neared crisis last week as negotiators for the airline threatened to lock out pilots and shut down the company. That's when the chief federal mediator and the federal labour minister boarded planes to intervene as heated contract talks reached a boiling point.

Those are just some of the details CBC News has learned from internal documents and interviews about the tense negotiations that — if they'd fallen apart — could have grounded flights and stranded passengers.

CBC News has also learned what issues remain unresolved and about the potential impact that the first union contract is expected to have on the airline.

Earlier in the month, about 150 WestJet pilots lined up in front of the airline's head office during its annual meeting with stakeholders. (Kyle Bakx/CBC)

Lockout threat

The two sides had held talks for nine months, but negotiations picked up in recent weeks after 150 pilots held a demonstration at WestJet's Calgary headquarters during the company's annual meeting. Two days later, pilots voted overwhelmingly to give their union, the Air Line Pilots Association, a strike mandate.

There were options on the table and a lockout was one of them. - Lauren Stewart, WestJet spokesperson

According to an internal union document obtained by CBC News, WestJet negotiators suggested the airline could lay off a large number of pilots and lock out the remaining unionized pilots.

Avoiding job action

Labour Minister Patty Hajdu arrived in Calgary on Thursday to meet with company and union officials. Her involvement, along with that of a federal negotiator, seemed to work. The two sides signed off on an agreement process on Friday evening — thereby avoiding any work stoppage.

WestJet and the union have agreed to mediation — and, if required, final and binding arbitration.

"After four weeks of operating under a strike threat that has been very damaging both financially and to our reputation, I could not sit back, stand by and watch the organization be effectively slow-baked into this position, so we were coming very close to our form of action," WestJet CEO Ed Sims told reporters on Friday night.

The lockout threat could have been more of a tactic than an actual possibility, similar to the union's strike mandate. But actual job action by the airline could have hurt its public support.

"That kind of talk on each side of the table as you get close to a potential impasse [is normal]. Each party will describe to the other what a worst-case scenario could be for the other party," said labour relations consultant George Smith, a fellow at Queen's University's public policy school.

"I would think this is something the company might have wanted to remain in the four walls of the negotiation," said Smith, who is also former director of employee relations at Air Canada.

Ground the company

The same union document says WestJet negotiators went one step further and threatened to "shut down the whole airline."

The warning could have been a negotiating ploy, but Sims had seen an airline shut down before. In an email that Sims sent to WestJet employees earlier in the month, he highlighted his experience working at Ansett Australia, where a union leader reportedly preferred the airline go bankrupt than accept job losses.

"The union had put their arms so tightly around us, we fell into the abyss together. Two weeks later, just after the unforeseeable events of 9/11, Ansett went under after 66 years of flying. Everyone lost their jobs," Sims wrote in the email.

WestJet CEO Ed Sims said Friday the financial damage to the airline can be counted in the 'tens of millions,' which does not include the impact on the company's share price. (CBC)

"I am surprised by that," said Smith, calling it "extreme" considering the company's financial success.

"In the heat of battle at the bargaining table, a threat might be made just to try to adjust the expectations of the pilots and make them realize how important cost control is from the perspective of the company," Smith said.

In emailed responses to CBC News, WestJet did not confirm nor deny that its negotiators threatened to shut down the company.

"There were options on the table and a lockout was one of them," spokesperson Lauren Stewart said.

The union declined to comment on the threat of a company shutdown. A representative referred to a Facebook post published Friday that referred to the "very real threat" of a lockout.

What's left to do?

The pilots and the carrier have tentatively agreed on many items of the agreement such as medical examinations, training, and discipline. The most significant unresolved issue could be seniority, an especially crucial item for pilots.

"Most pilots work for the same airline for their whole career because seniority is so important to them. Even though their skills are transferable, their paycheque depends on the equipment they are flying, how far they are flying and all of those things are tied to seniority," said Smith.

One item no longer on the table is whether unionized pilots will fly for WestJet's new discount airline, Swoop. Sources inside the union had told CBC News that issue was a major sticking point and likely significant enough to motivate pilots to strike when Swoop launches on June 20.

In the end, the two sides agreed Swoop's pilots will be part of the union. Their compensation and other details are still being negotiated.

Lingering financial impact

WestJet is suffering a temporary financial hit in the "tens of millions of dollars," according to Sims, as wary travellers booked elsewhere to avoid a potential job action.

Analysts are watching the pilot negotiations closely to determine the lasting fiscal impact.

The air carrier has a 13-year streak of quarterly profits, but expenses could escalate.

"Our concerns continue to remain how these negotiations impact the company's long-term cost profile as well as other employee groups, which are being approached to organize formally," AltaCorp Capital analyst Chris Murray said in an investor note on Monday.

​Other employees are watching the negotiations with pilots closely. Clive Beddoe, the airline's co-founder, warned in a 2013 video to employees about how pilots set the tone for the industry.

"Everybody in the industry has taken leadership from the pilots, so what will happen if we continue to pay pilots excess of market [value]? Why wouldn't we pay everybody else excess of market [value]? It's quite logical, quite reasonable.

"Well, I'll tell you, we will not survive. We will not survive that," he said.