Rename File
Renames a file or moves it to a different location within 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.
- Source Path - The current full path of the file (e.g., "/Documents/old_name.pdf").
- Target Path - The new full path for the file, including the new name (e.g., "/Archive/new_name.pdf").
How It Works
The Rename File node changes a file's name or location within pCloud. When executed, the node:
- Validates the Client Id
- Validates and normalizes the source path
- Validates and normalizes the target path
- Retrieves the authenticated pCloud client
- Renames or moves the file on the server
- Returns success when the operation completes
This node can perform two operations:
- Rename - Change the file name in the same folder
- Move - Change the file location (and optionally the name)
Requirements
- An active pCloud connection (Client Id from Login node)
- Source file must exist at the specified path
- Valid source and target paths
- Appropriate permissions for both source and target locations
- Target folder must exist (for move operations)
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid Client Id
- Empty source path
- Empty target path
- Source file does not exist
- Target folder does not exist (for move operations)
- Insufficient permissions
- Target file already exists (may be overwritten)
- Network connectivity issues
Usage Notes
- Both rename and move operations are supported
- The operation happens entirely on pCloud servers (fast operation)
- Paths are automatically normalized with leading "/"
- Use "/" as the path separator
- File names are case-sensitive
- If the target file exists, it may be overwritten
- The source and target paths must both include the file name
- Moving to a different folder requires the target folder to exist
Path Format
Both source and target paths must include the complete file path with name:
-
Rename in same folder:
- Source:
/Documents/report.pdf - Target:
/Documents/final_report.pdf
- Source:
-
Move to different folder:
- Source:
/Documents/report.pdf - Target:
/Archive/report.pdf
- Source:
-
Move and rename:
- Source:
/Documents/report.pdf - Target:
/Archive/final_report.pdf
- Source:
Best Practices
- Verify the source file exists before renaming
- Ensure target folder exists before moving files
- Use meaningful file names that describe content
- Consider using timestamps in file names for versioning
- Handle errors appropriately for reliability
- For bulk operations, use Continue On Error
- Test rename/move operations with non-critical files first
Example: Simple Rename
Rename a file in the same folder:
Inputs:
- Client Id: (from Login node)
- Source Path: "/Documents/draft.docx"
- Target Path: "/Documents/final.docx"
The file is renamed from "draft.docx" to "final.docx" in the Documents folder.
Example: Move to Archive
Move a file to a different folder:
Inputs:
- Client Id: (from Login node)
- Source Path: "/Current/project_plan.pdf"
- Target Path: "/Archive/project_plan.pdf"
The file is moved from Current to Archive folder.
Example: Move and Rename
Move a file and change its name:
Inputs:
- Client Id: (from Login node)
- Source Path: "/Temp/data_2024_01.csv"
- Target Path: "/Reports/January_2024_Data.csv"
The file is moved to Reports folder with a new descriptive name.
Common Automation Scenarios
File Organization:
- Rename files with standardized naming conventions
- Add timestamps or dates to file names
- Organize files by moving to categorized folders
- Maintain clean folder structures
Document Workflow:
- Move files between workflow stages (Draft → Review → Final)
- Rename files to reflect status
- Archive completed documents
- Organize by date or project
Data Processing:
- Rename processed files to indicate completion
- Move files from input to output folders
- Organize by processing status
- Add metadata to file names
Version Control:
- Rename files with version numbers
- Move old versions to archive
- Create dated versions
- Maintain version history
Example: Batch Rename with Pattern
Rename multiple files with a consistent pattern:
- Set Variable - Create array of file names
- For Each - Loop through files
- Format Date - Get current date
- Rename File
- Source:
/Input/${fileName} - Target:
/Output/${fileName}_${date}
- Source:
This adds dates to multiple file names.
Example: Workflow Stage Movement
Move files through processing stages:
- Process File - Process the file
- Rename File
- Source:
/Processing/${fileName} - Target:
/Completed/${fileName}
- Source:
- File is moved to completed folder after processing
Example: Dynamic Organization
Organize files based on content or metadata:
- Analyze File - Determine file category
- Decision - Based on category
- Rename File - Move to appropriate folder
- If Invoice: →
/Documents/Invoices/${fileName} - If Contract: →
/Documents/Contracts/${fileName} - If Report: →
/Documents/Reports/${fileName}
- If Invoice: →
Rename vs Copy
| Operation | Rename File | Copy File |
|---|---|---|
| Original | Removed | Preserved |
| Result | One file at new location | Two files (original + copy) |
| Speed | Very fast | Depends on file size |
| Use Case | Organize, move | Backup, duplicate |
Troubleshooting
Source File Not Found:
- Verify the source path is correct
- Check if the file exists in pCloud
- Ensure path uses forward slashes (/)
- Verify spelling and case sensitivity
Target Folder Not Found:
- Ensure target folder exists before moving files
- Create the target folder first if needed
- Verify the folder path is correct
Operation Fails:
- Check permissions on source and target locations
- Verify paths are properly formatted
- Ensure target name is valid (no illegal characters)
- Check if target file already exists
Invalid Client ID:
- Ensure Login node executed successfully
- Verify Client Id is being passed correctly
- Check if connection is still active
File Already Exists:
- Target file may be overwritten
- Use different target names to avoid conflicts
- Check existing files before renaming
Advanced Example: Smart File Organization
Automatically organize files by date and type:
- Get File List - List files in folder
- For Each - Loop through files
- Get File Info - Extract file extension and date
- Format Date - Format as YYYY/MM
- Create Folder - Ensure date folder exists
- Rename File
- Source:
/Incoming/${fileName} - Target:
/${fileType}/${dateFolder}/${fileName}
- Source:
This creates an organized structure by file type and date.