Victory through Action Economy
Strategy, circumstances, and luck will all play huge roles in such an encounter, and so we really can't predict what will happen. However, your party is unlikely to be "instantly obliterated" and, provided they are reasonably competent, they actually have a good chance of carrying the day. Almost certainly some of them will go down, but it is more likely that the survivors will drive the dragon off than that they will all die.
Reasonable Competency
One of my biggest assumptions in what follows is that your party will encounter the dragon when they are fresh, perhaps after having fought only the cultists, who should not have taxed their resources. Have the party read the signs posted at all the entrances to the town, warning of zombies and plant creatures? Have they, being so warned, then scouted ahead (pseudodragon, moon druid, rogue with mask of the wild)? Have they seen the tower on the hill overlooking all the town and reasoned that something both big and bad is there? Has their scouting found the dragon cultists or the druid, either of whom could tell them about the dragon? On their way up to the tower have they seen the dead spiders and smelled the acrid smell? Have they looked in the arrow slits of the tower?
A party that stumbles into the tower low on resources (hp, spells, abilities) after a series of fights is indeed likely to be completely overcome by the dragon. But a reasonably competent party will have noticed at least one of the many ways they are being warned about the dragon and they should be encountering it fresh - even if they don't know that this boss monster is specifically a green dragon, they should be prepared for a difficult fight.
Just a wee cone
Yes, the dragon's breath is fearsome, and yes, it can one-shot seven of your eight PCs if they fail their saves. However, this is just a young green dragon, and its cone is only 30'. While your party could all fit in its cone if they tried, unless they have packed themselves together for pass without trace or something similar (they don't even have a paladin whose aura they are trying to stay in), it is hard to imagine why a party of eight would all be so close that the breath could affect enough of them. Certainly as soon as they realize that it is a dragon, they should be actively trying to position themselves apart from one another. For a gridless encounter, the DMG suggests that a 30' cone should affect just three PC's (Adjudicating Areas of Effect, p. 249). As a worst case scenario, suppose a clueless party with no idea they are facing a dragon crowds into the cottage next to the tower, and then throws open the door allowing the dragon to breathe on them. Of the sixteen squares in the cottage, only eight are at least half in the cone's area of effect. So yes, if your entire party packs into the cottage and then chooses to stand on exactly the eight squares that match a cone emerging from the tower, the dragon could breathe on all of them and if they they all fail their saves, only the dwarf would be left. (Side note, half of your party is of a class that has proficiency in Con saves, so they should be at about 50/50 to make the DC14 save).
Back of the envelope
The win condition for the party is doing half the dragon's hp in damage to it. To drive the dragon off, they need to do 68 points of damage before they all die. At third level, let's suppose a character can reliably contribute ten points of a damage per turn. Now, the dragon does have a higher-than-average AC of 18, but that's not harder to hit than the many hobgoblins the party faced in Cragmaw Castle. Still, we can lower our damage rate to 7hp per character-turn to be conservative. In other words, the party wins if they can spend a total of ten character-turns with the dragon (and remember, they are a party of eight).
As a further conservative estimate, suppose the dragon goes first (pretty unlikely; it has a +1) and immediately eliminates three party members with its breath weapon. The remaining five party members then attack; at the end of the round they have done 5 character-turns worth of damage to the dragon.
On the second round, assuming the dragon's breath doesn't recharge, it will be lucky to eliminate just one more PC. With a +7 to hit, its melee attacks are going to be about 50/50 to hit your party's ACs, but it will need more than two hits to take out most of the unwounded party members (more realistically, it should be splitting up its melee attacks to eliminate anyone that survived its initial breath, but we have already assumed that they all died). After the dragon goes and removes one more, the remaining four PCs add another 4 character-turns worth of damage, and the dragon is now at a total of 9.
On the third round, we can have the dragon eliminate two more PCs; perhaps its breath has recharged or it has a fabulous round of melee. Now the two remaining PCs take it to a total of 11 character-rounds of damage. At the start of the fourth round it will flee and the two surviving party members will begin stabilizing their allies.
This victory is entirely possible because you have a party of eight - few single boss monsters can turn the tide against such an onslaught of action economy. Suppose that instead of eight PC's doing 7 damage per turn, you had a party of four PCs doing 15 damage per turn. They are going to need only 5 character-turns to rout the dragon, half as many as your party. Let's further assume that of our initial three PCs in the dragon breath, there is one survivor (perhaps the dwarf, or someone does make their save). How would this fight likely play out?
Round one, the dragon drops two PCs. The remaining two put 2 character-turns of damage on the dragon. Round two, the dragon eliminates one more PC. The last PC puts 1 more turn on the dragon, for a total of 3 of the 5 needed. Round three, the dragon eliminates the last PC. It is a TPK and the dragon hasn't even been taken to half. This is a deadly encounter for a party of four - but your party of eight under-leveled PCs has a reasonable chance of survival.
Strafing?
Some might suggest that the "proper" way to run the dragon is to encounter it flying and have it strafe the party. I think this is a terrible idea for the dragon. Its 80 foot fly speed is powerful, but its only missile attack is its breath and that has a range of just 30'. It can't dash and breathe on the same turn. If it tries to wait at a distance until its breath recharges, and then move in to 30' range, it will be taking missile fire from the party all the way in and all the way back out and they will have time to spread out so that only one of them can be breathed on. Readied actions will make it difficult to even get close without taking hits.
Unless it is such a dark night that it can use its superior 120' darkvision to stay unseen, and it is committed to a long night of Stealth checks and picking off party members one at a time, the dragon will do far less damage strafing than if it just went toe to toe with the party.
What happened with my party of four
Party of four, all fourth level. Barbarian, Dwarven Cleric, Warlock, 3/1 Sorcerer/Monk. Mirna had told them where the heirloom was, so they entered town from the SE and immediately eliminated the cultists. The last two cultists had tried to escape to the tower so they went there next. They ignored the spiders, the acrid smell, and the chance to look in the arrow slits. The barbarian opened the door to the tower while the other three were outside the cottage.
First round - the barbarian was surprised and took 40 points of breath weapon - but saved for half. The dragon remained in the tower; if it did not recharge it wanted to solo melee the barbarian, but if it did recharge it figured it could fly out and get the other three. Second round - The dragon did recharge, so it flew out of the tower (hit by the barbarian's opportunity attack). It needed its entire move to go 40' up and out of the tower and then back down to the ground to try to angle for all three of those outside. In the end, no matter where I dropped the cone template it could get only two of the PC's. Forty more points of breath weapon - the sorcerer and cleric both saved; 20 points to the sorcerer, 10 to the cleric (dwarven resistance to poison). The warlock hit it and ran inside, the barbarian ran outside and shot it with a bow (couldn't reach in melee that round). The cleric hit as well. The sorcerer used Glasstaff's staff to drop a web on it. Third round - no recharge, the dragon failed its dex save and had to use its action to Strength check break out of the web. By the time it left the difficult terrain it could not move far enough away from the party to keep them from engaging with missile fire. It took enough hits to drop it below half. Round four - it recharged, then breathed on everyone but the warlock for another 40. The sorcerer failed and went down but false life kept him from being instantly killed. The cleric made the save and took 10 (dwarf). The barbarian made the save and took 10 (bear totem). The dragon flew away, and the party won.