Description:
The Writes Content to TXT File step enables a FlowWright workflow to create or update a plain text file using content stored in a workflow variable or global variable.
Many workflow scenarios require generated content to be persisted outside the workflow. This step retrieves text from a configured workflow variable or global variable and writes it to the specified output file path. The generated file can then be archived, emailed, uploaded to another system, or consumed by external applications.
The step is designed for plain text output and is commonly used for exporting reports, saving process results, generating configuration files, writing audit logs, and exchanging information with third-party applications.
Typical uses include:
- Exporting workflow results
- Generating audit or diagnostic logs
- Creating configuration files
- Saving REST API responses
- Producing text-based reports
- Creating integration payloads
- Exporting application data
- Preparing files for downstream processing
This step provides a simple mechanism for persisting workflow-generated text to the file system without requiring custom scripting.
Inputs
- Variable/Global that Holds the Content - Specifies the workflow variable or global variable containing the text that will be written to the output file.
- Variable/Global that Holds the Output File Path – Specifies the workflow variable or global variable containing the full path and filename of the text file to create or update.
Returns
- True – The text content was successfully written to the specified output file. Workflow execution continues through the success path.
- False – The file could not be written because of an invalid file path, insufficient permissions, inaccessible destination folder, invalid variable values, or another execution error. Workflow execution follows the alternate path.
Usage:
The Writes Content to TXT File step is typically used after workflow data has been generated or collected and needs to be persisted as a text file.
During execution:
- Read the configured workflow variable or global variable containing the text content.
- Read the configured output file path.
- Validate the destination path.
- Write the content to the specified text file.
- Continue workflow execution through either the True or False return path.
A typical workflow might look like this:

Typical workflow scenarios include:
- Exporting workflow execution summaries
- Saving audit information
- Creating text files for external integrations
- Writing configuration files
- Saving REST API responses for later processing
- Generating deployment scripts
- Producing diagnostic output for troubleshooting
Example:
Let’s build and execute the “writeTxtFileDef” example.
- Create a new definition called “writeTxtFileDef” and open the definition in designer mode.
- Drag an “updateVariable, writeFile” step to the canvas.
- Connect the dots between the “Start” and the other steps, as shown above.
- Configure a variable or a global to store the text and the output file path.
- Click the “updateVariable” step to configure its “Required” properties. Provide a name for the step, then click the Save button. Note: Click the "AI Predict" button to have the Copilot add new process steps that match your process description.

- Click the “updateVariable” step to configure its “Optional” properties. Click the button to configure multiple variables and values. Enter the variable and value. Select “No” for “Has Expression” if the variable value is not a C# expression. Click the Save button.

- Click the “writeFile” step to configure its “Settings” properties. Provide a name for the step. Provide the variable or global reference to hold the text content. Provide the variable or global reference for the output file path. 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 write the contents of the variable or global to the specified output TEXT file.

Tips:
- Store output file paths in workflow variables or environment variables to simplify deployment across environments.
- Ensure the destination directory exists before executing the step.
- Use descriptive filenames that include timestamps or process identifiers when generating multiple files.
- Validate the content before writing it to avoid generating incomplete or invalid files.
- Route the False path to logging and notification steps for easier troubleshooting.
- Combine this step with Read TXT File, Send Email, REST Call, Archive Process Instance, ZipFile, or document management steps to build complete file-processing workflows.
Notes:
- Both configuration properties are required.
- The step writes plain text content to the specified output file.
- The text content is obtained directly from the configured workflow variable or global variable.
- The output file location is determined by the configured file path variable or global variable.
- Both the True and False return paths should be implemented to provide complete workflow handling.
- Ensure the FlowWright application has write permission to the destination folder.
- File write operations and execution details are recorded in the FlowWright workflow execution log.
Writes Content to TXT File vs. Read TXT File:
Although both steps work with plain text files, they perform opposite operations.
| Writes Content to TXT File | Read TXT File |
|---|---|
| Writes workflow content to a text file. | Reads the contents of a text file into a workflow variable. |
| Accepts text content and an output file path. | Accepts an input file path and a destination variable for the file contents. |
| Produces a text file on the file system. | Produces text stored in a workflow variable or global variable. |
| Used to export workflow-generated information. | Used to import external text into a workflow. |
| Requires Variable/Global that Holds the Content and Variable/Global that Holds the Output File Path. | Requires Input File Path and Variable/Global that Holds the Content. |
As a general guideline:
- Use Writes Content to TXT File when a workflow needs to persist generated text to the file system for reporting, integration, logging, or archival purposes.
- Use Read TXT File when a workflow needs to retrieve text from an existing file for validation, parsing, configuration, or further business processing.
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:
- Workflow variable or global variable containing the text content
- Workflow variable or global variable containing the output file path
- Success and failure workflow branches
- Validation that the destination folder exists and is writable
After verifying the configuration, save and publish the workflow before execution.