What is the Generate Document Node?
Yeeflow's Generate Document node is primarily used to automatically generate documents like contracts, reports, and invoices within a workflow. This node automatically populates pre-defined Word or PDF templates with form data or variable data from the workflow, creating documents in a standard format, which are then stored in process variables for further use or viewing within the workflow.
Main Features and Business Scenarios of the Generate Document Node in Yeeflow:
Template Configuration: Yeeflow supports customizable Word or PDF document templates. Administrators can define the content, format, and style of templates in the backend, and set placeholders or variables to be filled in the document. The templates can be uploaded to the document library, allowing them to be linked with data fields in the workflow to ensure document content is generated automatically in line with requirements.
Dynamic Data Filling: In a workflow, the Generate Document node can automatically fill in form data or process variables into the template, generating Word or PDF documents with dynamic content. For example, in a contract template, the system can automatically populate fields like customer name, contract date, and other details, generating personalized documents in real time based on workflow data.
Automated Document Output: The generated document can be output as a Word or PDF file, and is automatically stored in the process variable for easy access and use at different workflow stages. This supports subsequent approvals, archiving, and viewing.
Support for Various Scenarios: The Generate Document node in Yeeflow is widely used in scenarios such as contract generation, quote creation, invoice issuance, report generation, and notifications, especially for workflows that require standardized document generation.
How to Use the Generate Document Node
In Yeeflow, configuring the Generate Document node involves uploading a document template to the document library and setting up the node in the workflow designer to automatically generate the required documents during workflow execution. Below are the detailed steps:
1. Add a Generate Document Node
To configure the Generate Document node in the workflow designer, follow these steps:
Open the approval form or list workflow and navigate to the workflow designer.
Drag and drop the Generate Document node onto the workflow canvas.
Select the Generate Document node and click the Settings button to open the configuration panel.
2. Configure the Generate Document Node
In the settings panel, complete the following configurations:
Enter Action Name and Description: Input a clear name and description for the node to indicate its purpose.
Choose Generation Type: Select the file type for the generated document:
Original File Type: The output document retains the same type as the template (Word or PDF).
Single PDF File: Combines all template content into a single PDF file.
Add Template Files:
Click +Add Another Template File under Document Template.
Select the Application and Data Source where the template file is stored.
The data source should be a document library containing the template.
How to Upload Template Files to the Document Library:
Open the Document Library component in Yeeflow and select + New File.
Upload your Word or PDF template and ensure placeholders are set up for dynamic data. If you don’t have a template file, refer to the guide on How to Create Word Templates in the Generate Document Node.
Click the path to select the template file. If multiple templates are needed, repeat the process by clicking Add Another Template File.
Adjust the sequence of templates using the Order block or remove unnecessary templates by clicking Delete.
3. Set Variables
Use the Set Variables button to bind placeholders in the template with workflow variables dynamically.
Regular Variable Mapping:
Common variables are used to bind data of non-table types (e.g., text, dates, values).
Click the Set Variables button to open the configuration window.
Select the Document template file from the dropdown list.
3. Map Template Placeholders to Workflow Variables:
Content Control: Displays the placeholder names defined in the template.
Control Type: Indicates the type of placeholder (e.g., Text Box, Date).
Value: Select the matching workflow variable from the dropdown or use the expression editor for dynamic values.
4. Confirm Mapping:
Check the boxes for variables you want to bind.
Click OK to save.
5. For more details, refer to How to Save Workflow Variables to a Word Template.
Table Variable Mapping:
For templates with table structures, placeholders can dynamically populate multi-row sub-list data.
Associate Sub-List Data:
In the variable mapping window, check placeholders of type Table.
From the Value dropdown, select the sub-list control variable in the workflow.
Map Sub-List Fields:
Click Select Fields to open the field mapping window.
Match each column in the table to corresponding sub-list fields by selecting values from the dropdown.
For more details, refer to How to save sub list values to word template.
4. Configure Output Settings
Set Output File Name:
Enter a name for the generated document in the Output File Name field, or use the expression editor for dynamic names.
Choose Save Location:
Open the Save Output File To dropdown and select the file control variable where the document will be stored after generation.
Save to a Document Library (Optional):
To store generated documents in a specific document library, configure a Set Data List node as follows:
Add a Set Data List Node:
Place it after the Generate Document node in the workflow.
Configure the Data Source:
In the settings panel, select the target document library as the data source.
Set Execute Type:
Choose the Add button to save the generated document as a new record.
Map Fields:
Map the field's Name field to a workflow identifier (e.g., Form ID).
Map the Upload File field to the file variable from the Generate Document node.
Save Configuration:
Click OK to complete the setup.
This setup ensures flexibility to save generated documents in a file control or a document library, meeting various business needs.