The rapid growth of sequence data from high-throughput sequencing technologies has unveiled a vast number of previously unknown proteins, presenting a significant challenge in their functional characterization. Ancestral sequence reconstruction (ASR) has emerged as a powerful tool to elucidate the evolutionary history of protein families and identify sequence determinants of protein function. Here, we present AncFlow, an automated software pipeline that integrates phylogenetic analysis, subfamily identification, and ASR to generate ancestral protein sequences for structural prediction using state-of-the-art tools like AlphaFold. AncFlow streamlines the process of ASR by combining multiple sequence alignment, phylogenetic tree inference, subfamily identification, and ancestral sequence reconstruction from unaligned protein sequences. The reconstructed ancestral sequences are then subjected to structural prediction using AlphaFold, enabling the investigation of the structural basis of functional divergence within protein families. We validated AncFlow using two well-characterized protein families: acyltransferases and dehydrogenases. The pipeline successfully reconstructed ancestral sequences for multiple internal nodes of the phylogenetic trees, and their predicted structures were compared with those of extant proteins. By analyzing the structural similarities and differences between ancestral and extant proteins, we gained insights into the evolutionary mechanisms underpinning the functional diversification within these families. AncFlow demonstrates the potential of integrating ASR and structural prediction to unravel the structural basis of functional divergence in protein families. The insights gained from this approach can guide protein engineering efforts, facilitating the design of proteins with desired functions. As the amount of sequence data continues to grow, AncFlow provides a valuable tool for exploring the evolutionary landscape of proteins and accelerating the discovery of novel protein functions.