--- title: Set File Attributes activity description: The Set File Attributes activity sets common file attributes, such as timestamps, size, permissions, and UID/GID, for a file or directory on an SFTP server. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/servicenow-platform/orchestration/r\_SetFileAttributesActivity.html release: australia product: Orchestration classification: orchestration topic_type: reference last_updated: "2026-03-12" reading_time_minutes: 2 breadcrumb: [SFTP File Transfer activity pack, Orchestration activity packs, Classic Orchestration, ServiceNow AI Platform Additional Capabilities, Extend ServiceNow AI Platform capabilities] --- # Set File Attributes activity The Set File Attributes activity sets common file attributes, such as timestamps, size, permissions, and UID/GID, for a file or directory on an SFTP server. A good practice is to use the Get File List activity to return a list of files and their attributes first. Then, when you moved a file from a source host to a target host, use the Set File Attributes activity to set the source file attributes on the target file. This is demonstrated in the [SFTP File Transfer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/r_SFTPWorkflow.md)workflow. ## Input variables
| Variable | Description |
|---|---|
| sourceHost | Name or IP address of the server containing the file or directory whose attributes you want to change. |
| 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 whose attributes you want to change. |
| userID | User ID attribute to apply to the file or directory. The UID and GUID variables must be set together as a pair. |
| groupID | Group ID attribute to apply to the file or directory. The UID and GUID variables must be set together as a pair. |
| permissions | File or directory permissions to set for the user and group specified. This value must be expressed as an integer, such as **16877**, which defines these permissions: **rwxr-xr-x**. **Note:** The permissions number is an internal value returned by the Get File List activity. |
| accessTimestamp | Override the timestamp when the file or directory was last accessed. The access and modification timestamps must be set together as a pair. |
| modificationTimestamp | Override the timestamp when the file or directory was last modified. The access and modification timestamps must be set together as a pair. |
| sizeInBytes | Size of the file or directory, expressed in bytes. |
| 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. |