Fifty years ago this week, Robert Kennedy declared his candidacy for president. In the wake of Sen. Eugene McCarthy’s strong showing in the New Hampshire primary, Kennedy’s candidacy was not greeted with universal acclaim — that would grow over time. Although some considered it a political crusade, to others, it smacked of rank political opportunism.

Over the years, the perception of Kennedy as a candidate and his place in the liberal tradition of the Democratic Party have been framed more by the untimely end of his crusade than by the decision to embark on it in the first place. But there are clear lessons that prospective candidates can draw from Kennedy’s vacillation and eventual campaign. To triumph, candidates must plunge in, innovate, inspire and unify their parties — things Kennedy only partially succeeded in doing.

As early as 1962, Kennedy was considered a future presidential candidate. But when anti-Vietnam War activist Allard Lowenstein approached him about running in September 1967, Kennedy declined, despite growing disenchantment with his party’s positions on inner cities and Vietnam. Lowenstein then persuaded McCarthy to run, setting up a future conflict between the McCarthy and Kennedy camps.

Over the winter of 1967-1968, Kennedy agonized over whether to run or to wait. Some advisers, including his brother Ted, argued that challenging an incumbent from one’s own party was madness and would lead to a GOP victory in the general election. Others countered that Kennedy was the only candidate who would halt the Vietnam War and address the poverty and race issues articulated by the Kerner Commission.

Kennedy and his advisers were concerned that had he been the first to challenge President Lyndon B. Johnson, he would have exacerbated the perception that he was ruthless, in part because of the longtime feud that existed between Johnson and Kennedy. But his late entry into the contest triggered consternation and grumbling anyway, because McCarthy had become the darling of the left and student activists, both constituencies Kennedy saw as naturally his. Detractors labeled him “Bobby come lately,” and infuriated columnist Murray Kempton cabled Ted Kennedy, “Your brother’s announcement makes clear that St. Patrick did not drive all the snakes out of Ireland.”

Kennedy’s vacillation owed both to political and policy calculations. Pushing him to run was concern about potential damage to the United States if policies were not changed. More selfishly, he wondered if passing on a run might freeze him out of the White House until at least 1980 should Johnson win reelection — as the professional political operators on Kennedy’s team assumed — and anoint his preferred successor in 1972, presumably Vice President Hubert Humphrey.

But it was political calculation that initially kept Kennedy out of the race. He cited Johnson’s ability to control events; the fickle nature of opinion polls — which showed him ahead of Johnson for most of 1967; and the adverse mathematical calculations for delegate selection. This latter element was important in the pre-reform era of fewer primaries and party boss control. Kennedy concluded that a winning campaign “simply could not be put together” and said as much publicly in early 1968.

But then, as Arthur Schlesinger Jr. wrote, the Tet offensive, launched by the North Vietnamese in late January, “changed everything” for Kennedy, altering his careful calculations about both politics and the greater good. When the administration rejected Kennedy’s idea of a commission to investigate the U.S. commitment in Vietnam, Kennedy reversed himself.

Fifty years later, what does his final journey instruct us about the politics of today and tomorrow?

The first lesson: To succeed, a candidate can’t afford to vacillate up front. Kennedy’s initial choice to demur enticed McCarthy into the race, leading to even deeper fractures in an already divided party. Even after his death, those schisms lingered, keeping the party split and ultimately costing the Democrats the White House.

Getting in earlier would have allowed Kennedy to enter the New Hampshire and Wisconsin primaries — he missed both filing deadlines — potentially building momentum. An earlier decision to run also would have provided time to properly plan his campaign. After all, he had masterminded John Kennedy’s 1960 campaign; an effort which was planned from November 1956 and had a well-executed strategy.

Candidates like George McGovern, Jimmy Carter and Barack Obama secured the nomination (and in two cases, the presidency) by plunging in early and taking advantage of the opportunity to build momentum in early state contests. By contrast, candidates who failed to learn from Kennedy’s experience, including former vice president Joe Biden, waited too long and saw their path to victory vanish.

A second lesson: The presidential election cycle and its candidates exist at the whim of events and the vagaries of press coverage — making flexibility, innovation and resilience the keys to success.

Kennedy’s campaign was shaped by events like Tet and Johnson’s decision not to run. His opponents also used sharp-elbowed tactics, including in a California primary debate when Kennedy was prevented from entering a TV studio while McCarthy debated an empty chair. Difficult political and social times — like in 1968 and today — can lead to volatility in politics, requiring successful presidential candidates to adapt to constantly changing conditions.

Innovation is also required of candidates who successfully grapple with these conditions and overcome party elites’ preference for insiders. In fact, three Kennedy brothers — John  in 1960, Robert in 1968 and Ted in 1980 — waged presidential campaigns from outside the Democratic Party mainstream, with significant success. John Kennedy was too young and too Catholic for many party bosses, while both younger brothers fought incumbency and party machinery.

Yet both Robert Kennedy’s candidacy in 1968 and Ted Kennedy’s 1980 campaign also illustrated that fighting the party machine and bitterly splitting one’s party is not a reliable route to the White House. Donald Trump may seem like an exception to this, having taken on the Republican establishment in 2016. But crucially, the Republican Party eventually coalesced around him once he became the party standard-bearer. To win, a candidate must challenge the party chieftains and demonstrate independence, but also must prove capable of unifying all different factions.

These lessons are crucial moving forward, because Democrats find themselves in a similar position in 2018 to the one that confronted them in 1968. The party is deeply divided, and must once again find a unified voice on civil rights, gun control, health care and immigration.

The message of Robert Kennedy’s 1968 journey offers a hint as to how to unify Democrats: To triumph in 2020, a candidate must inspire people and offer them hope. The Democratic Party needs to rediscover its liberal soul, set out a clear agenda and unite behind a new champion of the left who will carry the fallen standard into the 2020 race.