In late 230, when the Cao Wei regime launched a counteroffensive with a sizeable army, Zhuge Liang sent Wei Yan and Wu Yi as military attachés to join forces with the Qiang tribes in the northwest to harass the Wei army's rear.
During the fourth Northern Expedition, Zhuge Liang sent Wei Yan, Wu Ban and Gao Xiang to lead troops in three columns to counter the Wei commander Sima Yi, who was leading a frontal assault from the central main road.