In the domain of complex networks, the identification of influential nodes plays a crucial role in ensuring network stability and facilitating efficient information dissemination. Although the study of influential nodes has been applied in many fields such as suppression of rumor spreading, regulation of group behavior, and prediction of mass events evolution, current deep learning-based algorithms have limited input features and are incapable of aggregating neighbor information of nodes, thus failing to adapt to complex networks. We propose an influential node identification method in complex networks based on the Transformer. In this method, the input sequence of a node includes information about the node itself and its neighbors, enabling the model to effectively aggregate node information to identify its influence. Experiments were conducted on 9 synthetic networks and 12 real networks. Using the SIR model and a benchmark method to verify the effectiveness of our approach. The experimental results show that this method can more effectively identify influential nodes in complex networks. In particular, the method improves 27 percent compared to the second place method in network Netscience and 21 percent in network Faa.