[Display omitted] • Unidirectional charge transport at defect boundary. The inhomogeneous distribution of Se vacancies results in the surface potential difference at the defect boundary (SnSe 2 /G-SnSe 2-x /G), which generates a built-in field (BIF) from the pristine to the defective side. This BIF is experimentally confirmed by the remarkable rectification (6 0 0) and the photocurrent mapping. • Broadband photoresponse with 0 V bias. Based on the defect boundary, the self-powered photodetector is constructed with high performance, including a broadband photoresponse (450 nm ∼ 1064 nm), high on/off ratio (up to 104) and fast response (20 µs ∼ 60 µs). • Self-powered 2D photodetector arrays. Utilizing the highly automated focused ion beam technology, periodic defect areas are patterned on the SnSe 2 /graphene heterostructure, forming 2D photodetector arrays with performance differences less than ± 3%. Two-dimensional (2D) materials, whether pristine or defect-engineered, are promised as excellent candidates for the next generation of photodetector applications, due to their outstanding figures on optoelectronics. However, reports are focused on homogeneous materials, rather than inhomogenous ones containing both pristine and defective areas. Herein, we demonstrate the boundary of pristine (SnSe 2 /graphene) and defective (SnSe 2-x /graphene) 2D heterostructure generates the contact potential difference (CPD), leading to the unidirectional transport of photoexcited charges. Based on the defect boundary, we construct the self-powered photodetector with high performance, including a broadband photoresponse (450 nm ∼ 1064 nm), high on/off ratio (up to 104), fast response (20 µs ∼ 60 µs), and high responsivity (0.076 A/W ∼ 0.74 A/W). Moreover, utilizing the highly automated focused ion beam technology, periodic defect areas are patterned on the SnSe 2 /graphene heterostructure, forming 2D photodetector arrays with performance differences less than ± 3%. This work reveals the mechanism of the unidirectional charge transport at the defect boundary and offers a novel avenue for the further development of cosmically 2D photodetector arrays. [ABSTRACT FROM AUTHOR]