Description:
The Delete Folder workflow step deletes a specified folder from an SFTP server.
The step uses a configured SFTP connection to identify the folder to be deleted by its relative path on the server.
The step supports:
- Deleting a folder from an SFTP server.
- Selecting a configured SFTP connection.
- Specifying the relative path of the folder to delete.
- Returning a success or failure result.
This step can be used for:
- Removing temporary SFTP folders.
- Cleaning up folders after workflow processing.
- Removing obsolete folders.
- Cleaning up folders associated with completed or canceled processes.
- Maintaining SFTP repository structures.
- Automating file-exchange cleanup.
- Removing processing folders after files have been transferred.
- Integrating SFTP folder management into FlowWright workflows.
Inputs
- Select SFTP – The Select SFTP property specifies the configured SFTP connection to use for the folder-deletion operation.
- Folder Path – The Relative path of the folder to delete property specifies the relative path of the folder to be deleted from the SFTP server.
Returns
- True – The True return path represents a successful result from the folder-deletion operation.
- False – The False return path represents an unsuccessful result.
Usage:
The Delete Folder step is typically used when a workflow needs to remove an existing folder from an SFTP server as part of an automated cleanup or file-management process.
The folder path can be supplied as a workflow value, allowing the target folder to be determined dynamically based on information available to the process.
Typical uses include:
- Cleaning up temporary folders.
- Removing folders after successful file processing.
- Removing obsolete folders.
- Cleaning up canceled workflow processes.
- Maintaining SFTP directory structures.
- Removing folders after files have been transferred.
- Automating SFTP repository maintenance.
Because the operation deletes a folder, the workflow should identify and validate the target path carefully before executing the step.

Typical Workflow Suggestions:
Temporary Folder Cleanup
Create a temporary folder during processing and delete it when it is no longer required.
Example:
Create Folder → Process Files → Delete Folder → Complete
This pattern is useful when an SFTP folder is used only for intermediate processing.
Processed Folder Cleanup
Remove a folder after all files within it have been processed.
Example:
Receive Files → Process Files → Validate Results → Delete Folder → Complete
Canceled Process Cleanup
Clean up an SFTP folder when a workflow is canceled.
Example:
Process Cancelled → Delete Folder → Record Cleanup Result
Batch Processing Cleanup
Delete a batch-specific folder after the batch has been successfully processed.
Example:
Receive Batch → Process Files → Validate Batch → Delete Folder → Complete
Repository Maintenance
Use Delete Folder as part of an automated SFTP repository-maintenance workflow.
Example:
Identify Obsolete Folder → Validate → Delete Folder → Log Result
Post-Transfer Cleanup
Remove a temporary source folder after its files have been successfully transferred to another location.
Example:
Process Files → Transfer Files → Validate Transfer → Delete Folder → Complete
Workflow Instance Cleanup
Create an SFTP folder for a workflow instance and remove it after processing.
Example:
Create Folder → Generate Files → Transfer Files → Delete Folder
Customer or Project Cleanup
Remove a customer- or project-specific temporary folder after processing is complete.
Example:
Process Customer Files → Complete Processing → Delete Folder → Notify User
Dynamic Folder Paths
Use the workflow values to determine which SFTP folder to delete.
Example:
Determine Customer → Determine Folder → Delete Folder → Continue
The XML defines the folder path as a required string property, allowing the workflow to dynamically supply the target path.
Failure Handling
Use the False return path to handle an unsuccessful deletion.
Example:
Delete Folder → True → Complete
↳ False → Log Failure / Retry / Notify Administrator
The step explicitly provides True and False return values.
To use this step, configure SFTP in FlowWright's SFTP Connections.

A sample connection configuration is included below for reference.

Example:
Let’s build and execute the “sftpDeleteFolderDef” example.
- Create a new definition called “sftpDeleteFolderDef” and open the definition in designer mode.
- Drag an “sftpDeleteFolder” step to the canvas.
- Connect the dots between the “Start” and “sftpDeleteFolder” 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, additional values are available for configuration.
- Click the “sftpDeleteFolder” step to configure its “Required” properties. Provide a name for the step. Select the “SFTP” connection string from the dropdown. Enter the relative file path of the folder to delete. Click the Save button. Note: Click the "AI Predict" button to have the Copilot 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. When the workflow reaches the Delete Folder step, FlowWright uses the selected SFTP connection to identify the folder at the configured relative path and perform the deletion operation. The workflow then follows the True or False return path according to the result.
Tips:
- Select the correct configured SFTP connection.
- Verify that the selected connection points to the intended SFTP server.
- Ensure that the target folder exists before the step executes.
- Carefully verify the Relative path of the folder to delete.
- Use workflow Variables when the folder path needs to be determined dynamically.
- Ensure that the SFTP connection has sufficient permissions to delete the target folder.
- Confirm that any files or subfolders requiring preservation have been processed before deleting the folder.
- Use the step only after required file transfers, archival, or processing operations have completed.
- Test the operation with representative folders before deploying the workflow.
- Test both the True and False paths.
- Consider adding logging or notification to the False path.
- Consider retry or exception-handling logic when the SFTP server may be temporarily unavailable.
- Avoid hard-coding environment-specific folder paths when deploying workflows across environments.
- Be especially careful when dynamically constructing the folder path; an incorrect path could target an unintended location.
- Use consistent folder-naming conventions so that automated cleanup workflows can identify the correct folders.
- Verify the expected behavior when the target folder contains files or subfolders, as the XML does not specify whether non-empty folders are handled automatically.
- Confirm the deletion behavior in the target SFTP environment before using the step in a production cleanup process.
Notes:
The Delete Folder step is defined in the SFTP category with the internal name sftpdeletefolder, label Delete folder in SFTP server, and display name Delete Folder.
The step is implemented by FlowWright.Workflow.SFTPDeleteFolder in FlowWright.Workflow.dll and is a Process step with 2 incoming connections and 2 outgoing connections.
The XML defines two configurable properties, both of which are marked as required.
The Select SFTP property uses the ClsSFTPConnections data type, implemented by FlowWright.DataTypes.ClsSFTPConnections.
The folderPath property uses the standard string data type, implemented by FlowWright.DataTypes.ClsTextBox.
The step provides two predefined return values: False and True.
Definition Sample:
You may download the sample definition(s) from the link provided and import them into your FlowWright Process Definition.
Note: Verify and complete any missing configuration after importing the sample, including:
- SFTP connection
- Folder relative path
- Environment-specific SFTP settings
- Downstream True and False workflow paths
Because this is a deletion operation, carefully verify the folder path before executing the imported definition.
Also verify the target SFTP server's behavior when the folder contains files or subfolders, as this is not specified in the XML.
After verifying the configuration, save the Process Definition before execution.