For two decades, and in recent years intensely, diplomats and power-mongers in Washington speculated that when Andrei Gromyko finally gave up the job of foreign minister of the Soviet Union, Anatoliy Fyodorovich Dobrynin would likely be called back to Moscow as his successor.

That expectation expired this month, when Gromyko was elevated to the ceremonial post of president of the presidium of the Supreme Soviet, the Soviet legislature, and a successor was named. It wasn't the veteran Soviet ambassador to the United States -- widely regarded as Moscow's preeminent foreign envoy -- but instead Eduard Shevardnadze, 57, a Soviet Georgian politician with strong party ties and no diplomatic experience.

As a result, after 23 years of adroitly balancing on the high wire between the superpowers, Dobrynin is faced with an unexpected new boss in Moscow, a continuing diplomatic stiff-arm from the Reagan administration, and the impolitic question as to how indispensable an interlocutor in the U.S.-Soviet relationship he is.

The Shevardnadze appointment narrows the options open to Dobrynin, one of the Soviet Union's most astute "Amerikanisti," an ebullient diplomat who has dined and sparred with U.S. secretaries of state during six administrations, has drunk and conferred with American journalists and members of Congress, and, as dean of the diplomatic corps, has become a Washington institution.

"He can either retire," a State Department Kremlinologist said, "or remain ambassador."

However, there have been reports, appearing first in the Israeli press, that Dobrynin may be replaced in Washington by the current Soviet ambassador to France, Yuli M. Vorontsov. Vorontsov was reported to have implied in a conversation with the Israeli ambassador in Paris, Ovadia Sofer, that he may be moving to the United States. Vorontsov is familiar with the United States, having served a long term in Washington as the embassy's minister-counselor, No. 2 to Dobrynin.

A State Department source said the United States has been hearing rumors of Dobrynin's replacement, and had been informed of the Israeli reports, but had received no word from Moscow.

Students of Soviet foreign policy interviewed here agree that the immediate course of Dobrynin's career will send an important signal for the near-term direction of relations between the United States and the Soviet Union under new Soviet leader Mikhail Gorbachev, who assumed power in March. Dobrynin's continuation in the job would indicate an element of continuity and stability in the Kremlin's U.S. policy, they feel.

At 65, the burly, affable Dobrynin often seems as active as he did on the day in March 1962 when he arrived here to take up his post.

He is highly regarded by Henry A. Kissinger, the former secretary of state, who lauded Dobrynin's "central contribution" to the formulation of U.S.-Soviet detente in the 1970s. William Hyland, now editor of Foreign Affairs magazine, said that Dobrynin's "indispensable usefulness" in Washington probably cost him a deserved posting in Moscow earlier that would have improved his chance of becoming foreign minister.

But as Dobrynin jetted off to Moscow two weeks ago in the wake of the shakeup above his head, signals that Gorbachev intends to deemphasize the role of relations with Washington in Soviet diplomacy underlined questions about the part Dobrynin and the other American specialists who had fared so well under Gromyko would play in Gorbachev's foreign policy.

Gromyko, who had served as ambassador to the United States in the 1940s, is said to have considered the Soviet-U.S. link central to Soviet foreign policy. He began his workday with Dobrynin's cables, according to Arkady Shevchenko, the former U.N. official and one-time aide to Gromyko who defected in 1978.

Gromyko gave plum jobs to the Foreign Ministry's American specialists and English speakers, many of whom had served under Dobrynin: Georgy Kornienko became first deputy minister, and Viktor Komplektov, a former head of the ministry's American section, also became a deputy minister.

Reagan administration officials say that in recent years Dobrynin's luster faded and his role as a link between the superpowers became less crucial.

One turning point was the Soviet invasion of Afghanistan in December 1979. U.S. diplomats close to Dobrynin at the time say he was "crushed" -- as one put it -- by the negative effect the sudden movement of Soviet troops into Afghanistan had on U.S.-Soviet relations.

Called back to Moscow following the invasion, he returned to Washington a changed man, "depressed" and introspective, said a U.S. journalist who had close contact with Dobrynin at the time.

By taking away the special access and status Dobrynin had enjoyed since the Kennedy administration, Reagan administration officials say they have successfully prodded the Soviets into relying less on him and more on Arthur A. Hartman, the U.S. ambassador in Moscow. With the cold stalemate in Soviet-U.S. relations since Reagan became president in 1981, "Dobrynin's clout and influence in Washington have inevitably suffered," one State Department official said. In contrast, the official added, Hartman has had better access to Gromyko than any previous American ambassador since the heyday of detente.

In January 1981, on the eve of a Dobrynin visit to the State Department, a department official called to notify him that his privilege of entering the department through the downstairs parking garage had been revoked, and he would be expected to use the C Street entrance like all other visiting diplomats. Dobrynin proceeded to try to use the underground entrance, perhaps deliberately, perhaps out of habit dating back to his secret meetings with Kissinger, when he'd been granted the right to enter and leave the department unnoticed. But a guard turned him back to the C Street entrance.

Further changes followed in the way Dobrynin was dealt with by administration officials. Most important, the special entree he had enjoyed with officials in the National Security Council and the State Department ended. Whenever Dobrynin meets with Reagan administration officials, he is received by a full panoply of aides and notetakers.

"Meetings between Dobrynin and the Reagan administration are conducted in the most formalistic manner," said Murrey Marder, veteran diplomatic correspondent of The Washington Post who is conducting a long-term study of U.S.-Soviet relations, "and they obtain the most formalistic results."

Reagan administration officials acknowledged that the visits were robbed of their intimacy, but they were adamant that Dobrynin should be treated not as a superdiplomat but as other foreign ambassadors in Washington are, and with the same official approach that Soviet officials in Moscow take with U.S. envoys.

Besides the private sessions, favors such as the rides Kissinger gave Dobrynin on Moscow-bound trips became taboo.

Dobrynin joked about the rebukes and occasionally derided them as counterproductive, says Lawrence S. Eagleburger, former undersecretary of state in the Reagan administration. "He was clearly displeased."

Many of the U.S.-Soviet agreements forged during detente have expired and with them the impetus for Dobrynin's contacts with various Cabinet secretaries. "Time has taken its toll, too," on Dobrynin's effectiveness in Washington, said Helmut Sonnenfeldt, a Sovietologist at the Brookings Institution. Many of his closest contacts, such as former senators Charles H. Percy of Illinois and J. William Fulbright of Arkansas, are no longer in office.

In addition, rumors of a rift between Gromyko and Dobrynin began to sprout in Washington, but they were never substantiated.

However, when Gromyko met Secretary of State George P. Shultz in Madrid following the Soviet downing of a South Korean airliner in 1983, and when the two conferred in Vienna in April this year, Dobrynin's absence was conspicuous, U.S. officials said, particularly because he had established a custom of appearing whenever the Soviet foreign minister met with his American counterpart. Dobrynin's life, Sonnenfeldt feels, "has not been without some friction at home."

But Dobrynin's diplomatic accomplishments outweigh his difficulties, according to many U.S. analysts. He gets special credit for cultivating the detente relationship in the 1970s, including important roles in the negotiating of the SALT I and SALT II arms treaties.

Born in Krasnaya Gorka, near Moscow, in 1919, Dobrynin was an aeronautical engineer until 1944, when he entered the diplomatic service. In 1952, at 33, he became counselor at the Soviet Embassy in Washington. After filling several posts at home and at the United Nations, he and his wife, Irina, also an engineer by training, returned to the United States in 1962. Since then he has become the longest-serving Soviet ambassador in the U.S. capital.

Dobrynin's career as ambassador in Washington began in 1962 on what remains its sourest note: with the newly arrived envoy assuring President John F. Kennedy and others that the Soviet Union was not using Cuba as a base for offensive nuclear weapons. Whether Dobrynin lied or was simply not informed is still a matter of debate.

And there were other strains: the 1968 Soviet intervention in Czechoslovakia on the eve of an announcement of U.S.-Soviet arms talks, and conflict within the Carter administration about how to deal with the Soviets in general and Dobrynin in particular.

But there were high points, too, especially the two SALT treaties he helped negotiate. And Dobrynin set a new standard for Soviet diplomacy in Washington. He initiated private dinners with U.S. officials, which no previous Soviet or East-bloc official had dared do. He even gardened often with former secretary of state Dean Rusk.

Dobrynin also occupies a special place in the Soviet diplomatic corps. One of the few ambassadors to hold a seat on the Soviet Central Committee, Dobrynin has often briefed Politburo members personally and at length, according to various reports.

It is a mark of distinction to work under Dobrynin here, an embassy official said recently. "You know that your suggestions will receive attention in Moscow if Dobrynin puts his stamp on them," the official said.

Dobrynin became ambassador in Washington before a quarter of today's Americans were born. Altogether, he has spent 29 years in the United States, nearly half his life. In conversations he displays a knowledge of songs, cities and leaders of the United States that is daunting in its breadth and easily exceeds that of many natives.

With fluent although accented English, he spices his chatter with jokes about the Washington Redskins and anecdotes about some of the distant cities of New England or the Midwest, which he has visited during bus and car trips around the country.

Dobrynin is intimately familiar with the U.S. political system, said U.S. legislators who have dealt with him.

And he shows a detailed knowledge of the thinking of Washington personalities like Assistant Secretary of Defense Richard N. Perle and national security affairs adviser Robert C. McFarlane, men whom he barely knows personally.

Raymond Garthoff of the Brookings Institution, who has just completed a comprehensive study of recent U.S.-Soviet diplomatic relations, says that the Kremlin under Gorbachev has a great need for advisers like Dobrynin, particularly given the unhappy state of superpower relations.

But whether Dobrynin will have an important role to play remains to be seen. He is back in Moscow now, and many specialists in Washington are waiting eagerly to see first if he returns at all, and if so, with what sort of brief from the new leaders in the Kremlin.