Flow Actions
Doc Generation Flow Actions

Generate Document (Batch)

introduction the cloudfiles generate document (batch) action allows you to automate the generation of multiple documents in a single action within salesforce flow builder it simplifies the process of handling multiple document generation requests, reducing complexity and increasing efficiency for bulk operations unlike the generate document action, which processes a single document at a time, the batch action takes a collection of input configurations and generates multiple documents asynchronously, each based on its respective template and parameters below is how the action looks like detailed descriptions of the input and output parameters are provided in the following section what this action does the generate document (batch) action processes a collection of document generation inputs in a single execution, where each input corresponds to a single document generation request it automates bulk document creation with the same advanced features available in the standard generate document docid\ qfdwhv81mxgwsly7nppsc action each variable in the collection input can specify a unique generate document docid\ qfdwhv81mxgwsly7nppsc action each processed input publishes a document generated docid\ mmtfv4zzddn2tgrwgszbu event, which can be used to trigger additional automations or workflows example use case a sales team needs to generate multiple opportunity documents records in one go when the status is updated to 'closed won' instead of using multiple generate document docid\ qfdwhv81mxgwsly7nppsc flow actions in the flow, a single generate document (batch) action can be used to generate all the documents based on the input paramters input parameters the generate document (batch) action has a single input parameter inputs a collection of apex defined variables of the class cldfs generatedocumentflowinput each cldfs generatedocumentflowinput represents the input configuration for generating one document and contains the same fields as the parameters for the generate document docid\ qfdwhv81mxgwsly7nppsc action cloudfiles variables runtime variables for template placeholders destination where to store the generated document (salesforce or external storage) document type format of the generated document (pdf, docx, pptx, xlsx) record id salesforce record id for pulling data parameters advanced security settings for pdf documents template template id to be used for document generation steps to configure inputs parameters create individual apex defined variables of the cldfs generatedocumentflowinput class for each document populate each variable's fields with the respective configuration values (e g , template id, destination, and record id) as you do for a single generate document docid\ qfdwhv81mxgwsly7nppsc action add all these variables to a collection variable of the same class cldfs generatedocumentflowinput input the collection variable into the action's inputs parameter output parameters the cloudfiles generate document (batch) action operates asynchronously, meaning it does not provide immediate outputs after execution, instead publishes events for each processed input document generated events each document generation request (individual input) publishes a document generated docid\ mmtfv4zzddn2tgrwgszbu event upon successful processing use these events to trigger downstream automations or flows, such as notifications or additional processing error handling if an input fails to process, an error event docid\ f tebe6eetk9zvvqmbe f is published for that specific input these events can be used to identify and handle issues with individual document generation requests