Attach Merged Document back to the Record

Attach Merged Document back to the Record

Hi I have a merge template that I have merge tags from the Deal Module. I want to be able to do 3 things automatically based on updating one field in the Deal:

1) Quickly Create the Merge Document from the Trigger Deal Record.
2) Email that merged document to a specific email address pulled from a field in that deal
3) ATTACH the merged document back to the Deal it was created from

I can do the first 2 steps using Zoho Flow. BUT I have asked Shyam, and there is no way to attach the Merged document back to the record in Zoho Flow since it doesn't support file/attachment transfer.

Can you please help me figure out how to attach the merged document via a custom function? If I need to "Create merged document AND attach to record" in the same step, I am okay recreating the merge document a second time just to attach it to the deal.

How can I accomplish this? I came across this documentation, but wasn't sure how I'm supposed to handle the custom function in this case: https://writer.zohopublic.com/writer/published/h0ub4618980b47caa45baac4dbe14830a8aa0

Please assist.