Nanji Xianweng lived at Yuxu Palace on Mount Kunlun in attendance on Yuanshi Tianzun. The white crane boy was constantly at his side, and when Yuxu Palace sent word to the disciples in their caves the two of them came and went at the gate.
When Jiang Ziya left Kunlun on his charge, Shen Gongbao stopped him at Qilin Cliff and showed off his attainment with the art of the flying head. As Shen Gongbao sent his head up into the air, Nanji Xianweng noticed and told the white crane boy to take crane shape and carry it off.
The crane bore the head away towards the southern sea while Shen Gongbao’s headless body stayed on the cliff, begging aloud. Jiang Ziya spoke for him, and only then did Nanji Xianweng have the crane bring the head back, warning Shen Gongbao not to obstruct the investiture again.
After the Ten Absolutes were set out, Zhang Shao, master of the Red Sand Formation, trapped King Wu, Nezha and Lei Zhenzi with three pecks of red sand. The three had a hundred days of misfortune to endure inside; Yuanshi Tianzun left Nanji Xianweng behind to break the formation, and the other immortals returned to their own seats.
When the hundred days were up, Nanji Xianweng came before the Red Sand Formation with the white crane boy. Zhang Shao rode out on his deer and attacked with his sword; Nanji Xianweng traded several exchanges with him and then followed him into the formation.
Zhang Shao climbed the high platform and poured down the red sand by the handful. Nanji Xianweng opened his Five-Fire Seven-Plume Fan, and at one sweep the sand left the air before him; Zhang Shao threw down whole pecks of it, and several more sweeps blew it away entirely.
Zhang Shao turned to flee. The white crane boy raised the Three-Treasure Jade Ruyi and struck him squarely in the back, then killed him with a sword inside his own formation. Nanji Xianweng called thunder to open the three pits, and Nezha and Lei Zhenzi woke in turn — but King Wu had already stopped breathing.
Lei Zhenzi carried King Wu out of the Red Sand Formation, and Randeng dissolved an elixir in water and poured it into his mouth. Two hours later King Wu opened his eyes again, and Nanji Xianweng and the white crane boy left the field.
When Yin Jiao held Western Qi off with the Sky-Overturning Seal, the Zhou camp needed several banners to close on him. Nanji Xianweng came to the Jade Pool at Yuxu’s order, prostrated himself on the golden steps, set out how Yin Jiao had betrayed his master and blocked Zhou, and asked to borrow the Immortal-Gathering Banner.
The gate of the Jade Pool opened and four pairs of immortal maidens came out bearing the banner, handing him what the Queen Mother of the West had granted. Nanji Xianweng carried it back to Western Qi, gave it to Randeng and the others to deploy, and returned to Kunlun ahead of them.
As the Investiture war neared its end, Nanji Xianweng still travelled to and from Yuxu Palace carrying Yuanshi Tianzun’s summonses to the disciples. He did not die on the Shang–Zhou field and was not enfeoffed on Jiang Ziya’s roll.
Later temples, paintings and popular telling often merge Nanji Xianweng with the high-browed, white-haired, staff-bearing god of longevity. In Investiture of the Gods he mainly attends Yuxu Palace, breaks the Red Sand Formation and borrows the banner; the deer, the peach and the old-man figure are later additions.