Read TXT File

Use this step to read from a text file.

Last published at: March 31st, 2026

readFile Step

Description:

The Read TXT File step enables a FlowWright workflow to read the contents of an existing plain text file and store the retrieved text in a workflow variable or global variable.

Many business processes rely on text files to store configuration settings, application logs, data exports, templates, or integration payloads. This step provides a simple way to import that information into a FlowWright workflow without requiring custom code.

The workflow specifies the text file location and identifies the workflow variable or global variable that will receive the file contents. Once loaded, the text can be parsed, validated, transformed, included in notifications, submitted to external services, or used in downstream workflow activities.

Typical uses include:

  • Reading application configuration files
  • Importing text-based business data
  • Loading report templates
  • Reading audit or diagnostic logs
  • Processing exported data files
  • Importing REST payloads stored as text
  • Reading scripts or command files
  • Loading workflow instructions from external files

This step simplifies text file integration and enables workflows to consume external information stored in plain text format.

 

Inputs

  • Input File Path – Specifies the full path of the text file to read. The value is supplied through a workflow variable or global variable.
  • Variable/Global that Holds the Content - Specifies the workflow variable or global variable that will receive the contents of the text file after it has been successfully read.
 

 

Returns

  • True – The text file was successfully read, and its contents were stored in the configured workflow variable or global variable. Workflow execution continues through the success path.
  • False – The text file could not be read because of an invalid file path, missing file, insufficient permissions, inaccessible storage location, or another execution error. Workflow execution follows the alternate path.
 

 

Usage:

The Read TXT File step is typically placed near the beginning of a workflow whenever external text data is required before additional processing can occur.

During execution:

  1. Read the configured input file path.
  2. Verify that the text file exists and is accessible.
  3. Open the text file.
  4. Read the file contents.
  5. Store the retrieved text in the configured workflow variable or global variable.
  6. Continue workflow execution through either the True or False return path.

A typical workflow might look like this:

 

Typical workflow scenarios include:

  • Reading configuration values before executing business logic
  • Loading email templates from external files
  • Importing integration payloads
  • Reading exported reports for processing
  • Loading command or script files
  • Reading application log files for analysis
  • Importing text generated by external applications

 

Example:

Let’s build and execute the “readTxtFileDef” example.  

  • Create a new definition called “readTxtFileDef” and open the definition in designer mode. 
  • Drag a “readFile” step to the canvas. 
  • Connect the dots between the “Start” and “readFile” steps, as shown above. 
  • Define a variable or a global to store the result.  
  • Click the “readFile” step to configure its “Required” properties. Provide a name for the step. Provide the path to the input file containing text content. Provide a variable or a global to store the text content. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description. 

 

  • The “Logging” configuration is necessary for documentation and also measures workflow progress and percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

 

  • Save the process definition, create a new instance, and execute it. Render the process instance. Click the process step to view its properties. The step should read the file contents into a variable or global.

 

Tips:

  • Store file paths in workflow variables or environment variables to simplify deployment across environments.
  • Validate that the source file exists before attempting to read it.
  • Use descriptive variable names for imported text content.
  • Validate or parse imported content before using it in workflow logic.
  • Route the False path to logging and notification steps to simplify troubleshooting.
  • Combine this step with Writes Content to TXT File, REST Call, Decision, Send Email, Update Variable Values, or document-processing steps to build complete text-processing workflows.

 

Notes:

  • Both configuration properties are required.
  • The step reads plain text from the specified file.
  • The file contents are stored in the configured workflow variable or global variable.
  • The source text file is not modified during execution.
  • Both the True and False return paths should be implemented to provide complete workflow handling.
  • Ensure that the FlowWright application has read permission for the specified file.
  • File access and execution details are recorded in the FlowWright workflow execution log.

 

Read TXT File vs. Writes Content to TXT File:

Although both steps operate on plain text files, they perform opposite functions.

Read TXT File Writes Content to TXT File
Reads the contents of a text file into a workflow variable or global variable. Writes workflow variable or global variable content to a text file.
Accepts an input file path and a destination variable. Accepts workflow content and an output file path.
Imports text from the file system into the workflow. Exports workflow-generated text to the file system.
Used before parsing, validation, or business processing. Used after generating reports, logs, or integration data.
Requires Input File Path and Variable/Global that Holds the Content. Requires Variable/Global that Holds the Content and Variable/Global that Holds the Output File Path.

As a general guideline:

  • Use Read TXT File when a workflow needs to retrieve text from an external file for processing, validation, or integration.
  • Use Writes Content to TXT File when a workflow needs to persist generated text to the file system for reporting, logging, archival, or data exchange.

 

Definition Sample:

You may download the sample workflow definition from the link provided and import it into your FlowWright environment.

Note: Verify and complete any missing configuration after importing the sample, including:

  • Input file path
  • Destination workflow variable or global variable
  • Success and failure workflow branches
  • Validation that the source file exists and is accessible

After verifying the configuration, save and publish the workflow before execution.

Click here to download the sample file.