Relief, at last.

It took 22 games — more than 35% of this pandemic-shortened season — but as the Phillies were getting pummeled again Friday night in Atlanta, they finally did something about the worst bullpen in baseball, acquiring veteran right-handers Brandon Workman and Heath Hembree in a trade with the Boston Red Sox.

The trade deadline is still more than a week away, but general manager Matt Klentak couldn’t wait any longer. That’s how untenable the bullpen has become. So, in addition to sending underachieving pitcher Nick Pivetta to Boston, the Phillies dealt Connor Seabold, a promising right-hander in the farm system.

“You have to give something to get something,” Klentak said Friday night. “There are not a lot of quality relievers available right now in this market. Part of this is just us reading the market, trying to get a jump on it because I don’t know there will be a lot of relievers that change hands in the next 10 days.”

The deal came a few hours after the Phillies acquired right-hander David Hale from the New York Yankees for minor-league reliever Addison Russ.

It also nudged the Phillies closer to the $208 million luxury-tax threshold, although they did receive financial aid — $815,000, according to a source — from the Red Sox to defray the roughly $1.1 million that Workman and Hembree would have counted against the tax bill. The Phillies were roughly $3 million below the threshold before the trade.

Klentak continued to characterize the luxury-tax threshold as “a guide, not a hard barrier.” But even before managing partner John Middleton told team employees that the Phillies will lose $100 million this year, he said they would exceed the threshold for the first time in franchise history for a chance to contend for the World Series.

With a 9-13 record — thanks in large part to a bullpen that had a collective 8.07 ERA — the Phillies have hardly resembled rock-solid contenders.

“We think that Workman and Hembree are going to come in and really give our group a boost, and that’s what we need right now,” Klentak said. “I think it’s going to allow the rest of our group to all settle into their roles, take the pressure off the group. Now, all of a sudden, you look up and down that bullpen and you’ve got quite a few guys on any given night that [manager] Joe [Girardi] can turn to.”

Workman and Hembree were part of the Red Sox bullpen during a World Series-winning 2018 season. Workman, in particular, has experience as a closer, posting a 1.88 ERA and 16 saves last season.

“I’m very excited,” Girardi said after Friday night’s game. They’re experienced relievers that have pitched in a tough division, the American League East. I think it will add a lot to our bullpen.”

Workman, 32, is familiar to the Phillies, who drafted him in the third round in 2007 but couldn’t sign him because he chose to pitch for the University of Texas. He has a 2.65 ERA and 10.5 strikeouts per nine innings over 159 1/3 innings for the Red Sox since the beginning of the 2017 season. A free agent at the end of this season, he has a 4.05 ERA in seven appearances this year.

Klentak deferred to Girardi about whether Workman would take over the closer role, or at least steal some save opportunities from struggling Hector Neris.

“That’s something we have to talk about,” Girardi said.

But both Workman and Hembree figure to fill high-leverage, late-inning roles. Hembree, 31, has a 3.60 ERA in 260 appearances over the last eight years, including a 5.59 mark in 11 games this season.

After getting burned on multiyear contracts for veteran free-agent relievers Pat Neshek, Tommy Hunter, and David Robertson over the last few years, the Phillies took a different approach to bullpen-building last winter. They took several low-cost fliers with minor-league contracts for Francisco Liriano, Anthony Swarzak, Bud Norris, and Drew Storen, none of whom panned out during spring training or training camp.

The Phillies opened the season with only four relievers — closer Hector Neris, Hunter, and lefties Jose Alvarez and Adam Morgan — who had significant major-league experience, leaving pitching coach Bryan Price to say during training camp that they were “trying to catch lightning in a bottle” in putting together a bullpen.

That seemed precarious then. Twenty-one games into the season, it has been ruinous, the blown leads and crushing losses piling up.

“Philly came hard after these two pitchers,” Red Sox chief baseball officer Chaim Bloom told reporters. “They really wanted to complete something.”

Thursday appeared to have been a tipping point. The Phillies blew 2-0 and 7-0 leads in 3-2 and 9-8 losses in a doubleheader sweep against the Toronto Blue Jays in Buffalo, N.Y.

Asked if the Phillies could move forward without making moves to help the bullpen, Girardi said, “That’s Matt’s job and people above me. My job is to manage the players that they give me and to get the best out of them. So I will continue to try to do that.”

Pivetta was a change-of-scenery candidate in the offseason. Instead, the Phillies gave him a chance to win the fifth-starter job in spring training. He lost out to Vince Velasquez, began the season in the bullpen, and was demoted to the satellite camp in Lehigh Valley after giving up 10 runs on 10 hits in 5 2/3 innings.

Seabold, a former third-round draft pick, was a surprise invite to training camp last month and had been pitching in Lehigh Valley. He has a 3.52 ERA in 40 minor-league games and might have factored into the Phillies’ plans next year.

But for the Phillies to have any chance this season, Klentak couldn’t wait much longer to improve the bullpen.

“This is a very unique season,” Klentak said. “Our offense has been scoring runs and our starters have been pretty good. I think the bullpen was the area for us to address. I’d like to think in every season I’ve been here, we’ve done things to address what we believe our biggest needs are. I don’t think we did anything other than that.”