Gongsun Yuan () (died 238), courtesy name Wenyi, was a warlord and vassal of the state of Cao Wei during the Three Kingdoms period of China. He rebelled against Wei in 237 and declared himself "King of Yan" (). In 238, the Wei general Sima Yi led forces to Liaodong and successfully conquered Yan.