Contains in the File

Use this step to verify the search item is contained in the file contents.

Last published at: September 5th, 2025

containsInFile Step

Description:

The Contains in File workflow step searches a specified file for a configured list of search terms and stores the matched search terms in a specified Variable or Global variable.

The step supports:

  • Specifying the file to search.
  • Defining multiple search terms.
  • Processing a multiline list of search terms.
  • Storing the list of matched search terms in a Variable or Global variable.
  • Using the search result to control subsequent workflow processing.
  • Branching the workflow using Found or NotFound return paths.

 

Inputs

  • inputFilePath - The inputFilePath property specifies the file that should be searched.
  • searchTerms - The searchTerms property specifies the search terms that should be evaluated against the file contents.
  • variableToStoreValue - The variableToStoreValue property specifies the Variable or Global variable in which the matched search terms should be stored.
 

 

Returns

  • Found – The workflow follows this path when matching search terms are found in the file.
  • Not Found – The workflow follows this path when the configured search terms are not found.
 

 

Usage:

The Contains in File step is typically placed after a workflow has identified or generated a file whose contents need to be evaluated.

The workflow supplies the file path and search terms. The step searches the file and stores the list of matched search terms in the configured Variable or Global variable.

A typical workflow pattern is:

Get File → Contains in File → Process Result

The resulting matched-term information can then be used by later workflow steps to:

  • Route the workflow.
  • Identify specific content in a file.
  • Detect keywords or status values.
  • Trigger notifications.
  • Perform conditional processing.
  • Classify or categorize file contents.
  • Pass matched terms to another workflow activity.
  • Perform additional file processing.

 

 

Typical Workflow Suggestions:

Check a File for Approval Status

Use Contains in File to determine whether a file contains approval-related terms.

Example:

Get Document
     ↓
Contains in File
   ↙         ↘
Found      NotFound
  ↓            ↓
Approved    Review
Process     Process
List of search terms:
Approved
Rejected
Pending
The matched search terms can be stored in a Variable or Global variable for subsequent processing.

 

Identify Error Terms in a Log File

Use the step to search a log file for configured error-related terms.

Example:

Get Log File
     ↓
Contains in File
   ↙         ↘
Found      NotFound
  ↓            ↓
Handle      Continue
Error       Process
List of search terms:
Error
Exception
Failure
Critical
The workflow can use the Found path when one or more configured terms are detected.

 

Search a Report for Specific Keywords

Use Contains in File to identify configured keywords in a generated report.

Example:

Generate Report
      ↓
Contains in File
      ↓
Process Results
List of search terms:
Revenue
Variance
Exception
Overdue
You can store the matched search terms for use in subsequent workflow activities.

 

Validate File Content

Use the step to check whether expected terms are present in a file before continuing.

Example:

Receive File
     ↓
Contains in File
   ↙         ↘
Found      NotFound
  ↓            ↓
Continue     Validation
Process      Handling
This can provide a content-based decision point before additional processing.

 

Check Customer Documents

Use Contains in File to search a customer document for configured terms.

Example:

Retrieve Customer Document
          ↓
    Contains in File
       ↙          ↘
    Found       NotFound
      ↓             ↓
Document         Manual
Processing       Review
List of search terms:
Customer
Contract
Agreement
Signature
The matched terms can be retained in the configured Variable or Global variable.

 

Search an Incoming Text File

Use the step when a workflow receives a text-based file that needs to be inspected.

Example:

Receive Text File
       ↓
Contains in File
       ↓
Process Result
For example, the search list could contain:
START
SUCCESS
WARNING
ERROR
The result can then determine the next workflow activity.

 

Detect Keywords in an Integration File

Use Contains in File after receiving a file from an external integration.

Example:

Receive Integration File
          ↓
    Contains in File
       ↙          ↘
    Found       NotFound
      ↓             ↓
Integration      Exception
Process          Handling
This can provide a content-based routing point before additional integration processing.

 

Search for Multiple Terms

The List of search terms property uses a multiline text box, making it suitable for maintaining multiple search terms.

For example:

Invoice
Payment
Overdue
Disputed
The configured list can be used to identify which of these terms are present in the file.

The step also provides a Variable/Global specifically for storing the list of matched search terms.

 

Store Matched Terms for Later Processing

Use the result Variable or Global when subsequent workflow steps need to know which search terms were found.

Example:

Contains in File
       ↓
Store Matched Terms
       ↓
Evaluate / Notify / Route
For example:
MatchedTerms
    ↓
"Error, Warning"
The exact runtime representation of multiple matched terms should be confirmed against the FlowWright implementation.

 

Generate a Notification Based on File Contents

Use the Found path to trigger a notification when configured content is detected.

Example:

Read File
    ↓
Contains in File
    ↓ Found
Send Notification
List of search terms:
Urgent
Critical
Escalation
The stored matched terms can provide additional context for downstream processing.

 

Route Documents Based on Content

Use the step as a content-based routing point.

Example:

Retrieve Document
       ↓
Contains in File
       ↓
   ┌───┴────┐
 Found    NotFound
   ↓          ↓
Special     Standard
Process     Process
The search terms can represent content categories relevant to the workflow.

 

Search Generated Reports

Use Contains in File after a report has been generated and saved to a file.

Example:

Generate Report
      ↓
Contains in File
      ↓
Evaluate Results
For example:
Variance
Exception
Threshold
Overdue
can be configured as search terms.

 

Check Files Before Archiving

Use Contains in File as a validation step before moving to an archival process.

Example:

Prepare File
    ↓
Contains in File
   ↙        ↘
Found     NotFound
  ↓           ↓
Archive    Review
This allows the workflow to make a content-based decision before continuing.

 

Handle the NotFound Path

Use NotFound when the workflow needs a specific path for files that do not contain any configured search terms.

Example:

Contains in File
   ├── Found → Process Matching File
   │
   └── NotFound → Handle No Match
The NotFound path can be connected to logging, notification, manual review, or alternate processing.

 

Example:

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

  • Create a new definition named “containsInFileDef” and open it in designer mode.
  • Drag a "containsInFile" step to the canvas. 
  • Connect the dots between the “Start” and "containsInFile" steps, as shown above. 
  • Select the line between the steps to configure the “Connection Properties”. The default property values are “None, True, False, Error, and Evaluate”. Depending on the step’s purpose, you can configure additional values.
  • Define a variable or a global to store the result.
  • Click the "containsInFile" step to configure its “Required” properties. Provide a name for the step. Provide the file path. Provide a list of search items, each on a new line. Provide a variable or a global to store the result. Click the Save button. Note: Click the "AI Predict" button for 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. Configure the step state and percent fields individually, as shown below. Configure the “Logging” using the following properties.

 

  • Save the process definition, create a new instance, and execute it. Render the process instance and click the process step to view its properties. When the workflow reaches the Contains in File step, verify that:
    • The source file path is correctly supplied.
    • The search-term list is correctly configured.
    • The matched search terms are stored in the configured Variable or Global.
    • The workflow follows the expected Found or NotFound path.
    • The subsequent workflow activity executes as expected.

 

Tips:

  • Provide a valid file path.
  • Provide the required List of search terms.
  • Provide a Variable or Global for Variable/Global to store the list of matched search terms.
  • Use separate lines to organize multiple search terms.
  • Use meaningful search terms that clearly represent the condition being evaluated.
  • Use Variables or Globals when the file path is generated dynamically.
  • Use Variables or Globals when search values need to be constructed dynamically.
  • Test the search terms with representative files before deploying the workflow.
  • Test both the Found and NotFound workflow paths.
  • Verify the stored matched-term value before using it in downstream activities.
  • Use a meaningful Variable or Global name such as MatchedSearchTerms.
  • Keep commonly used search-term lists consistent across workflows.
  • Review search terms when the structure or terminology of the source files changes.
  • Test files containing multiple matching terms.
  • Test files containing none of the configured search terms.
  • Test files containing unexpected or incomplete content.
  • Test empty or unexpected file content where applicable.
  • Verify that the input file is accessible to the FlowWright execution environment.
  • Consider connecting the NotFound path to appropriate alternate processing or notification.
  • Keep search terms maintainable when the workflow evolves.
  • Test the workflow after changing the search-term list.
  • When processing user-supplied files, test unexpected characters and formatting.
  • Do not assume matching behavior such as case sensitivity, exact versus partial matching, regular-expression support, or search ordering unless confirmed by the FlowWright implementation.
  • Do not assume the exact format of the stored matched-term list unless confirmed by the FlowWright implementation.
  • Avoid exposing sensitive file contents or search results unnecessarily through workflow logging.

 

Definition Sample:

You may download the sample definition(s) from the link provided and later import them (drag-and-drop) into your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.

Before executing the imported definition, verify:

  • Path for the file
  • List of search terms
  • Variable/Global to store the list of matched search terms
  • Workflow Variable references
  • Environment-specific file paths
  • Downstream Found workflow path
  • Downstream NotFound workflow path
  • Representative input files
  • Expected search terms
  • The Variable or Global used to store matched terms

After verifying the configuration, save the Process Definition before execution.

Click here to download the sample file.