Skip to main content

Delete File

Deletes a file or folder at the specified path in Dropbox.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Client ID - The client identifier returned from the Connect node.
  • Dropbox Path - Path to the file or folder to delete (without leading slash).

How It Works

The Delete File node permanently removes a file or folder from your Dropbox account. When executed, the node:

  1. Validates the required inputs (Client ID and Dropbox Path)
  2. Retrieves the access token using the provided Client ID
  3. Prepends "/" to the path as required by the Dropbox API
  4. Sends a delete request to the Dropbox API
  5. Permanently removes the file or folder from Dropbox
warning

This operation is permanent and cannot be undone through the API. Deleted files may be recoverable through the Dropbox web interface for a limited time, but this should not be relied upon in automation workflows.

Path Format

  • Paths should be provided without a leading slash
  • The node automatically adds the leading "/" for Dropbox API compatibility
  • Examples:
    • Input: documents/old_report.pdf → API uses: /documents/old_report.pdf
    • Input: temp_files → API uses: /temp_files

Requirements

  • A valid Dropbox connection (using the Connect node)
  • The file or folder must exist in Dropbox
  • Delete permissions for the specified path
  • For folders, permission to delete all contents

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Client ID
  • Empty Dropbox Path
  • File or folder does not exist
  • Insufficient permissions to delete
  • The path points to the root folder
  • Dropbox API errors

Usage Notes

  • When deleting a folder, all contents are deleted recursively
  • The operation is permanent and immediate
  • Deleted files are moved to Dropbox's trash and may be recoverable through the web interface
  • Use with caution in production environments
  • Consider creating backups before deletion in critical workflows

Example 1: Delete a Single File

Remove an outdated report:

Inputs:

  • Client ID: (from Connect node)
  • Dropbox Path: reports/2023/old_report.pdf

Result: The file /reports/2023/old_report.pdf is permanently deleted

Example 2: Delete a Temporary Folder

Clean up temporary files after processing:

Inputs:

  • Client ID: (from Connect node)
  • Dropbox Path: temp/processing_folder

Result: The entire processing_folder and all its contents are deleted

Example 3: Delete Files Older Than a Date

Combined with ListFiles to delete old files:

ListFiles (get all files in archive)

Filter files older than 1 year

Loop through each file

DeleteFile (delete old file)

Common Use Cases

  • Cleaning up temporary or processed files
  • Removing outdated backups or archives
  • Deleting files after successful processing
  • Managing storage space by removing old files
  • Automating file lifecycle management
  • Clearing cache or temporary directories

Best Practices

  • Always verify the file path before deletion
  • Use FileStat to check if the file exists before attempting deletion
  • Consider creating backups before deletion in critical workflows
  • Implement confirmation steps for important deletions
  • Log all deletions for audit purposes
  • Use Continue On Error when deleting files that might not exist
  • Test deletion logic with non-critical files first

Safety Measures

To make deletions safer, consider these patterns:

  1. Verify before delete:
FileStat (check if file exists)

If file exists

DeleteFile
  1. Backup before delete:
CopyFile (create backup)

DeleteFile (delete original)
  1. Archive before delete:
MoveFile (move to archive folder)

Wait 30 days

DeleteFile (delete from archive)

Tips

  • Use descriptive logging when deleting files in automation
  • Implement a "soft delete" pattern by moving files to a trash folder instead
  • For production systems, consider requiring manual approval for deletions
  • Use variables to make deletion paths dynamic based on dates or conditions
  • Test deletion workflows thoroughly in a development environment first

Common Patterns

Clean up after file processing:

DownloadFile

Process file locally

UploadFile (upload processed version)

DeleteFile (remove original)

Scheduled cleanup:

ListFiles

Filter by date/criteria

Loop through matches

DeleteFile each match

Recovering Deleted Files

While this node permanently deletes files:

  • Files may be recoverable through the Dropbox web interface
  • Dropbox keeps deleted files for 30 days (or longer with Dropbox Business)
  • Recovery must be done manually through the Dropbox interface
  • Do not rely on recovery in automated workflows

Error Recovery

If a deletion fails:

  • Check if the file or folder exists using FileStat
  • Verify you have the correct permissions
  • Ensure the path is correctly formatted
  • Check for API rate limits or quota issues
  • Review Dropbox account status and permissions