Delete Folder

Use this step to delete a folder on the FTP server.

Last published at: March 31st, 2026

ftpDeleteFolder Step

Description:

The Delete Folder workflow step deletes the specified folder from the selected FTP server.

The step supports:

  • Selecting a configured FTP connection.
  • Specifying the FTP folder path to delete.
  • Performing FTP folder cleanup as part of workflow automation.
  • Connecting True and False return paths to subsequent workflow activities.
  • Incorporating FTP folder deletion into file-processing, archival, and cleanup workflows.

 

Inputs

  • ftpConnection – The Select FTP property specifies the configured FTP connection that FlowWright uses to access the FTP server.
  • folderPath – The Path of folder to delete property specifies the location of the folder on the FTP server that should be deleted.
 

 

Returns

  • True – The True return path can be connected to the next workflow activity when the folder deletion operation succeeds.
  • False – The False return path can be used for an alternative workflow path or error-handling logic when the folder deletion operation does not succeed.
 

  

Usage:

The FTPDeleteFolder step is typically placed in workflows that need to remove an FTP folder after its contents or processing lifecycle has been completed.

A typical workflow pattern is:

FTP Processing → Cleanup → FTPDeleteFolder → Continue
For example:
Process FTP Files
       ↓
Complete Processing
       ↓
Delete Folder
       ↓
Continue Workflow
The step can be used for:
  • Removing temporary FTP folders.
  • Cleaning up folders after file processing.
  • Removing completed processing directories.
  • Cleaning up integration folders.
  • Removing temporary export folders.
  • Maintaining FTP folder structures.
  • Performing post-processing cleanup.
  • Handling different cleanup paths based on workflow results.
  • Removing folders that are no longer required.

 

 

To use this step, configure FTP in FlowWright FTP Connections.

 

A sample FTP connection configuration is provided for reference.

 

Typical Workflow Suggestions:

Delete a Temporary FTP Folder

Use FTPDeleteFolder after a workflow has finished using a temporary FTP folder.

Example:

Create Temporary Folder
        ↓
Upload / Process Files
        ↓
Complete Processing
        ↓
FTPDeleteFolder
        ↓
Continue
For example:
Folder:
/temp/order-processing
After processing is complete, the workflow can delete the folder.

 

Clean Up After File Processing

Use the step at the end of an FTP file-processing workflow.

Example:

Get FTP Files
      ↓
Download Files
      ↓
Process Files
      ↓
Archive Results
      ↓
FTPDeleteFolder
This provides a cleanup stage after the workflow completes its required processing.

 

Remove Completed Integration Folders

An integration process may use a dedicated FTP folder for a particular transaction or batch.

Example:

Receive Batch
     ↓
Process Batch
     ↓
Send Data to External System
     ↓
FTPDeleteFolder
     ↓
Complete
For example:
/integration/batch-1045
can be removed after the workflow completes the associated processing.

The workflow's business and operational requirements should define the exact conditions for deleting a folder.

 

Clean Up Temporary Export Folders

Use FTPDeleteFolder after an export workflow has completed.

Example:

Generate Export
      ↓
Create FTP Folder
      ↓
Upload Export Files
      ↓
External Processing
      ↓
FTPDeleteFolder
This can be useful when FTP folders are created specifically for temporary exchange or processing.

 

Delete a Folder After Successful Processing

Connect the cleanup operation after the preceding workflow activities complete successfully.

Example:

Process Folder
      ↓
Validation
      ↓
Successful?
    /       \
  Yes        No
   ↓          ↓
Delete      Error
Folder      Handling
The FTPDeleteFolder step provides True and False return paths that can also be incorporated into subsequent workflow routing.

 

Perform Post-Processing Cleanup

FTPDeleteFolder can serve as a final cleanup step.

Example:

Download Files
      ↓
Process Files
      ↓
Store Results
      ↓
Send Notification
      ↓
FTPDeleteFolder
This pattern keeps the cleanup operation separate from the primary file-processing activities.

 

Clean Up Batch-Specific Folders

Use a dedicated FTP folder for each processing batch, and delete it when the batch is complete.

Example:

/incoming/batch-1001
/incoming/batch-1002
/incoming/batch-1003
A workflow processing batch-1001 could use:
Process Batch
     ↓
Validate Batch
     ↓
Complete Batch
     ↓
Delete /incoming/batch-1001
This can help prevent completed batch folders from accumulating on the FTP server.

 

Remove Empty or No-Longer-Required Folders

FTPDeleteFolder can be used when a workflow determines that a particular FTP folder is no longer required.

Example:

Check Processing Status
         ↓
Folder No Longer Required
         ↓
FTPDeleteFolder
         ↓
Continue
Before using this pattern, verify the FTP server's folder-deletion behavior and the workflow's requirements regarding files that may still exist in the folder.

 

Use Different FTP Connections for Different Environments

The Select FTP property allows the step to use a configured FTP connection.

For example:

Development → Development FTP
Testing     → Test FTP
Production  → Production FTP
When moving a process definition between environments, verify that the selected FTP connection is appropriate for the target environment.

 

Delete Folders After Archiving

Use FTPDeleteFolder after files have been successfully archived or transferred.

Example:

Process Files
     ↓
Archive Files
     ↓
Verify Archive
     ↓
FTPDeleteFolder
     ↓
Complete
Use this pattern when an FTP folder is intended to exist only until its contents have been successfully handled.

 

Handle Folder Deletion Failures

The step provides both True and False return paths, allowing the workflow to route successful and unsuccessful deletion results differently.

Example:

Process Complete
       ↓
FTPDeleteFolder
     /       \
  True       False
   ↓           ↓
Continue    Error Handling
The False path could be connected to workflow activities that record the failure, notify an administrator, or perform another appropriate recovery action.

The supplied XML does not specify the runtime conditions that result in a False return, so verify those conditions against the FlowWright implementation.

 

Use Folder Cleanup as the Final Workflow Stage

For workflows where the FTP folder exists only during processing, FTPDeleteFolder can be the final operational step.

Example:

Start
  ↓
FTP Processing
  ↓
Validate Results
  ↓
Store Results
  ↓
FTPDeleteFolder
  ↓
End
This clearly separates processing from cleanup.

 

Example:

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

  • Create a new definition named “ftpDeleteFolderDef” and open it in designer mode. 
  • Drag an “ftpDeleteFolder” step to the canvas.
  • Connect the dots between the “Start” and “ftpDeleteFolder” 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 FTP folder path. 
  • Click the “ftpDeleteFolder” step to configure its “Required” properties. Provide a name for the step. Select the FTP connection from the drop-down list. Enter the folder path to delete. Click the Save button. Note: Click the "AI Predict" button to have Copilot add new process steps that match your process description. 

 

  • The “Logging” configuration setting is necessary for documentation and for tracking 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 process instance, and execute it. Render the process instance and click the Delete Folder step to view its configured properties. When the workflow reaches the FTPDeleteFolder step, FlowWright uses the configured FTP connection and folder path for the FTP folder deletion operation. The workflow then continues through the configured True or False return path.

 

Tips:

  • Verify the selected FTP connection before executing the workflow.
  • Make sure the FTP connection points to the intended environment.
  • Carefully verify the folder path before using the step.
  • Test folder cleanup in a non-production environment before deployment.
  • Avoid configuring a broad or unintended folder path.
  • Use meaningful workflow configuration and naming conventions for folders being managed.
  • Verify that the target folder is actually intended to be removed before executing the workflow.
  • Consider the contents of the target folder before deletion.
  • Do not assume that the step recursively deletes all files and subfolders unless this behavior has been confirmed in the FlowWright implementation.
  • Do not assume that an empty folder is required unless confirmed by the FlowWright implementation and FTP server behavior.
  • Test the workflow with the target folder containing representative contents.
  • Test the workflow when the specified folder does not exist.
  • Test the workflow when the FTP connection cannot access the target folder.
  • Test the workflow when the FTP server prevents the deletion operation.
  • Consider connecting the False return path to appropriate error-handling logic.
  • Verify the result of the deletion operation before allowing dependent processing to continue.
  • Use the step after successful processing rather than deleting a folder before its contents have been fully handled.
  • When used after archiving, verify that the archive operation has completed before deleting the FTP folder.
  • When using dynamically constructed folder paths, test the resulting paths with realistic workflow data.
  • Use environment-specific FTP connections when deploying the same workflow across development, test, and production environments.
  • Document folders that are automatically removed by workflows.
  • Make sure administrators and support personnel understand the workflow's cleanup behavior.
  • Test the workflow after changes to FTP folder structures or naming conventions.
  • Avoid assuming specific FTP-server behavior for permissions, locked files, recursive deletion, or error handling unless confirmed by the FlowWright implementation and FTP server.
  • Connect the True and False paths according to the required business and operational behavior.

 

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 a newly created or imported workflow, verify:

  • FTP connection is selected.
  • FTP connection is valid for the target environment.
  • Folder path is correct.
  • The folder is the intended folder for deletion.
  • The workflow reaches the cleanup step only after required processing is complete.
  • Any workflow values used to construct the folder path, if applicable, contain the expected values.
  • The True return path is connected appropriately.
  • The False return path is connected to appropriate error handling.
  • Downstream activities do not depend on the deleted folder.
  • Environment-specific FTP configuration has been verified.
  • The Process Definition has been saved before execution.

Click here to download the sample file.