It depends on from which perspective you are asking the question.
From the standpoint of the Journey To The West novel, the Buddha was like the Consultant who knows and could do everything; the Jade Emperor was the boss, but when sh*t fits the fan, he would need to engage the help of this Consultant, who was outside the reporting line to him.
In Buddhist cosmology, the Jade Emperor could be mapped to Sakka (帝釋天), who is the Boss of the Tāvatiṃsa Heavens (三十三天) - see No. 7 of the attached chart. Inhabitants of heavens here will one day die too, being still subject to the rounds of (re)birth and death; though they have long lifespans compared to earthlings. The Buddha had already transcended the rounds of birth and death and attained final extinguishment.