In 214, after the warlord Liu Bei seized control of Yi Province (covering present-day Sichuan and Chongqing) from Liu Zhang and became the new provincial Governor, he employed Zhang Yi to serve as a scribe (書佐) in his office.