How to Build Automated Document Workflows Using a Document Generation API