Description:
The Remove Directory workflow step removes a specified directory from the file system during workflow execution.
The step supports:
- Specifying the directory to remove.
- Supplying the directory name or path as a string value.
- Dynamically determining the directory to remove.
- Performing directory cleanup as part of workflow automation.
- Removing temporary directories after workflow processing.
- Returning a True or False result for subsequent workflow processing.
Inputs
-
Directory to remove – The
directoryNameproperty specifies the directory that should be removed from the file system.
Returns
- True – The True return path can be connected to the next workflow activity when the directory-removal operation produces the expected result.
- False – The False return path can be used for an alternative workflow path or appropriate handling when the expected result is not produced.
Usage:
The Remove Directory step is typically placed after a workflow has finished, using a directory created or used during processing.
The workflow supplies the directory through the Directory to remove property.
A typical workflow pattern is:
Create/Use Directory → Process Files → Remove Directory → Continue Process
This makes the step useful for directory cleanup activities in workflow automation.
The directory name can be supplied as a workflow-generated string, allowing the same process definition to work with different directories during different workflow executions.
Because the operation removes a directory from the file system, ensure the directory is no longer required before the step executes.

Typical Workflow Suggestions:
Remove a Temporary Directory
Use the step to clean up a temporary directory after the workflow has finished using it.
Example:
Create Temporary Directory → Process Files → Remove Directory → Continue Process
The directory path can be supplied to the Directory to Remove property.
Clean Up an Intermediate Directory
Use Remove Directory after the workflow has finished processing files stored in an intermediate directory.
Example:
Create Directory → Generate Files → Process Files → Remove Directory
This provides a clear cleanup stage after the intermediate files have been processed.
Remove a Directory After File Processing
Use the step after all required files in the directory have been processed.
Example:
Retrieve Files → Process Files → Remove Directory → Complete
This can be useful when the directory exists only for the duration of a workflow operation.
Use a Dynamic Directory Path
The directoryName property uses the string data type, allowing the directory to be supplied dynamically.
Example:
Determine Directory → Process Directory → Remove Directory → Continue
This allows the same workflow to operate on different directories for different workflow instances.
Clean Up After an Integration
Use this step when an integration creates or uses a directory to exchange files.
Example:
Create Integration Directory → Generate Files → External Integration → Remove Directory → Complete
This can help clean up an intermediate directory after the integration processing is complete.
Remove a Directory Used for Temporary Documents
Use Remove Directory after temporary document processing has completed.
Example:
Create Directory → Generate Documents → Process Documents → Remove Directory
The directory can be removed once downstream processing no longer requires its contents.
Perform File-System Cleanup at the End of a Workflow
Place Remove Directory near the end of a workflow when the directory is no longer needed.
Example:
Complete Processing → Remove Directory → End
This makes directory cleanup an explicit final stage of the workflow.
Route Processing After Directory Removal
Use the True and False return paths to control subsequent workflow processing.
Example:
Remove Directory
→ True: Continue Process
→ False: Handle Removal Result
The step provides both True and False return values.
Handle a False Result
Connect the False return path to an appropriate workflow activity when the expected directory-removal result is not obtained.
Example:
Remove Directory → False → Handle Cleanup Result
This gives the workflow an explicit path for the non-True result.
Remove Multiple Temporary Directories
Multiple Remove Directory steps can be used when a workflow creates several separate temporary directories.
Example:
Process Directory A → Remove Directory A → Process Directory B → Remove Directory B → Complete
Each step can be configured with the appropriate directory.
Separate Directory Processing From Cleanup
Use Remove Directory as a dedicated cleanup stage after the primary directory-processing activities.
Example:
Retrieve Data → Create Directory → Generate Files → Process Files → Remove Directory → Finalize
This makes the lifecycle of the temporary directory explicit within the workflow.
Example:
Let’s build and execute the “removeDirectoryDef” example.
- Create a new process definition called “removeDirectoryDef” and open it in Designer mode.
- Drag a “removeDirectory” step to the canvas.
- Connect the dots between the “Start” and “removeDirectory” 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 “removeDirectory” 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 “removeDirectory” step to configure its “Optional” properties. Enter a directory file path to remove. Then click the Save button.

- 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 and click the process step to view its properties. When the workflow reaches the Remove Directory step, FlowWright uses the configured Directory to remove value to identify the directory that should be removed. The step is explicitly defined as “Removes a directory from the file system.” The workflow can then follow the True-or-False return path defined for the step.
Tips:
- Verify that
directoryNamecontains the intended directory before the step executes. - Use a meaningful workflow Variable when storing a dynamically generated directory path.
- Test the workflow with representative directories before deploying it.
- Verify that preceding workflow activities correctly create or identify the target directory.
- Avoid hard-coding directory paths when the target directory changes between workflow instances or environments.
- Make sure all required files and processing activities have completed before removing the directory.
- Verify that downstream activities do not depend on the directory after the Remove Directory step executes.
- Consider connecting both the True and False return paths to appropriate subsequent workflow activities.
- Provide appropriate handling for a False result.
- Use Logging to document directory-cleanup activity when the operation needs to be traceable.
- Test the workflow when the supplied directory path is missing or invalid.
- Test scenarios in which the target directory is unavailable when the step executes.
- Verify the contents and intended lifecycle of the directory before enabling automated removal.
- Use a consistent directory-location convention for temporary workflow directories.
- Keep dynamically generated directory paths maintainable and easy to identify.
- Exercise care when dynamically constructing directory paths to avoid targeting an unintended directory.
- Consider environment-specific directory locations when moving a workflow between environments.
- Test directory paths containing spaces and other characters used by the target file system.
- If the directory contains files or other content, verify how the FlowWright implementation handles that situation before relying on the step for non-empty directories.
- Do not assume that the step recursively removes files and subdirectories unless confirmed by the FlowWright implementation.
- Do not assume that the False return value represents a particular error condition unless confirmed by the FlowWright implementation.
- Do not assume additional behavior such as recovery, archival, or retention unless confirmed by the FlowWright implementation.
- Because
directoryNameis defined as optional in the XML; verify the step's behavior when no directory is supplied rather than assuming how FlowWright handles that situation.
Notes:
- The Remove Directory step is defined in the File System category with the internal name
removedirectory, label “Removes a directory from the file system,” namespaceFlowWright.Workflow.RemoveDirectory, and display name “Remove Directory.” - The step is implemented by
FlowWright.Workflow.RemoveDirectoryinFlowWright.Workflow.dlland is defined as a Process step with 2 incoming connections and 2 outgoing connections. - The step defines one property:
-
directoryName– Directory to remove.
-
- The
directoryNameproperty uses the string data type and is implemented byFlowWright.DataTypes.ClsTextBoxinFlowWright.DataTypes.dll. - Unlike required inputs in the reference Search Replace String step, the XML marks
directoryNameasrequired="false". - The step provides two return values:
- False
- True
Definition Sample:
You may provide a sample definition for the Remove Directory step for download and later import it into the FlowWright Process Definition XML page.
Note: Verify and complete any missing configuration after importing the sample, including:
- Directory path.
- Variable or workflow value containing the directory path.
- Workflow Variable references.
- Environment-specific directory locations.
- Target directory.
- Downstream True and False workflow paths.
- Logging configuration.
- Any downstream activities that may depend on the directory.
After verifying the configuration, save the Process Definition before execution.