Description:
The Delete File workflow step deletes a specified file from an SFTP server.
The step uses a configured SFTP connection to identify the file to be deleted by its relative path on the server.
The step supports:
- Deleting a file from an SFTP server.
- Selecting a configured SFTP connection.
- Specifying the relative path of the file to delete.
- Returning a success or failure result.
This step can be used for:
- Removing temporary SFTP files.
- Cleaning up files after successful processing.
- Removing obsolete or unwanted files.
- Cleaning up files after they have been transferred.
- Maintaining SFTP repositories.
- Automating file-exchange cleanup.
- Removing intermediate files created during workflow processing.
- Handling file cleanup as part of an exception or cancellation process.
Inputs
- Select SFTP – Specifies the configured SFTP connection that should be used for the file-deletion operation.
- File Path – The Relative path of the file to delete property specifies the relative path of the file that should be deleted from the SFTP server.
Returns
- True – The True return path represents a successful result from the file-deletion operation.
- False – The False return path represents an unsuccessful result.
Usage:
The Delete File step is typically used when a workflow needs to remove a file from an SFTP server after the file has completed its required processing.
The file path can be supplied as a workflow value, allowing the target file to be determined dynamically based on information available to the process.
Typical uses include:
- Removing temporary files.
- Deleting files after successful processing.
- Cleaning up files after a successful transfer.
- Removing obsolete files.
- Cleaning up files associated with canceled workflows.
- Maintaining SFTP file repositories.
- Removing intermediate processing files.
- Automating post-processing cleanup.
Because the operation deletes a file, the workflow should identify and validate the target path carefully before executing the step.

Typical Workflow Suggestions:
Temporary File Cleanup
Remove an SFTP file after it has been used as an intermediate processing file.
Example:
Get File → Process File → Delete File → Complete
This is useful when files are required only for the duration of a workflow.
Post-Transfer Cleanup
Delete the original SFTP file after successfully transferring it to another location.
Example:
Get File → Transfer File → Validate Transfer → Delete File → Complete
Use the Delete File step only after the workflow has completed the operations that require the source file.
Processed File Cleanup
Remove a file after it has been successfully processed.
Example:
Retrieve File → Process File → Validate Result → Delete File → Complete
File Repository Maintenance
Use Delete File as part of an automated SFTP repository-maintenance workflow.
Example:
Identify Obsolete File → Validate → Delete File → Log Result
Canceled Workflow Cleanup
Delete temporary files when a workflow is canceled or otherwise no longer requires them.
Example:
Process Cancelled → Delete File → Record Cleanup Result
Error or Exception Cleanup
Remove a temporary file after an exception-handling workflow has completed.
Example:
Processing Failure → Cleanup → Delete File → Log Result
Carefully verify that the file is no longer needed before deleting it.
Batch Processing Cleanup
Delete an individual file after it has been successfully processed in a batch.
Example:
Receive File → Process → Validate → Delete File → Next File
Dynamic File Paths
Use a workflow-generated value to determine which file to delete.
Example:
Determine Customer → Determine File Path → Delete File → Continue
The XML defines filePath as a required string property, allowing the target path to be supplied as a string value.
Customer or Project File Cleanup
Remove a customer- or project-specific temporary file after processing.
Example:
Process Customer Data → Generate File → Transfer File → Delete File → Notify User
Failure Handling
Use the False return path to handle an unsuccessful deletion.
Example:
Delete File → True → Complete
↳ False → Log Failure / Retry / Notify Administrator
The step explicitly provides True and False return paths.
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 “sftpDeleteFileDef” example.
- Create a new definition called “sftpDeleteFileDef” and open the definition in designer mode.
- Drag an “sftpDeleteFile” step to the canvas.
- Connect the dots between the “Start” and “sftpDeleteFile” 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 “sftpDeleteFile” 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 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 File step, FlowWright uses the selected SFTP connection and configured relative file path to perform the deletion operation. The workflow then follows the True or False return path according to the result.
Tips:
- Select the correctly configured SFTP connection.
- Verify that the selected connection points to the intended SFTP server.
- Carefully verify the Relative path of the file to delete before executing the step.
- Ensure that the file is no longer required by subsequent workflow activities before deleting it.
- Use workflow Variables when the file path needs to be determined dynamically.
- Ensure that the SFTP connection has sufficient permissions to delete the target file.
- Verify that the file exists before the Delete File step executes.
- Use the step only after required file transfers, archival, or processing operations have completed.
- Test the operation with representative files 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 file paths when deploying workflows across environments.
- Be especially careful when dynamically constructing the file path; an incorrect path could cause an unintended file to be deleted.
- Use consistent file-naming conventions so automated cleanup workflows can identify the correct files.
- If a file is needed by multiple workflow activities, place Delete File only after all dependent activities have completed.
- Confirm deletion behavior in the target SFTP environment before using the step in a production cleanup process.
Notes:
- The Delete File step is defined in the SFTP category with the internal name
sftpdeletefile, label "Delete file" in the SFTP server, and display name "Delete File". - The step is implemented by
FlowWright.Workflow.SFTPDeleteFileinFlowWright.Workflow.dlland 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
ClsSFTPConnectionsdata type, implemented byFlowWright.DataTypes.ClsSFTPConnections. - The filePath property uses the standard
stringdata type, implemented byFlowWright.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
- Relative file path
- Environment-specific SFTP settings
- Downstream True and False workflow paths
Because this is a deletion operation, carefully verify the file path before executing the imported definition.
After verifying the configuration, save the Process Definition before execution.
Click here to download the sample file.