Congress is set to take up another set of votes on legislation to advance President Obama’s trade agenda, which — if five different roll calls go his way — could finally conclude by Friday with a major victory for the White House.

It’s been a several-month saga for Obama, with his bid to first win fast-track authority so that he can then pass a massive 12-nation trade deal bobbing and weaving at various points, seemingly dead in the legislative waters, only to bounce back to keep advancing.

Here’s a rundown of the key issues.

Wait, didn’t Obama already suffer a humiliating defeat on this?

Yes, no, kind of, basically. On June 12, the House upended Obama’s push to win fast-track powers, known as Trade Promotion Authority (TPA), but it happened not on the centerpiece of the legislation and instead on a side measure designed to provide funds for worker training to help those who have lost jobs because of global competition.

Even though almost every Democrat supports that worker program, more than 75 percent of House Democrats decided to oppose that piece of the legislative package because of the unusual rule that Speaker John A. Boehner (R-Ohio) used to try to pass the trade initiatives — split into two major parts, each measure needed to win a majority or else the entire agenda stalled.

The White House is urging Congress to vote on legislation key to a Pacific trade pact for President Obama for sign this week. (Reuters)

Fiercely opposed to expanded trade deals, particularly the emerging Trans-Pacific Partnership the president is closing in on, labor unions encouraged liberal Democrats to oppose the program that their members have benefited from over the years because it meant stalling the overall agenda. Republicans delivered far more votes (86) for the training program, Trade Adjustment Assistance (TAA), than they had ever expected, but with just 40 Democrats backing Obama on that vote, he lost in a rout.

That came after an unusual level of personal pleas by the president, who has been widely criticized by Democratic lawmakers for not developing close bonds with anyone on Capitol Hill. Before this vote he attended the annual Congressional Baseball Game for a few innings and trekked to the Capitol before the vote.

It was a very unusual moment for a president’s own party to so overwhelmingly reject his work.

So, how is this possible that the president still might win on trade?

Rather than sulk, Obama and his top advisers spent the next few days figuring out how to get around the Democratic blockade. They knew they had a super-majority of senators supporting fast-track powers — 48 Republicans and 14 Democrats voted for the entire trade package in late May. And they knew a slim majority supported TPA in the House, where the main issue won on a narrow vote moments after Democrats delivered the blow on the worker program.

Working the phones with Boehner and Senate Majority Leader Mitch McConnell (R-Ky.), the president agreed to a new plan that would peel off the fast-track powers for trade deals and move that as its own stand-alone bill. They weren’t abandoning the other pieces of the trade puzzle, but they decided that if everyone who already voted for fast-track would do so again, then TPA could be sent to the president’s desk and there would be no need to hold other trade-related provisions hostage.

The first step came Thursday, six days after the initial defeat, when the House approved the fast-track-only bill on a similar vote, with the same 28 Democrats joining with 190 Republicans to advance what Obama considers one of his most important final pieces of his presidency.

On Tuesday, the Senate faces a key test vote on the TPA stand-alone bill, needing 60 votes to overcome a filibuster from liberal opponents of the legislation. Most of the 14 pro-trade Democratic senators have signaled they will go along with the plan, despite previous demands that any vote for fast-track come attached with the worker retraining funds.

If Tuesday’s roll call crests 60 votes, that sets up a final passage for trade authority on Wednesday and would send the legislation to Obama to be signed into law.

But what about worker training and the acronym trade programs?

Sen. Orrin G. Hatch (R-Utah), chairman of the Finance Committee and a key negotiator on trade issues, has famously declared that the worker retraining funds are the “quid pro quo” that is required to get Democratic votes for trade deals. So, despite the apparent victory on expanded trade powers, Boehner and McConnell have pledged to Obama and other supportive Democrats that they are also ready and willing to get the other pieces to the White House.

And they have a handy vehicle to accomplish this. Rep. Paul Ryan (R-Wis.), chairman of the House Ways and Means Committee, tinkered with a third trade bill, boosting African trade. That sent the African trade bill back to the Senate, after receiving nearly 400 votes in House.

McConnell has taken that already popular bill and set it up to be amended to include TAA and also a program to make U.S. steel manufacturers more competitive on the global markets.

McConnell believes that the vote for this package will resemble a test vote held last month that would have gutted TAA, but instead, 46 Democrats and 16 Republicans supported the program. If that coalition holds together and clears the filibuster hurdle, slated for Wednesday evening, a final vote would come Thursday and then send the African trade bill and its new parts to the House.

Won’t House Democrats still block TAA just like two weeks ago?

That’s hard to say, but White House officials and their pro-trade allies in the Capitol believe that this new plan will leave liberal opponents of Obama’s trade agenda with no choice but to approve the newly assembled combination.

After initially citing many different reasons, most House Democrats eventually said their opposition to TAA’s worker funds was done solely to block fast-track. Now that the TPA bill will already be at the White House, the incentive to vote against a collection of three bills that most Democrats otherwise support might fade.

Supporters of Obama’s trade agenda believe dozens of members of the Congressional Black Caucus and the Steel Caucus will now support the plan, and other Democrats have privately suggested they might now vote for the package if it does nothing to stop the centerpiece of the original bundle — TPA — from getting signed into law.

That vote could happen Friday in the House.

Is that all? What’s next?

No, there’s a lot left to come. Even if each of those dominoes falls in Obama’s direction, he now has to go negotiate the final pieces of the TPP, the Pacific Rim trade deal that represents 40 percent of the global economy.

Once that’s finished, the president must send the deal to Congress for a pair of up-or-down votes under strict timelines and no ability to amend the text. If it reaches that stage, it will be a far bigger debate, probably with even more twists and turns.