No matter who won the 2016 U.S. presidential election, Canada was bracing for NAFTA to go down in flames.

Internal documents, obtained by CBC News under access-to-information law, show the government started plotting out various "Plan B" options as early as August 2016 — months before Donald Trump was elected president.

Trump has been particularly hostile in trade relations between the two countries, but earlier notes prepared for the ministers of International Trade, Foreign Affairs and International Development warned that a Hillary Clinton presidency could have been a hardship too.

"There has been significant criticism of NAFTA by a number of candidates," one memo from 2016 cautioned.

It pointed to Clinton's repeated statements that the trade deal needed to be renegotiated, but particularly highlighted then-candidate Trump's "far stronger and far more frequent" negativity on NAFTA.

The documents — marked secret — go over "potential scenarios and implications," if the deal was annihilated by a U.S. administration, though the precise details of the Plan B's were removed from the document for confidentiality reasons.

Then in August 2017, Trump decided it was time to take a new look at trade in North America. His trade czar Robert Lighthizer said the administration had had enough with the deal.

"We feel that NAFTA has fundamentally failed many, many Americans and needs major improvement."

More than a year of slow, tense and sometimes hostile negotiations ensued, culminating in a new Canada-United States-Mexico Agreement (CUSMA) in the early hours of October.

In public, the government's talking points didn't change as the negotiators laboured on: Canada was committed to the talks and "will not walk away" from the table, Foreign Affairs Chrystia Freeland said.

Behind the scenes, however, communications titled "Plan B: NAFTA and CUSFTA withdrawal" were floating around government inboxes.

Multiple Plan B's

At least two scenarios were considered.

If the NAFTA deal was ripped up, the rules under the CUSFTA (Canada-United States Free Trade Agreement), the previous trade agreement signed in 1987, would have been reinstated. If the U.S. pulled out of that agreement too, Canada was researching the mechanics of the World Trade Organization standards that would have kicked in.

If both those agreements had been scrapped, Canada would have traded under "Most Favoured Nation" status with the U.S. within WTO rules.

Canada was preparing for wide-ranging fallout if all previous free trade agreements were abandoned. Memos bouncing between departments forewarned of the implications for the lumber, machinery, and oil industries and postulated how the investment climate would shift.

One particular piece of correspondence — called "WWJD" — explains how much authority Trump actually had to blow up NAFTA, and goes into the expected U.S., Mexican and Canadian reactions if Trump were to pull the plug. All of those details about reaction were redacted from the files CBC News obtained.

The government wasn't just preparing for the potential death of NAFTA. In November 2016, it also was alerted by the department about the potential for crushing tariffs.

The severity of the situation if tariffs were slapped on Canadian products was laid out, product by product.

(Canadian Press)

Canola, beef, pork, cars, oil and gas, plastic, steel and lumber were all included in a memo that warned if existing free trade agreements were cancelled, almost 65 per cent of Canadian exports to the U.S. would be hit with tariffs — $224.4 billion worth of goods.

Pressure far from over

Throughout the unpredictability, the internal messaging remained optimistic, at least on paper.

"Regardless of the current uncertainty, it remains important to continue advocacy efforts on the importance of NAFTA and the Canada-U.S. trading relationship, on both sides of the border," one briefing concludes.

Months of high-stakes negotiations taking place in cities across all three countries — including a period of time where Canada was threatened with the possibility of being left out of a deal — culminated in an agreement in principle.

On Nov. 30, that deal was signed on the sidelines of the G20 summit in Argentina.

WATCH: 'Battle' over as Trudeau, Trump, Pena Nieto sign 'new NAFTA'

The road to rewrite the North American trade agreement was a "battle," U.S. President Donald Trump said as Prime Minister Justin Trudeau and Mexican President Enrique Pena Nieto joined him for a signing ceremony on the sidelines of the G20 summit in Buenos Aires. 4:53

But the pressure is far from over.

Tariffs imposed on Canadian steel and aluminum remain, even though Prime Minister Justin Trudeau and Foreign Affairs Minister Freeland had hoped a new deal would nudge Trump to lift them.

Even this week, Freeland was still using international gatherings to remind the U.S. of Canada's abhorrence of the tariffs.

The CUSMA trade deal isn't yet ratified, facing roadblocks in the Democrat-led U.S. House of Representatives that threaten to delay the approval process.

In Munich, Germany, Freeland spoke with U.S. Speaker Nancy Pelosi about the national security tariffs and the ratification process for the new NAFTA.

U.S. Senator Chuck Grassley also said after meeting with Freeland last week he believes Canada and Mexico won't consider ratifying the agreement unless the tariffs are lifted.

The U.S. government shutdown delayed critical reports explaining details of the deal to Congress, which is expected to stall things further.

When asked about Grassley's comments and Canada's side of the process, Freeland said the governing Liberals are actively working on ratification and that conversations are ongoing in committees, cabinet and the Senate.

"Canada is definitely focused on our domestic ratification process," she said. "We feel we have it well in hand."