Also included in the trade to the Dodgers are infielder Enrique Hernandez, minor leaguer Austin Barnes and right-hander Chris Hatcher, while the Marlins also received infielder Miguel Rojas and a player to be named or cash in the seven-player trade.
The Dodgers then sent Heaney, considered one of baseball's top pitching prospects, to the Angels for second baseman Howie Kendrick.
Haren said late Wednesday he would take some time to decide whether he will agree to the trade or retire.
"I have been notified of the trade to Miami. My strong desire to remain in Southern California has been well-documented," Haren said in a texted statement. "I will have to evaluate my options carefully before making any decisions."
The trade of Haren would come less than a month after he told ESPN.com that he likely would walk away from baseball -- and leave $10 million in pretax income on the table -- if traded to a team other than the Angels, one of his former clubs. Haren's 2015 option with the Dodgers kicked in when he reached the 180-inning mark in September.
"My signing with the Dodgers last year and my decision to exercise my player option were based on my desire to play in Southern California near my family," Haren told ESPN in an email. "I had other opportunities, but at this point in my career, I have no interest in playing in a city away from my family."
Gordon took to Twitter to thank the Dodgers faithful after he was traded.
Gordon is a .272 career hitter in 329 games over four seasons. The 26-year-old left-handed hitter batted .289 with 2 homers this year for Los Angeles.
Information from ESPN.com's Mark Saxon was used in this report.