What's going on here is barnyard politics: the art of creating a federal posy posse, setting up aquaculture research institutes, bolstering America's dairy goat herds.

Appropriately, since it was a farm bill, the lawmakers last week were eating gift raisins and pistachio nuts, and a senator talked about hatching a legislative turkey in time for Thanksgiving.

The senator, S. I. Hayakawa (R-Calif.), talked House and Senate farm conferees into declaring flowers to be as vital to the country as sliced bread. They set up a 75-member flower promotion panel (called the Floraboard) and gave it the power to police flower growers who don't contribute to a new flower promotion and research fund.

Another of those conservatives who wants to get government out of the manger, Rep. William M. Thomas (R-Calif.), got the conferees to give the secretary of agriculture the power to order emergency pesticide spraying in any state, no matter what a governor thinks.

Conferees debated more food-stamp cuts, but no one objected to the plan of Rep. Leon E. Panetta (D-Calif.) to allow the government to compensate farmers for losses from Mediterrean fruit fly spraying or fumigation.

For Sen. Howell T. Heflin (D-Ala.) there was a new soybean research institute. Rep. William C. Wampler (R-Va.) got his plan for four aquaculture research institutes approved. Prairie View A&M University in Texas, thanks to Rep. E (Kika) de La Garza (D-Tex.), will get federal grants for dairy goat research.

Those were the easy parts for conferees trying to work out a new farm bill. After two weeks of difficult meetings, they are still hung up on some key sections. Even with agreement, they face the prospect of seeing their work shot down in the House or vetoed by President Reagan.

In effect, the country has been without basic farm legislation since Oct. 1, when the 1977 law expired. An emergency bill passed last week will carry some programs through the year, but then a complicated and expensive 1949 law would take effect if the new bill is not enacted.

The conferees' basic problem, after decades of open-ended farm assistance, is the administration's insistence that the traditional commodity support, farm credit and rural development programs must be cut back to meet budget demands.

The White House and Agriculture Secretary John R. Block have hinted strongly that Reagan will veto the compromise bill if its projected cost ends up higher than the Senate's austere version.

Conferees from the House, where a far more expensive version was passed, have given in on one item after another, cutting dairy, rice, cotton and wool support programs sizably. But they are not happy about the pressures, and Republicans, such as Rep. Ron Marlenee of Montana, are openly contemptuous of the budget arithmetic.

Marlenee barked, "The administration is moving, but in so many directions nobody can keep track of it." Rep. Thomas S. Foley (D-Wash.) complained, "If we are going to have to conform to the Senate bill on each title, there's no point in being here. . . . Nothing seems to satisfy the administration except absolute capitulation."

The main complaint has been the administration's projections of the costs of the farm programs beyond fiscal 1982. The Agriculture Department holds fast to its numbers, even though its chief economist, William Lesher, concedes that reliable projections are impossible.

In January, for example, USDA projected that there would be no direct subsidy payments through target prices this year. But unanticipated bumper crops mean an estimated payment of $1 billion to farmers.

"If it were not for the needs of getting out a farm bill, we would not even attempt to make these long-range projections," Lesher said last week. "So our concern is with the size of the potential outlays. It is important to get a bill with protection for farmers, but not to give away the bank."

By USDA's calculations, the conference version of the bill so far is $250 million above the administration's announced bottom line, mostly because of the higher dairy, rice, peanut and wool price levels.

An agreement on wheat and feed-grain supports and target prices -- one of the major roadblocks -- is expected to increase that more and make the bill more vulnerable to a veto if it survives expected House challenges over peanut and sugar supports.

Sens. Jesse A. Helms (R-N.C.), the conference chairman, and Robert J. Dole (R-Kan.) warned Friday that no matter the grain price outcome, the conferees will have to go back over their final bill and cut more costs.

It is shaping up as a farm bill that everyone agrees is needed to shore up farmers and provide predictability, yet which satisfies no one.

Which brought a holiday inspiration from Sen. Edward Zorinsky (D-Neb.) "We're going to provide a turkey for Thanksgiving with this bill. I just don't want it to be a bigger turkey."

It could turn out to be a dead duck.