He automation process generates documents for software development from two source documents: BRD and Coding Convention

Everyone, I have a question: can I build an automated system that can automatically improve and rerun the process if there is an error or need to update the document, or something like that? I said it sounds a bit confusing so I will give an example like this:
Module 1: Google Docs is reading the content of the BRD document
Module 2: using Chatgpt to analyze this BRD document
Module 3: is using the results of module 2 to create an FSD document for example (using chatgpt)
Module 4: also using chatgpt. The task of this module is to check the generated FSD document for consistency and accuracy compared to the original BRD document. If there is an error or something, automatically run module 2 again with a reminder about that error until module 4 is reached, the result shows that there is no error, then continue to the next module.