/
How to Automate and Create Document Workflow

How to Automate and Create Document Workflow

Create an Invocable Apex Class

Get the variables from the flow

String templateId = <Id of the Document template Record you want to use> String recordId = <Id of the sObject Record on which you want to trigger the document workflow>

Inside The Invocable Class Invoke Generate Document Service

String sResponse= docgen_esign.GlobalServices.generateDocument(templateId,recordId);

Deserialize the sResponse into type Map<String,Object>

Map<String, Object> outputMap = (Map<String, Object>)JSON.deserializeUntyped(sResponse);

Check the status