oneDriveDeleteFolder Step

Use this feature to delete a specified folder in OneDrive and store the operation result in a FlowWright Variable or Global variable.

Last published at: September 9th, 2026

Description:

The Delete Folder workflow step deletes a folder in OneDrive using the selected OAuth provider and the specified folder path. The operation result is stored in the specified Variable or Global variable.

The step supports:

  • Selecting an OAuth provider for the OneDrive operation.
  • Specifying the folder path to delete.
  • Storing the operation result in a Variable or Global variable.
  • Connecting the workflow to True or False paths based on the step result.

 

Inputs

  • Select OAuth provider - Specifies the OAuth provider to use for the OneDrive operation.
  • Path to delete folder - Specifies the path of the OneDrive folder to delete.
  • Store result in Variable/Global - Specifies the Variable or Global variable in which the operation result is stored.
 

 

Returns

  • True – The True return path can be connected to the next workflow activity when the folder-delete operation completes successfully.
  • False – Use the False return path for error handling or an alternative workflow path when the operation fails.
 

 

Usage:

Place the Delete Folder step after a workflow has determined that a OneDrive folder is no longer required.

The workflow supplies the configured OAuth provider and folder path, performs the delete operation, and stores the resulting information in the specified Variable or Global variable.

A typical workflow pattern is:

Determine Folder → Delete Folder → Continue Processing

The step can be useful in workflows that:

  • Remove temporary OneDrive folders.
  • Clean up folders after processing is complete.
  • Remove folders associated with completed workflow instances.
  • Perform document-management housekeeping.
  • Delete folders after files have been moved or archived.
  • Route the workflow differently depending on the operation result.

 

To use this step, you must configure OneDrive in FlowWright.

 

The Windows Live OAuth configuration is included here for reference. 

 

Typical Workflow Suggestions:

Clean Up Temporary OneDrive Folders

Use the step at the end of a workflow to remove a temporary folder created for intermediate processing.

Example:

Create Temporary Folder → Process Files → Delete Folder → Complete Workflow

This keeps temporary OneDrive content from remaining after the workflow has completed.

 

Remove Completed Project Folders

Use this step after a project or workflow process reaches its completion stage.

Example:

Complete Project Processing → Delete Project Folder → Archive Results

The folder path can identify the OneDrive folder associated with the completed process.

 

Clean Up After Document Processing

Use the step after documents have been downloaded, processed, or transferred to their final destination.

Example:

Process Documents → Save Final Documents → Delete Folder → Continue

This can help remove a temporary working folder after its contents have been processed.

 

Delete a Folder After Archiving

Use this step after the workflow has successfully archived the required content.

Example:

Retrieve Documents → Archive Documents → Delete Folder → Notify User

Place the deletion after the archive operation so the workflow cleans up only after it has handled the required documents.

 

Clean Up Folders After an Approval Process

Use the step to remove a temporary OneDrive folder when an approval workflow has finished.

Example:

Approval Process → Finalize Documents → Delete Folder → Complete

This is useful when a workflow creates or uses a working folder during document approval.

 

Remove Folders for Canceled Processes

A workflow can use the step as part of a cancellation or cleanup path.

Example:

Process Canceled → Delete Folder → Record Completion

The folder path can point to the OneDrive location associated with the canceled process.

 

Perform Workflow Housekeeping

Use the step as part of a recurring or administrative workflow that removes folders that are no longer needed.

Example:

Identify Folders for Cleanup → Delete Folder → Record Result

The XML confirms that the folder path and result destination are configurable, but it does not specify how a workflow should identify obsolete folders. That determination should therefore be handled by the surrounding workflow logic.

 

Use the Result for Subsequent Processing

Store the operation result in a Variable or Global variable and make that value available to subsequent workflow activities.

Example:

Delete Folder → Store Result → Process Result

The resultJson property is specifically provided for storing the result in a Variable or Global variable.

 

Route Successful and Unsuccessful Operations

Use the True and False connections to create different workflow paths.

Example:

Delete Folder
True → Continue Workflow
False → Error Handling

The step definition provides both return connections, so the workflow designer supports this branching pattern.

 

Use Dynamic Folder Paths

Use a workflow Variable or other supported workflow value when constructing the folder path so that the same workflow can operate on different OneDrive folders.

Example:

Build Folder Path → Delete Folder → Continue

The destinationFilePath property is a string property labeled “Path to delete folder”, allowing you to supply the folder path in step configuration.

 

Clean Up After a OneDrive File Workflow

You can use this step after OneDrive file operations complete.

Example:

Download/Process Files → Upload Final Files → Delete Folder → Complete

This is particularly useful when the folder serves as a temporary working location.

 

Maintain Separate Cleanup and Error Paths

A workflow can use the delete result to distinguish normal completion from an unsuccessful operation.

Example:

Delete Folder → True → Complete
Delete Folder → False → Log/Handle Error

This keeps cleanup logic separate from the normal workflow path.

 

Example:

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

  • Create a new definition called “OneDriveDeleteFolderDef” and open the definition in designer mode. 
  • Drag a “OneDriveDeleteFolder” step to the canvas. 
  • Connect the dots between the “Start” and “OneDriveDeleteFolder” 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.
  • Click the “OneDriveDeleteFile” step to configure its “Required” properties. Provide a name for the step. Select “WindowsLive” from the OAuth providers dropdown. Enter the folder path to delete. Specify a variable or global to store the result after execution. 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 is necessary for documentation and to measure workflow progress and percent complete. Configure 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 Delete Folder process step to view its properties. When the workflow reaches the Delete Folder step, FlowWright uses the selected OAuth provider and configured folder path for the OneDrive operation. It stores the result in the configured Variable or Global variable. Inspect the resulting Variable or Global value and the workflow's True or False path to verify the outcome.

 

Tips:

  • Select the appropriate OAuth provider before executing the step.
  • Carefully verify the OneDrive folder path before running the workflow.
  • Use a meaningful Variable or Global variable name for the stored result.
  • Test the workflow with a representative folder before deploying it to production.
  • Make sure the configured folder is the intended cleanup target.
  • Use the True path for subsequent processing when appropriate.
  • Consider connecting the False path to suitable error-handling or recovery logic.
  • When using dynamically constructed folder paths, verify the resulting path before the Delete Folder step executes.
  • Avoid hard-coding environment-specific folder paths when the workflow is intended for multiple environments.
  • Keep cleanup operations late enough in the workflow that required files have already been processed or moved.
  • If a folder contains important documents, verify the workflow's preceding logic before allowing the delete operation to execute.
  • Test cancellation and error paths separately when the step is part of workflow cleanup.
  • Do not assume recursive deletion behavior for folders containing files or subfolders unless that behavior has been confirmed for the FlowWright implementation.
  • Do not assume how nonexistent folders, duplicate paths, access failures, or other OneDrive-specific conditions are represented by the True or False result unless confirmed by the implementation.
  • Do not assume that the stored result has a particular JSON structure merely from the resultJson property name; inspect the actual result produced by the implementation.
  • Keep OAuth configuration and permissions appropriate for the OneDrive operations the workflow performs.
  • Avoid exposing sensitive information contained in stored operation results to users or external systems.

 

Notes:

  • The Delete Folder step is defined in the OneDrive category with the internal name onedrivedeletefolder, label “Delete folder in One Drive”, and display name “Delete Folder.”
  • The step is implemented by FlowWright.Workflow.OneDriveDeleteFolder in FlowWright.Workflow.dll and is defined as a Process step with 2 incoming connections and 2 outgoing connections.
  • The step defines three required properties:
    • selOAuthProvider – Select OAuth provider
    • destinationFilePath – Path to delete folder
    • resultJson – Store result in Variable/Global 
  • The OAuth provider property uses the SelOAuthProvider data type, implemented by FlowWright.DataTypes.SelOAuthProvider in FlowWright.DataTypes.dll. Its description is “Get oAuth provider list.”
  • The folder path and result destination properties use the string data type, implemented by FlowWright.DataTypes.ClsTextBox in FlowWright.DataTypes.dll.
  • The step provides two return values:
    • False
    • True

 

Definition Sample:

You may download the sample definition(s) from the link provided and later import them into your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.

Note: Verify and complete any missing configuration after importing the sample, including:

  • OAuth provider.
  • OneDrive folder path.
  • Variable or Global variable used to store the result.
  • Workflow Variable references.
  • Environment-specific OAuth settings.
  • OneDrive permissions.
  • Downstream True and False workflow paths.
  • Any preceding logic that determines whether the folder should be deleted.

After verifying the configuration, save the Process Definition before execution.

Click here to download the sample file.