--- title: Rename File or Directory activity description: The Rename File or Directory activity renames a file or directory to a new name on an SFTP server. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/servicenow-platform/orchestration/r\_RenameFileOrDirectoryActivity.html release: australia product: Orchestration classification: orchestration topic_type: reference last_updated: "2026-03-12" reading_time_minutes: 1 breadcrumb: [SFTP File Transfer activity pack, Orchestration activity packs, Classic Orchestration, ServiceNow AI Platform Additional Capabilities, Extend ServiceNow AI Platform capabilities] --- # Rename File or Directory activity The Rename File or Directory activity renames a file or directory to a new name on an SFTP server. ## Input variables |Variable|Description| |--------|-----------| |sourceHost|Name or IP address of the server containing the file or directory you want to rename.| |sourcePort|Port number to use to communicate with the target server. The default port number is **22**.| |sourceFilePath|Full path to the file or directory to rename.| |targetFilePath|Full path to the renamed file or directory.| |sourceCredentialTag|Specific [Credential aliases for Orchestration activities](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/c_AssignCredsOrchActivities.md) this activity must use to run SSH commands on the host.| ## Output variables |Variable|Description| |--------|-----------| |errorMessages|The **executionResult.errorMessages** from the [Activity designer parsing sources](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/t_CreateAParsingRule.md). If this variable is not null, the operation has failed.| |result|A message saying that the operation has been successful. For example, you might see: `Rename /tmp/sftp_test/subdir1 to /tmp/sftp_test/subdir2 complete`.| ## Conditions |Condition|Description| |---------|-----------| |Success|The activity succeeded in renaming the file or directory.| |Failure|The activity failed to rename the file or directory.| **Parent Topic:**[SFTP File Transfer activity pack](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/c_OrchestrationSFTPActivityPack.md)