Years ago, one of the nation's best labor lobbyists regularly took a briefcase full of checks up to Capitol Hill come summer and handed them out as campaign contributions to members of Congress his union wanted reelected in November.

Except for the fact that the transactions took place in a federal building -- technically illegal but virtually unnoticed in those more complacent days -- there were nothing illegal or even improper. The money came from voluntary contributions by union members, not from compulsory dues money. There were no legal ceilings on contribution amounts then, and in fact it would have even been perfectly legal to hand out cash instead of checks.

Although the laws are more restrictive now, unions are still handing out campaign money to candidates for Congress and the presidency, as they have been doing for a generation and more. They may not do it right under the Capitol dome, but they do it. Their members don't have as much money as affluent corporation executives, but they manage to ante up respectable warchests.

In the last congressional election cycle, 1977-78, six of the top 10 political action committees making contributions to federal election candidates were union PAC's, according to records of the Federal Election Commission.

The United Auto Workers topped the union list with $976,245 contributed to candidates with money collected by the union from its members on a voluntary basis. The AFL-CIO's national COPE (Committee on Political Education) gave out $884,441; the United Steelworkers, $599,930; United Transportation Union, $559,403; Machinists, $525,410; and Communications Workers, $471,183.

And although they trail big business PACs in total money collected, many big unions did well in 1979 also. Measured by receipts, 12 of the top 27 political action committees, led again by the UAW, were union-affiliated. Machinists, public employes, marine engineers, steelworkers, garment workers, two different teacher unions -- all had big-money operations souping up cash for the 1980 election.

During any legislative day, if you approach the House chamber through the main second-floor stairs on the Capitol Plaza, you will enter the corridor where most members troop in when the bell is sounded for a roll-call vote.

If the vote is of any special interest to labor -- the labor organizing bill, the construction-site picketing bill, Social Security changes, welfare, public jobs, taxes -- you will see lobbyists lined up along the walls buttonholing members as they come in, exclaiming "I hope you're with us!"

Familiar faces among these lobbyists: Ken Young or Ray Denison of the AFL-CIO; Arnold Mayer of the United Food and Commerical Workers; Greg Humphrey, American Federation of Teachers; Evelyn Dubrow, International Ladies Garment Workers; Lou Gerber of the Communications Workers; Dick Warden, UAW.

A list of the people the unions support is, with some exceptions like Sen. Charles H. Percy (R-Ill.) and Sen. Charles Mathias (R-Md.), generally a list of liberal, pro-labor, pro-welfare Democrats -- Sens. Birch Bayh, Alan Cranston, John Culver; Reps. Mike Barnes, Bob Eckhardt, Gus Hawkins -- and Labor Committee chairman like Harrison Williams (D-N.J.) and Frank Thompson (D-N.J.).

That's not always the case, however. They also throw some money at influential conservatives and middle-roaders who can do them some good. Maritime unions, led by the Marine Engineers Beneficial Association and the Seafarers, gave $1 million in contributions over four years in the early 1970s to dozens of members, including conservatives like Sen. Russell B. Long (D-La.) and Rep. John Murphy (D-N.Y.), to help push through cargo preference clauses for American ships. (They were unsuccessful, but most of those gave money to backed the proposals.)

Under the law, it is illegal for a union to make direct contributions to a federal candidate out of dues money. A corporation is forbidden to do it out of corporate funds. So instead, officials go around to union members or employees and ask them for voluntary personal contributions.

Rachelle Horowitz, director of the American Federation of Teachers' Committee on Political Education, said that in each school where the union has a unit, there is a "building representative" equivalent to a shop steward.

"Once a year they go around to all the teachers and ask for $10 for a voluntary contribution to COPE," she said. About two-thirds of the total take is kept at the local level for school board, state legislature, governor and mayor races, but about one-third finds its way into a fund for contributions for federal elections.

The decisions on which candidates to support are basically made by the state AFT federations in consultations with national officials like President Albert Shanker.

One tool of decision-making is the voting records compiled every election year by chief lobbyist Greg Humphrey. Based on issues most important to the union -- like school funding, tuition tax credit proposals, food stamps, labor law reform, other federal education policy issues -- the four-page folder shows whether members voted "right" or "wrong" one each.

For example, on nine Senate key votes in the last Congress, Robert P. Griffin (R-Mich.) voted "wrong" seven times, "right" once and was absent once. That was one reason the AFT backed challenger Carl Levin (D) with a $5,000 contribution and some legwork. Levin won.

Horowitz said, however, that it's increasingly clear the union PACs can't match the business PACs in money. And, she said, "The money isn't the main thing we do."

What the union can do -- and very well -- is to provide campaign personnel. Legwork. Phone work, particularly. Special types of publicity.

Though the union is forbidden to use dues funds or direct contributions, it can use dues funds to inform its own members on which candidates are good or bad for teachers.

As a result, it is able to send out mailings to its 550,000 members endorsing particular candidates. It can get teachers to man phone banks, calling all the members of the union in an attempt to get them to support specific candidates. "Wouldn't you love to have 50 articulate high school teachers calling your members all over a state telling them why they should back your candidate?" asked Humphrey.

The AFT has used this technique extensively in New York, where it has 220,000 of its 550,000 members. In the Kennedy campaign for president, one union paper after another went out with endorsements of Kennedy -- to teachers in New York, Pennsylvania, Maryland, etc.

And in New York, 16 offices in various parts of the state were manned by volunteer teachers, 30 to 40 in each, making calls to other teachers to support Kennedy -- for seven straight days.Horowitz thinks it played an important part in his victory in the New York primary.

A similar campaign in favor of Pat Moynihan (D.-N.Y.) when he ran for the Senate in 1976 was conducted by the AFT. And 300,000 such phone calls were made for Sen. Jacob K. Javits (R.-N.Y.) in 1974.

In 1978, union PAC's made about $10 million in direct contributions, while business and trade groups made about $20 million. But the unions hope to make up in legwork what they lack in dollars. As one union PAC official put it: "You know who your friends are."