Sort’a like this, or this I suspect.
I believe you are looking for this exact process leveraging Google Apps Script in G-Suite with Google Docs and Google Drive. I build these all the time where solutions like Integromat and Zapier are unable to meet all of the workflow requirements. But, you may want to give these tools a try first by reading this first.
![image image](/t5/image/serverpage/image-id/1391i32C8EA62C3966654/image-size/large?v=v2&px=999)