Delete Folder
Permanently deletes a folder and all its contents recursively from pCloud.
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.
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 Login node.
- Path - The full path to the folder to be deleted (e.g., "/OldProjects/Archive").
How It Works
The Delete Folder node permanently removes a folder and all of its contents from pCloud using recursive deletion. When executed, the node:
- Validates the Client Id
- Validates the path is not empty
- Normalizes the path by adding a leading "/" if needed
- Retrieves the authenticated pCloud client
- Recursively deletes the folder and all its contents (files and subfolders)
- Returns success when the folder is completely deleted
This operation is PERMANENT and RECURSIVE. All files and subfolders within the specified folder will be deleted. This cannot be undone unless pCloud's trash/recycle bin feature retains them temporarily. Always verify the path before deleting.
Requirements
- An active pCloud connection (Client Id from Login node)
- Folder must exist at the specified path
- Appropriate permissions to delete the folder and its contents
- Valid folder path
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Client Id
- Empty path
- Folder does not exist at the specified path
- Insufficient permissions to delete the folder or its contents
- Path points to a file instead of a folder
- Network connectivity issues
Usage Notes
- Deletion is RECURSIVE - all contents are deleted
- Deletion is PERMANENT - use with extreme caution
- The path must point to a folder, not a file
- Paths are automatically normalized with leading "/"
- Use "/" as the path separator
- Folder names are case-sensitive
- There is no confirmation dialog - deletion happens immediately
- Consider backing up important folders before deletion
- Empty folders and folders with contents are both handled
Path Format Examples
The Path input should specify the complete folder path:
"/Archive"- Deletes the Archive folder and all its contents"temp/old"- Deletes old folder from temp (path becomes /temp/old)"/Projects/Completed/2023"- Deletes the 2023 folder from Projects/Completed
Best Practices
- ALWAYS verify the folder path before deletion
- Create backups of important folders before deleting
- Test deletion logic with empty test folders first
- Use meaningful error handling for critical deletion operations
- For bulk deletions, use Continue On Error to handle missing folders
- Implement confirmation logic in critical workflows
- Log deleted folders for audit trails
- Consider archiving instead of deleting for important data
Example: Delete Temporary Folder
Delete a temporary working folder after processing:
Inputs:
- Client Id: (from Login node)
- Path: "/Temp/batch_processing"
This removes the temporary folder and all its contents.
Example: Clean Up Old Project
Delete a completed project folder:
Inputs:
- Client Id: (from Login node)
- Path: "/Projects/Archive/OldProject2023"
This removes an entire archived project folder.
Example: Project Cleanup Workflow
Complete project cleanup:
- Copy Folder - Backup project to archive (if available)
- Verify Backup - Confirm backup succeeded
- Delete Folder - Remove original project folder
- Project is safely archived before deletion
Common Automation Scenarios
Temporary Storage Cleanup:
- Delete temporary processing folders
- Remove working directories after job completion
- Clean up intermediate file storage
Automated Maintenance:
- Delete old archive folders
- Remove expired project folders
- Clean up test data folders
- Free up storage space
Batch Processing Cleanup:
- Delete input folders after processing
- Remove error folders after correction
- Clean up staging areas
Space Management:
- Delete old backup folders
- Remove outdated data folders
- Clean up after data migrations
- Manage storage quotas
Example: Conditional Folder Deletion
Delete folders based on age:
- List Folders - Get folder list
- For Each - Loop through folders
- Get Folder Date - Check folder creation date
- Decision - If older than specified period
- Delete Folder - Delete old folder
This removes folders older than a certain age.
Example: Bulk Folder Deletion
Delete multiple folders with error handling:
- Set Variable - Create array of folder paths
- For Each - Loop through folders
- Delete Folder (Continue On Error: true)
- Path:
${folderPath}
- Path:
- Log - Record deletion results
This handles missing folders gracefully during bulk operations.
Safety Considerations
Critical Safety Guidelines:
- This is a DESTRUCTIVE operation that deletes ALL contents
- There is NO undo - deletion is permanent
- ALWAYS double-check the path before execution
- Test with non-critical folders first
- Implement proper error handling and logging
- Consider user confirmation for critical operations
- Create backups before deleting important data
- Never delete system or root folders
Comparison: Delete File vs Delete Folder
| Feature | Delete File | Delete Folder |
|---|---|---|
| Target | Single file | Folder and all contents |
| Recursive | No | Yes |
| Contents | N/A | All files and subfolders deleted |
| Use Case | Remove individual files | Remove entire directory trees |
Troubleshooting
Folder Not Found:
- Verify the folder path is correct
- Check if the folder still exists
- Ensure path uses forward slashes (/)
- Verify spelling and case sensitivity
- Folder may have been already deleted
Permission Denied:
- Check if you have delete permissions
- Verify the Login was successful
- Ensure you're authenticated with correct credentials
- Some protected folders may not be deletable
- Check permissions on folder contents
Path Points to File:
- Use Delete File node for individual files
- Verify the path points to a folder
- Check the path format
Invalid Client ID:
- Ensure Login node executed successfully
- Verify Client Id is being passed correctly
- Check if connection is still active
Partial Deletion:
- If some files cannot be deleted, the operation may fail
- Check permissions on all folder contents
- Some files may be locked or in use
Alternative: Archive Instead of Delete
For safer operations, consider archiving instead of deleting:
- Rename Folder - Move to archive location
- Or Copy Folder - Copy to backup location (if available)
- Verify Archive - Confirm archive succeeded
- Delete Folder - Delete original after verification
This ensures you have a backup before permanent deletion.
Recovery Options
- Check pCloud's trash/recycle bin feature
- Some deleted items may be recoverable for a limited time
- Contact pCloud support for recovery assistance if needed
- Maintain separate backups for critical data
- Consider versioning systems for important folders