copyFile Step

Use this feature to copy a specified file from one directory to another and optionally store the path of the copied file in a FlowWright Variable or Global variable.

Last published at: September 28th, 2026

Description:

The Copy File workflow step copies a file from a specified source path to a destination directory. The step can also store the path of the new file in a specified Variable or Global variable.

The step supports:

  • Specifying the file to be copied.
  • Specifying the destination directory.
  • Using workflow values to construct source and destination paths.
  • Storing the new file path in a Variable or Global variable.
  • Using the copied file in subsequent workflow activities.
  • Creating archive or backup copies of files.
  • Returning a True or False result for subsequent workflow processing.

 

Inputs

  • filePath – The filePath property specifies the path of the source file that should be copied.
  • copyToDirectory – The copyToDirectory property specifies the destination directory where the file should be copied.
  • newFilePathVarGlobal – The newFilePathVarGlobal property specifies the Variable or Global variable in which the path of the copied file should be stored.
 

 

Returns

  • True – The True return path can be connected to the next workflow activity after the file-copy operation.
  • False – The False return path can be connected to an alternative or error-handling workflow path.
 

 

Usage:

The Copy File step is typically placed after a workflow has identified or generated a file that needs to be copied to another directory.

The source file can be a workflow-generated file, an existing file, or a file whose path has been obtained from another workflow activity.

A typical workflow pattern is:

Get/Build File Path → Copy File → Use Copied File

The copied file can then be used by later workflow steps to:

  • Archive a document.
  • Create a backup copy.
  • Place a file in an integration directory.
  • Distribute a file to another directory.
  • Process the copied file.
  • Store and reuse the new file path.
  • Perform additional file-system processing.

 

 

Typical Workflow Suggestions:

Copy a File to an Archive Directory

Use the Copy File step to create a copy of a document in an archive directory.

Example:

Completed Document → Copy File → Archive Directory
For example:
C:\Documents\Invoice.pdf
            ↓
        Copy File
            ↓
C:\Archive\Invoice.pdf
This allows the workflow to create an archive copy while retaining the original source file.

 

Create a Backup Copy

Use Copy File to create a backup copy before additional workflow processing.

Example:

Identify File → Copy File → Process Original File
You can configure the destination directory as a backup directory.

For example:

C:\Documents\Contract.docx
            ↓
        Copy File
            ↓
C:\Backup\Contract.docx
 

Copy a Generated File

Use the step after another workflow activity creates or generates a file.

Example:

Generate Document → Copy File → Archive / Distribution
You can supply the generated file path to Path to the file, and the destination to Directory to copy to.

 

Copy a File After Approval

Use Copy File after an approval activity to place an approved document in another directory.

Example:

Submit Document → Approval → Copy File → Approved Documents
You can select the destination directory based on the workflow's processing requirements.

 

Copy a File to an Integration Directory

Use the step to place a copy of a file into a directory used by a downstream integration process.

Example:

Prepare File → Copy File → Integration Directory
The copied file can then be processed by a subsequent workflow activity or another system that uses the destination directory.

 

Create a Working Copy

Use Copy File when subsequent processing should operate on a separate copy of the original file.

Example:

Original File
     ↓
 Copy File
     ↓
Working Directory
     ↓
Process Working Copy
The original source file remains available while the workflow works with the copied file.

 

Store the New File Path

Use Variable/Global to store new file path when later workflow steps need access to the copied file.

Example:

Copy File
    ↓
Store New File Path
    ↓
Process Copied File
For example, the workflow can store the copied file location in:
variable.CopiedFilePath
The XML specifically exposes newFilePathVarGlobal for this purpose.

 

Copy Files to Dynamic Directories

Use workflow Variables or Globals to construct the destination directory dynamically.

Example:

Get Customer Information
          ↓
Build Destination Path
          ↓
Copy File
          ↓
Customer Directory
For example:
Customer = Acme
Destination = C:\Archive\Acme
The Copy File step can then use the resulting directory value.

 

Copy Files Based on Workflow Status

Use workflow logic to determine the destination directory before the Copy File step.

Example:

Evaluate Status
       ↓
  ┌────┴────┐
Approved   Rejected
   ↓          ↓
Copy File   Copy File
   ↓          ↓
Approved   Rejected
Directory  Directory
Separate Copy File steps can be configured for different destination directories.

 

Distribute a File to Multiple Locations

Use multiple Copy File steps when the same source file needs to be copied to different directories.

Example:

              ┌→ Copy File → Archive
Source File ──┼→ Copy File → Integration
              └→ Copy File → Distribution
The same source path can be supplied to each step while each step uses a different destination directory.

 

Prepare a File for Downstream Processing

Use Copy File as an intermediate step before another file-processing activity.

Example:

Retrieve File → Copy File → Process Copied File
The Variable/Global to store the new file path property can be used to make the copied file location available to the next activity.

 

Copy a File and Continue Processing

Use the True/False connections to control what happens after the Copy File operation.

Example:

                 ┌→ Continue Process
Copy File ─ True ─┤
                 └→ Next Activity

Copy File ─ False → Error Handling
This provides a clear workflow path for normal and alternate processing.

 

Maintain an Archive Before Distribution

Use Copy File to create an archive copy before placing the file into another processing location.

Example:

Source File
    ↓
Copy File → Archive
    ↓
Copy File → Distribution Directory
This pattern can be useful when the workflow needs to retain an archive copy before distributing the file.

 

Create a File Copy for a Process Instance

Use process-specific information to determine the destination directory or file location.

Example:

Process Instance
      ↓
Build File Path
      ↓
Copy File
      ↓
Instance-specific Directory
This can be useful when each workflow instance needs its own copy of a document.

 

Example:

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

  • Create a new process definition named “copyFileDef” and open it in designer mode.
  • Drag a “copyFile” step to the canvas. 
  • Connect the dots between the “Start” and “copyFile” 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 new file path value.
  • Click the “copyFile” 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 “copyFile” step to configure its “Optional” properties. Provide the file path information. Provide the destination file path information. Provide a variable or a global to store the file path after execution. Click the Save button. 

 

  • The “Logging” configuration is necessary for documentation and also measures workflow progress and percent complete. Do this by configuring 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 Copy File step, verify that:
    • The configured source file is available.
    • The destination directory is correctly configured.
    • The copied file is available at the destination.
    • The configured Variable or Global contains the new file path, where applicable.
    • The workflow follows the appropriate True or False connection.

 

 

Tips:

  • Provide a valid value for Path to the file.
  • Provide the intended destination in Directory to copy to.
  • Use Variables or Globals when the source path is determined dynamically.
  • Use Variables or Globals when the destination directory changes according to workflow data.
  • Use a meaningful Variable or Global name for the copied file path.
  • Store the new file path when a subsequent workflow step needs to access the copied file.
  • Verify that the source file is available before the Copy File step executes.
  • Verify that the destination directory is appropriate for the workflow.
  • Test the workflow using representative files before deploying it.
  • Test both the True and False workflow paths.
  • Consider connecting the False return path to appropriate error handling.
  • Use descriptive destination directories to make archive and integration workflows easier to understand.
  • Avoid unnecessary hard-coded environment-specific paths when the workflow is intended for multiple environments.
  • Use environment-specific Variables or Globals when development, test, and production environments use different file-system locations.
  • When copying files for integration, verify that the destination directory is the directory expected by the downstream system.
  • When using the copied file in later activities, verify the stored file path before passing it to the next step.
  • Test scenarios involving an unavailable source file.
  • Test scenarios involving an unavailable destination directory.
  • Test file-system permissions for the FlowWright execution environment.
  • Test behavior when a file with the relevant name already exists in the destination.
  • Do not assume overwrite, replacement, automatic directory creation, or permission-handling behavior unless confirmed by the FlowWright implementation.
  • Keep file paths maintainable when the workflow is deployed across different environments.
  • Avoid exposing sensitive file paths or file contents unnecessarily in 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.

Note: After the import, verify and complete any missing configurations, such as file path references and database connections. Then, save the definition to confirm the changes.

Click here to download the sample file.