Cosmos caudatus is a traditional Indonesian medicinal plant commonly used in the treatment of cancer, hypertension, diabetes, osteoporosis, and other potential health conditions. However, the mechanisms behind its compounds, targets, diseases, disease pathways, and their molecular profiles in treating lung cancer remain unclear. Therefore, a comprehensive approach is required to study these mechanisms by integrating metabolomics, bioinformatics, and in vitro experimental validation to explore the active compounds, targets, diseases, disease pathways, and molecular mechanisms involved in the treatment of lung cancer. The active compounds were identified through analysis using ultrahigh-performance liquid chromatography-quadrupole-orbital ion trap-high resolution mass spectrometry (UHPLC-Q-Orbitrap HRMS), and the screening of active compounds was conducted based on ADMET parameters. Potential compounds from C. caudatus and lung cancer-related targets were retrieved from public databases, such as SwissTargetPrediction, DisGeNET, DrugBank, GeneCards, PharmGKB, and TTD. Gene Ontology (GO) analysis of the targets was performed using DAVID, and protein–protein interactions (PPI) were analyzed using STRING and Cytoscape. A pharmacological network was constructed with Cytoscape. Finally, molecular docking analysis was conducted to predict and validate the interactions between C. caudatus compounds and core lung cancer targets. The metabolomic approach identified 66 compounds in the leaves, of which 13 met the criteria for gastrointestinal drugs. The compounds 3’,4’,5,7-tetrahydroxyflavone, AKT1 target, lung neoplasms diseases, and PIP3 activating AKT signalling pathway, became the core target with the highest degree value in the pharmacological network formed. In the protein-protein interaction (PPI) network, AKT1 again became the core target with the highest degree value. Gene Ontology (GO) functional enrichment analysis revealed that the biological processes, molecular functions, cellular components, and KEGG pathways in lung cancer were phosphorylation, cytoplasm, protein binding, and cancer pathways, respectively. The three compounds with the best binding energy and hydrogen bonding were 3’,4’,5,7-tetrahydroxyflavone-AKT1 (9C1W), gamma-mangostin-EGFR (3P0V), and cratoxyarborenone E-TNF (1XU1), with binding energies of − 10.8, − 8.9, and − 9.6 kcal/mol, respectively. The methanol extracts inhibited A549 cells at a concentration of 156.12 µg/mL. The combination of these methods provides insights into the pharmacological mechanisms of C. caudatus compounds in the treatment of lung cancer.