QANode Logo

Generate File Node

The Generate File node creates files inside a QANode execution. It can generate TXT, JSON, CSV, Excel, or PDF files from content entered in the panel or produced by expressions from previous nodes.


Overview

PropertyValue
Typefile-generate
CategoryFiles
Color🟤 Gold (#C89F65)
Inputin
Outputout

When to Use

Use this node when the flow needs to:

  • create CSV or Excel test data;
  • generate JSON to send to an API;
  • build a helper TXT file;
  • create a simple PDF for attachment, download, or validation;
  • produce a file that will be used by HTTP Request, Smart Web Flow, Mobile Flow, SSH, a component, or Custom JavaScript.

Configuration

FieldTypeDescription
File typeselectionTXT, JSON, CSV, Excel, or PDF
File nametextFinal file name, including extension

The remaining fields change according to the selected type.

TXT

FieldDescription
ContentFile text. Accepts {{ }} expressions

JSON

FieldDescription
JSONValid JSON object or array

CSV

FieldDescription
ModeManual rows or from list
ColumnsColumn names
RowsValues for each row when using manual mode
ListArray from another node when using list mode
MappingItem field used for each column

Excel

FieldDescription
Sheet nameWorksheet name inside the file
ModeManual rows or from list
Columns / Rows / ListSame logic as CSV

PDF

FieldDescription
TitleOptional title shown in the PDF
ContentText or JSON to render in the PDF

Manual Table and From List

For CSV and Excel, there are two main ways to build the table.

Manual rows

Use this when the data is small or fixed.

Columns: id, name, email
Row 1: 1, Maria, maria@company.com
Row 2: 2, John, john@company.com

From list

Use this when the data already comes from an API, database, component, or previous node.

List: {{ steps["query"].outputs.rows }}
Columns: id, name, email
Mappings: id, name, email

If the list contains objects, QANode can infer common columns, but in shared flows it is better to define the columns explicitly.


Outputs

OutputTypeDescription
fileReffileRefReference to the generated file
namestringFile name
mimeTypestringFile MIME type
sizeBytesnumberSize in bytes

Accessing Outputs

{{ steps["file-generate"].outputs.fileRef }}
{{ steps["file-generate"].outputs.name }}
{{ steps["file-generate"].outputs.mimeType }}
{{ steps["file-generate"].outputs.sizeBytes }}

Use fileRef to pass the file to other nodes. The other fields are useful for logs, validations, and messages.


Example: Generate Test Data CSV

File type: CSV
File name: customers.csv
Mode: From list
List: {{ steps["query-customers"].outputs.rows }}
Columns:
  - id
  - name
  - email

Then the file can be used with:

{{ steps["file-generate"].outputs.fileRef }}

Tips

  • Include the extension in the file name: .txt, .json, .csv, .xlsx, or .pdf.
  • For CSV and Excel, prefer From list when the source data is already an array.
  • Use clear names, such as customer-data.csv or order-report.pdf.
  • To upload a file to an API or web page, always pass the fileRef, not the text content.