This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/workflow-automation/admin-guide/processes/tasks/standard-task/premium-add-on-task-document-generation.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Document Generation with Nutrient Workflow Automation

Nutrient Document Engine powers the Document Generation task, which creates PDF and DOCX files from request data. The task uses a DOCX file template that contains placeholders.

Prerequisites

Before using the Document Generation task, ensure you have:

  • Access to Nutrient Document Engine
  • Administrative permissions to configure tasks in your workflow process
  • A DOCX editor (such as Microsoft Word) to create templates

Document Generation task configuration interface showing general settings and mapping options

Advantages of using Document Generation

Document Generation offers several advantages over using the traditional PDF Generator task:

  • Integrated template authoring — Create and edit templates in the workflow interface with the built-in Document Authoring editor, without external software.
  • Simplified template creation — Design templates in the integrated document editor or any editor that saves DOCX files. Fillable PDFs often require specialized third-party software, so this approach avoids that complexity.
  • Version management — Use built-in version control to maintain multiple template versions, track changes, and switch between them.
  • Grid mapping — Map entire grid data sets into your documents, a capability the traditional PDF Generator task doesn’t have.
  • Enhanced multioption question handling — This task provides more flexible ways to represent multioption questions within your documents.
  • Support for multiple output formats — Generate documents as PDF or DOCX files, depending on your needs.

How to generate a document

  1. Create a DOCX template with placeholders. You can create templates in two ways:

    Option 1: Using the built-in Document Authoring editor

    • When adding a new Document Generation task or when no template exists, click the Create Document chip with the edit icon.
    • Clicking the chip opens the integrated Document Authoring editor with a default welcome message.
    • Use the document editor to design your template directly within the workflow interface.
    • Add placeholders as needed using the delimiter syntax described below.

    Option 2: Using external editors

    • Design your template using any editor that can save DOCX files (e.g. Microsoft Word).
    • Upload the completed template file to the task configuration.

DOCX template example showing placeholders for dynamic data insertion

Template placeholder guidelines

  • Use placeholders, unique identifiers wrapped in delimiters, to mark where the task inserts dynamic data.
  • By default, placeholders use {{ and }}, but you can customize the delimiters.
  • Placeholders must be alphanumeric, contain no spaces, and be unique within the document.

Your template document can contain two types of placeholders:

  • Single placeholders — These represent one-to-one mappings of text-based data, e.g. {{invoice_number}}.
  • Loop placeholder sets — These insert repeating data like grid rows or multioption question answers. Each set has an opening placeholder starting with #, a closing placeholder starting with /, and placeholders in between.

Example:

{{#Loc_array}} {{add_label}} {{add_value}} {{/Loc_array}}

Here, Loc_array is an array of data, and add_label and add_value are fields within each item.

  1. Add the Document Generation task to your process. Select Configuration > Configure Task.

    Process configuration screen with Document Generation task selected

  2. Configure the general settings.

    • Go to the General Settings tab.
    • In the DOCX document template field, either:
      • Click Create Document to create a new template using the built-in editor, or
      • Upload an existing DOCX file template, or
      • If a template already exists, click the edit icon to open it in the Document Authoring editor
    • In the Output Format field, choose PDF or DOCX as your output.
    • Fill in the Start Delimiter and End Delimiter fields.
    • Under Prefills to add to Generated File Name, add the dynamic values to the Name of completed file field. You can add as many prefills as you want. The task adds the .docx or .pdf extension automatically, based on the selected output format.
    • Click Save.

    General Settings tab showing template upload, output format, and delimiter configuration

  3. Map your data fields.

    • Switch to the MAPPINGS tab.
    • The system automatically detects all placeholders from your template.
    • Map each placeholder to the corresponding data source in your system.
  4. Set recipients (optional).

    • After configuring the general settings and mappings, you can assign recipients to the Document Generation task.
    • Recipients can review and make final edits to the generated document before submission.
    • Assign recipients when you want users to verify the content or adjust the document before finalizing.
    • To configure recipients, right-click the task and select Recipients from the menu. Then add the users or groups who should review the generated document.
    • For detailed information on configuring recipients, including static and dynamic recipient options, refer to the recipient configuration guide.

Using the Document Authoring editor

The integrated Document Authoring editor provides a what you see is what you get (WYSIWYG) editing experience within the task configuration. The editor is available when you create new templates or edit existing ones.

Creating and editing templates

  • New templates — Click the edit icon next to Create Document to open the editor.
  • Existing templates — Click the edit icon next to an existing template file to open it in the editor.
  • Document editing — Use the WYSIWYG editor to format text, add placeholders, and design your template with precise layout control.
  • Template variables — Add dynamic placeholders using the configured delimiter syntax (default: {{variable_name}}).

Version management

When working with templates that have multiple versions:

  • Version sidebar — A version history panel appears on the left side of the editor when multiple versions exist.
  • Version selection — Click any version in the sidebar to load and preview it in the editor.
  • Active version indicator — The system shows which version the task currently uses when it runs.
  • Use this version — When viewing a version different from the active one, click Use this version to set it as the active template.

Saving and renaming templates

  • Template naming — Edit the file name in the text field at the top of the editor.
  • Save document — Click Save Document to create a new version with the current file name and content.
  • Version creation — Each save operation creates a new version, preserving the complete history of template changes.
  • Author tracking — Each version records the author and creation timestamp for audit purposes.

Mapping questions

To map text-based questions such as short text, calendar, or search box, map the single placeholders to your data source. The image below shows an example of a text-based question mapping.

Text-based question mapping showing single placeholder mapped to data source

The Mappings tab displays all detected placeholders from your template along with their corresponding data sources.

Mappings tab displaying detected placeholders and their corresponding data sources

To map multioption questions such as checkboxes, radio buttons, or select lists, follow the instructions below.

Checkbox mapping

  1. Map the loop placeholder from your template to the checkbox question in your form. For example, if your template has:

    {{#Loc_array}} {{add_label}} {{add_value}} {{/Loc_array}}

    Map Loc_array to your checkbox question.

    Checkbox question mapping with loop placeholder connected to form checkbox

  2. Choose whether to display All options (both selected and unselected) or Only Selected options in your output. Then click Save.

  3. Click the icon to expand additional settings.

Checkbox mapping settings showing All options vs. Only Selected options configuration

  1. For the placeholders inside the loop:

    • Map add_label to the option label (for example, the checkbox text).
    • Map add_value to the selection status (whether the option is checked).

    Loop placeholder internal mapping showing label and value assignments

  2. Under Represented As, choose how you want the checkbox to appear. Then click Save.

Example

Here’s a checkbox shown with all options vs. only selected options in a checkmark/cross format.

Example output showing checkbox options displayed as checkmarks and crosses

Radio button mapping

  • Mapping a radio button question is similar to a checkbox, but you can only select one option.
  • Use a loop placeholder as you would with a checkbox, but the mapping contains only a single choice.

Radio button mapping configuration showing single selection option

Example

Example output of radio button mapping showing selected option marked

Select list mapping

  • To display the selected value as text, map it using a single placeholder similar to a text-based question.
  • To show graphical representations, define a loop placeholder and map it as in the checkbox or radio button examples.

Select list mapping options showing text display vs. graphical representation

Example

Here’s how a select list is mapped with labels only.

Example select list output displaying only selected option labels

How to map a grid

  1. Create a loop placeholder named items in your DOCX template, enclosing all the columns you want to map. Each placeholder inside corresponds to a grid column. For example:
Qty.Item#DescriptionUnit priceLine total
{{#items}}{{quantity}}{{number}}{{description}}{{price}}{{total}}{{/items}}
  1. Map the items placeholder to the grid question in your form. Then click Save.

    Grid mapping configuration with items placeholder connected to grid question

  2. Map each individual placeholder (quantity, number, description, price, total) to the corresponding grid columns in your form.

    For currency fields like price or total, specify the appropriate currency format.

    Grid column mappings showing individual placeholders assigned to grid columns with currency formatting

To map a footer value such as a total:

  • Add a new parameter for the total.
  • Select the grid question in the Field dropdown.
  • For Which Options, choose Specific Cell.
  • Set Row to footer.
  • Set Column to the column containing the total (for example, Line Total).

Footer total mapping configuration showing specific cell selection for grid totals

Example of a complete grid mapping

Complete grid mapping example showing table structure with all columns and footer mapped

Troubleshooting common issues

  • Template not detected — Ensure your DOCX file is saved in the correct format and placeholders use the specified delimiters.
  • Mapping errors — Verify that placeholder names match exactly (case-sensitive) and contain only alphanumeric characters.
  • Output generation fails — Check that Nutrient Document Engine is properly configured and has sufficient resources.
  • Missing data in output — Confirm that all mapped placeholders correspond to actual data sources in your workflow.
  • Template formatting issues — Avoid complex formatting within placeholder text that might interfere with data insertion.

Attaching generated documents to other tasks

You can attach documents created by the Document Generation task to subsequent tasks in your workflow, including Approval tasks. Approvers can then review the generated document as part of their approval workflow.

To attach a generated document to an Approval task:

  1. Add the Document Generation task before the Approval task in your process flow
  2. In the Approval task configuration, use the attachment settings to reference the output from the Document Generation task
  3. The approver can view the generated document when they receive the approval request

Next steps

After setting up Document Generation:

  • Test your templates with sample data to verify mapping accuracy
  • Configure automated workflows to trigger document generation based on form submissions
  • Set up file storage locations for generated documents
  • Attach generated documents to Approval tasks for review workflows
  • Train your team on template creation recommendations

Conclusion

The Document Generation task automates document creation by generating customized DOCX or PDF files. Use placeholders and advanced mapping options, including grid data and footer totals, to build workflows that produce documents for your business needs.

To add this premium feature to your license or learn more about the Document Generation task, contact our Customer Success team.