Grangemouth owners Ineos are in last ditch talks with the workers' union, but the workforce is just one of the problems facing the plant.
Thousands of jobs are under threat after a dispute over conditions led to a shock decision to close the petrochemical site in Grangemouth.
The prospective Labour parliamentary candidate at the centre of selection-fixing allegations in Falkirk has quit the race.
David Cameron said he would "congratulate everybody involved" in keeping the Grangemouth petrochemical plant open.
John Convery, a manager at Grangemouth, described the last few days as "hellish"
"Myself and my colleagues, and all of our families, have been staring into the abyss," he said.
He added: "We'd just been paid but we didn't know if we were going to get another pay cheque again. We were told that the company we work for was going into liquidation and we didn't know if we were going to get any redundancy or what was going to happen to our pension ...
"There was a lot of relief and a lot of emotion in there, we're relieved that we've still got a job."
Energy Secretary Ed Davey has hailed an agreement to save the Grangemouth chemical plant and said it showed the Coalition's "commitment to Scotland".
– Energy Secretary Ed Davey
This is a very positive result.
Grangemouth is important to the Scottish economy, the UK economy and most importantly to the local economy where 800 jobs have been saved and the local community has avoided a major blow.
We can now look forward to a future of growth at Grangemouth.
Many people in the UK and Scottish Governments have worked hard to make this happen, a clear sign of our commitment to Scotland, its economy and its people.
– Alistair Carmichael, Scottish Secretary
The staff and their families have been through a very stressful and uncertain time. They have been through a hell of a week and I hope they have a much better weekend as a result of today's announcement.
They can look to the future with an optimism which was absent earlier in the week ...
There are undoubtedly lessons to be learned from this dispute but for now we should focus on the immediate success of securing the site's future.
Unite says that its members wanted the union to work with Ineos to implement its proposals:
Scotland's First Minister Alex Salmond said: "This news is a tremendous fillip for the workforce and the whole Grangemouth community, following what could have been a potential disaster.
"It's been a great team effort from all concerned, including the unions and workforce, the management, Governments - and BP, who have made a material contribution to help defend and secure Scottish jobs and livelihoods.
"I am delighted that people have rallied round to protect these jobs, and now we can all agree that Grangemouth has an outstanding future."
This is a big capitulation by the union to save 800 jobs at the Grangemouth plant.
Pay freeze, no strikes and a pensions cut. This is the "something big" that Ineos demanded.
The owners of the Grangemouth site in Scotland will open the petrochemical plant and the oil refinery immediately after both were shut down last week over an industrial dispute.
The move follows acceptance by the Unite union of a survival plan, including a pay freeze, ending of the final salary pension scheme and other changes to terms and conditions.
An undisclosed number of contractors have been laid off or switched to other sites.
Asked what the reaction from workers had been, Calum McLean said that the news came as a "great relief to the site".
Calum McLean, chairman of Ineos Grangemouth, has said that there is a 15-20 year future for the petrochemical plant.
He said there had been a "change of mind" by the Unite union and that the firm had received a "very clear message from the employees".
He added that the company plans to invest a further £300 million in the plant and that "redundancies will be very limited".