Skip to main content
Tested · October 2026
Built and run by the FlowX docs team on a live FlowX environment. The workflow ran end to end: a Script node's output was mapped into the Template Filling node, the PDF was generated with the mapped values, and the download URL returned the file with a token and rejected the request without one.
This guide answers three questions about generating a document in an integration workflow:
  1. How do I pass a Script node’s output into the Template Filling node?
  2. Why does the Template Filling node show no mapping options?
  3. How do I build the download URL for the generated document?
The first two questions apply to the Template Filling node, which is available on SaaS. The download URL section applies to every deployment, including self-hosted FlowX.AI 5.9.x and 5.1.x.
Prerequisites: a project with an integration workflow, and a document template in the project’s Document templates. For creating and editing templates, see Managing templates.

How do I pass a Script node’s output into the Template Filling node?

SaaS · 5.10
Available on SaaS with FlowX.AI 5.10. This feature is live on managed (SaaS) deployments now. Self-hosted deployments will receive it with the next LTS release family.
A Script node’s output is merged into the root of the workflow data, with no prefix for the node name. A key the script writes as output.customer is available to every later node as customer, and its fields as customer.fullName. The Template Filling node reads its template values from that workflow data.
1

Write the values from the Script node

Assign each value the template needs to a key on output:
Later nodes reference these values as ${customer.fullName} and ${customer.contractNumber}. For the expression rules, see Referencing workflow data in node configurations.
2

Declare the keys in the workflow data model

The data mapper in the Template Filling node lists the attributes of the workflow’s Data Model as its source, and a key the Script node writes isn’t offered until it’s declared there. Add the keys to the workflow data model with the same names and nesting (in this example, a customer object with fullName and contractNumber). See Workflow data models.
You can also declare a key from inside the mapper. In a template field, type the path, for example ${customer.fullName}, click Add new attribute, and save the Attribute Settings. The attribute is added to the workflow data model when you save the mapping.
3

Define the template's input parameters

The mapper fills only the template attributes selected as input parameters. Open the document template and:
  1. On the Data Model tab, add an attribute for each value, for example fullName and contractNumber of type string.
  2. On the Input Parameters tab, click Define parameters, select the attributes, and click Done.
In the template markup, insert each value with a Thymeleaf th:text attribute:
A bare ${fullName} outside a th: attribute is printed as is in the generated document.
Template Input Parameters tab listing contractNumber and fullName as string input parameters
4

Add and configure the Template Filling node

Add Template Filling from the node palette after the Script node and set:
  • Template: the document template to fill, from this project or one of its library dependencies
  • Language: the template language
  • Document Tag: the tag stored with the generated file, for example ContractTemplate
  • Document format: PDF (default) or DOCX
  • Response Key: the key that holds the generated file’s details, for example generatedContract
Template, Language, Document Tag, and Response Key are required.
5

Map the workflow attributes onto the template

Under Input Mapping, click the wrench icon (Configure mapping) on the Template Input card. In the Input Mapping window:
  1. In the workflow panel on the left, click Define parameters, select the workflow attributes to map (for example customer), and click Done.
  2. In the field next to each template attribute, type ${customer. and pick the suggested path, for example ${customer.fullName}.
  3. Optionally, click Test to see the mapped output under Preview results.
  4. Click Save.
Input Mapping window with customer.fullName and customer.contractNumber mapped onto the fullName and contractNumber template attributes
The Template Input card then shows how many attributes are mapped, for example 2 mapped.
Template Filling node after the Script node, with the Template Input card showing 2 mapped

Template Filling nodes created before data mapping

SaaS · 5.13
Available on SaaS with FlowX.AI 5.13. This feature is live on managed (SaaS) deployments now. Self-hosted deployments will receive it with the next LTS release family.
Data mapping arrived in FlowX.AI 5.13. Template Filling nodes created before then show an Enable data mapping toggle:
  • On: the node uses the data mapper (Configure mapping on the Template Input card). Values typed by hand are ignored.
  • Off: under Template Variables, click Configure Variables and enter a value for each template variable, either fixed text or an expression such as ${customer.fullName}.
New nodes always use the mapper and don’t show the toggle.

Why does the Template Filling node show no mapping options?

SaaS · 5.10
Available on SaaS with FlowX.AI 5.10. This feature is live on managed (SaaS) deployments now. Self-hosted deployments will receive it with the next LTS release family.
The mapper needs a selected template whose data model has input attributes. Find the message or symptom you see in the table below: For the template data model and the Input Parameters tab, see Managing templates.

How do I build the download URL for the generated document?

All Deployments The download URL is the Documents plugin base URL followed by the downloadPath the plugin returns:
downloadPath is relative, for example internal/files/{fileId}/download, so the complete URL has the form https://{your-flowx-api-host}/document/internal/files/{fileId}/download. The /document prefix is the route the Documents plugin is exposed on, as listed in the ingress service route reference. Keep the trailing slash after document, because downloadPath doesn’t start with one.

What does the Template Filling node return?

SaaS · 5.10
Available on SaaS with FlowX.AI 5.10. This feature is live on managed (SaaS) deployments now. Self-hosted deployments will receive it with the next LTS release family.
The node stores the Documents plugin response under its Response Key. With the response key generatedContract, the workflow data contains:
customId holds the Folder value, and is null when Folder is empty. The response also carries minioPath, which is deprecated: use filePath instead. filePath is the object path in file storage, not a URL. If generation fails, the node run fails. The Documents plugin error is returned under the response key, or, when the node can’t reach the plugin, the output holds an error message and an errorType.

Build the URL in the workflow

SaaS · 5.10
Available on SaaS with FlowX.AI 5.10. This feature is live on managed (SaaS) deployments now. Self-hosted deployments will receive it with the next LTS release family.
Add a Script node after the Template Filling node and prefix downloadPath:
Return contractUrl in the End node output, then map it into process data in the process that started the workflow. For the round trip from process to workflow and back, see Call an external API from a process.

Build the URL in a process

On self-hosted FlowX.AI 5.9.x and 5.1.x, you generate documents from a process through the Documents plugin, and the reply carries the same downloadPath. Build the complete URL in a business rule:
On SaaS with FlowX.AI 5.13, File Preview doesn’t need the complete URL: set its Source to Document Plugin Path and point it at downloadPath directly. See File sources in FlowX.AI 5.13.
The download endpoint requires authentication. The FlowX renderer recognizes a Documents plugin download by the URL ending in download, which is how downloadPath ends, and fetches it with the user’s token. A plain browser link to the same URL has no token and is rejected. For linking to a stored file from a File download component, see File download.

Template Filling node

Every field of the Template Filling node.

Script node

How Script node output merges into workflow data.

Managing templates

Create document templates and define their data model.

Generating documents

Generate documents from a process through the Documents plugin.
Last modified on October 19, 2026