DORTMUND, West Germany (AP) _ Mikhail S. Gorbachev's foray into the hard-hat heartland of the Ruhr valley Thursday produced a roaring workers' welcome for his reforms, contrasting with the grumbles he has heard at home.

Gorbachev and his wife, Raisa, drew claps, cheers, whistles and shouts of approval from more than 8,000 workers in hard hats at the Dortmund headquarters of Hoesch, a giant steel concern.

''Gorby 3/8 Gorby 3/8'' chanted the crowd as Gorbachev gave his first speech to workers in the West, a rousing series of slogans punctuated throughout by thunderous applause.

The workers had waited almost two years to meet the Soviet leader. Worried about job losses in the Ruhr's outmoded heavy industry, workers' representatives from Hoesch and other area firms wrote Gorbachev in 1987 asking for more economic cooperation.

Gorbachev gave them no firm contracts, speaking instead about Soviet-German friendship. He clearly enjoyed the response he got.

''We don't know exactly what kind of society we are headed for, but we know it will be a society of broad freedoms, a society based on human qualities ... a society of people's power,'' he said.

''No matter how hard it will be for us, we will determinedly stick to this path of perestroika,'' Gorbachev said, to roars from the crowd. ''We feel your solidarity and in the name of our workers, I thank you for this solidarity.''

The Ruhr workers, untroubled by shortages of consumer goods that frustrate their Soviet counterparts, applauded Gorbachev. They vented their anger at a former economics minister, Otto Lambsdorff, who drew jeers and whistles when introduced as a guest alongside former Social Democratic chancellors Willy Brandt and Helmut Schmidt.

The workers presented Gorbachev with a unique electronic toy complete with his portrait.

Werner Nass, head of the works council at Hoesch, said the device was a miniature of an electronic vote-counting system Hoesch will deliver to the Supreme Soviet, the new Soviet legislature that Gorbachev heads.

The Kremlin leader beamed his thanks and left the hall amid more cheers.

Outside, security was tight and the mood less elated.

Scores of uniformed police lined each side of Gorbachev's route between Hoesch and the train station.

Police teams with dogs patrolled the road and residents of the working- class neighborhood said they had been asked to close all windows and doors for more security as Gorbachev drove past.

Police issued megaphone warnings to residents to keep off sidewalks.

''They were standing on the streets in Bonn shaking his hand, and here we're not even allowed to get close,'' said Brigitte Weidemann, 19. But she still praised Gorbachev: ''He's doing something about his country's problems. I think he's a good leader.''

Michael Paprocki, 67, a World War II veteran disabled while fighting the Soviets, disagreed.

''Maybe he'll take billions of marks home with him,'' Paprocki said. ''But he's not here for any other reason. He should get his own home in order first.''