• The 2D/2D COF/CdS Z-scheme heterojunction was first reported. • The Z-scheme charge transfer pathways were first identified by Femtosecond transient absorption. • The excellent photocatalytic hydrogen evolution was achieved. • The improved charge separation and hydrogen-evolution kinetics were confirmed. Covalent organic frameworks (COFs) with high crystallinity and flexible designability have been considered as promising candidates for photocatalytic hydrogen evolution. However, the existence of unpropitious exciton effects in COFs leads to poor charge separation, and thus results in low photocatalytic efficiency. Herein, to improve the photoelectron migration efficiency, we designed a 2D/2D organic/inorganic direct Z-scheme COF-based heterojunction (TpTAP/CdS), by the in-situ growing of CdS nanosheets on the COF copolymerized via 2,4,6-tris(4-aminophenyl)-1,3,5-triazine (TAP) and 1,3,5-triformylphloroglucinol (TP). The femtosecond transient absorption (fs-TAS) decay kinetics of TpTAP-COF and TpTAP/CdS further reveal the processes of shallow electron trapping and the recombination of the free photogenerated electron-hole pairs. In particular, the transient absorption traces for TpTAP-COF and TpTAP/CdS normalized to the photoinduced absorption peak can effectively verify the Z-scheme charge transfer between TpTAP-COF and CdS, which could enhance the charge mobility and separation, thus reducing the photocorrosion of CdS. Additionally, ultraviolet photoelectron spectroscopy (UPS), in-situ X-ray photoelectron spectroscopy (XPS), transient photovoltage measurements, and Electron spin resonance spectroscopy (ESR) further confirm the establishment of the internal electric field (IEF). This work demonstrates the important role of COFs in the construction of 2D/2D organic/inorganic direct Z-scheme heterojunctions and offers a new avenue to explain the criticality of dynamics of the photogenerated carriers for the construction of Z-scheme heterojunctions.