Integration Help with guide to fill a templet on drobox from ERPNext Document workflow

integration Help with guide to fill a templet on drobox from ERPNext Document workflow
i want to fill my templates in drop box when a workflow action taken Approved
a template filled as per specific fields from frappe or ERPNext , using jinja or any method and send a document for sign don from erpnext as per action taken
there deferent templates with ids each template id will have deferent condition

how i can setup and design to integrate and make to fill from workflow action event