The world number one and defending champion appeared to be physically compromised for much of her 6-4 2-6 6-4 victory over Jelena Jankovic at the Sinan Erdem Dome but did just enough.
In the final on Sunday she will bid for her fourth title at the year-end championships and 11th trophy of an extraordinary season against China's Li Na.
Jankovic was unsure whether she would be able to play her best because of a cold but the Serbian made a great start, winning three of the first four games.
Williams has looked in supreme shape this week but her fearsome serve lacked its usual bite and she was not moving well at all.
She retrieved the break to get back to 2-3 but at the change of ends appeared to be sobbing into her towel.
Not that it initially did her any harm, the American winning 10 straight points as she went for broke and going on to take the first set.
Jankovic quickly took charge in the second, though, and this time there was no Williams comeback.
Remarkably, it was the first set the 32-year-old had lost at the tournament to anyone other than her sister Venus since 2007.
But Williams was far from finished. Her movement improved during the deciding set and it was clear how much she wanted to win the match, which has been one of the biggest factors in her phenomenal season.
From 1-1, Williams won four straight games, but there was another twist. She missed a match point at 5-2, and suddenly it was nerves rather than physical problems that seemed to be affecting her.
Two more match points came and went in the 10th game before finally Williams clinched it at the fourth time of asking.
Li, meanwhile, is guaranteed to end her season at a career high after comfortably beating Petra Kvitova.
Although the highlight of Li's career remains her French Open title in 2011, this season has been by far her most consistent.
Apart from the clay-court stretch, she has reached at least the quarter-finals of every event she has played, including making a third grand slam final at the Australian Open in January.
The 31-year-old's overall level was simply too good for Kvitova, who made 29 unforced errors in 18 games to lose 6-4 6-2.
The victory guarantees Li will leapfrog both Maria Sharapova - absent from the tournament with a shoulder problem - and Agnieszka Radwanska to finish the season as the world number three.
Additionally, Li will become the first Asian player ever to be ranked in the world's top three singles players, surpassing the previous high ranking of four that she shared with Japan's Kimiko Date-Krumm.
She said: "I reached my goal - top three in the world. That was the goal at the beginning of the year.
"I don't know if it's lucky but I'm happy that in the last tournament I made it, so it's a pretty good ending for 2013.
"Tomorrow is the last match. So I'll enjoy that and have a good vacation. This is my goal now."
Kvitova needed more than two hours to see off Angelique Kerber in a crucial group game on Friday night, and she said: "I think that I used a lot of energy yesterday when I had to fight back in the match.
"I was ready to fight again today but unfortunately I didn't have everything in my quest to beat her. She played really well. In the second set I didn't have any big chance."
It has at least been a good finish to the season for Kvitova, who in 2011 looked destined for number one when she won Wimbledon and the year-end championships.
But inconsistency has been her big weakness, and she briefly dropped out of the top 10 after an early loss at the US Open.
The Czech said: "I think if somebody told me after the US Open that I would play semi-finals here, I would think they were crazy.
"It takes some days to look back at 2013, but I think it wasn't bad. This tournament, and all season, was really up and down.
"There were tough moments in this season and great moments. I think that this tournament was still one of the best ones."