Objective. This study aims to develop a fully automatic planning framework for functional lung avoidance radiotherapy (AP-FLART). Approach. The AP-FLART integrates a dosimetric score-based beam angle selection method and a meta-optimization-based plan optimization method, both of which incorporate lung function information to guide dose redirection from high functional lung (HFL) to low functional lung (LFL). It is applicable to both contour-based FLART (cFLART) and voxel-based FLART (vFLART) optimization options. A cohort of 18 lung cancer patient cases underwent planning-CT and SPECT perfusion scans were collected. AP-FLART was applied to generate conventional RT (ConvRT), cFLART, and vFLART plans for all cases. We compared automatic against manual ConvRT plans as well as automatic ConvRT against FLART plans, to evaluate the effectiveness of AP-FLART. Ablation studies were performed to evaluate the contribution of function-guided beam angle selection and plan optimization to dose redirection. Main results. Automatic ConvRT plans generated by AP-FLART exhibited similar quality compared to manual counterparts. Furthermore, compared to automatic ConvRT plans, HFL mean dose, V 20, and V 5 were significantly reduced by 1.13 Gy (p < .001), 2.01% (p < .001), and 6.66% (p < .001) respectively for cFLART plans. Besides, vFLART plans showed a decrease in lung functionally weighted mean dose by 0.64 Gy (p < .01), fV 20 by 0.90% (p = 0.099), and fV 5 by 5.07% (p < .01) respectively. Though inferior conformity was observed, all dose constraints were well satisfied. The ablation study results indicated that both function-guided beam angle selection and plan optimization significantly contributed to dose redirection. Significance. AP-FLART can effectively redirect doses from HFL to LFL without severely degrading conventional dose metrics, producing high-quality FLART plans. It has the potential to advance the research and clinical application of FLART by providing labor-free, consistent, and high-quality plans.