--- title: File Write activity description: The File Write activity writes a file on a Linux or UNIX computer. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/servicenow-platform/orchestration/r\_FileWriteActivity.html release: australia product: Orchestration classification: orchestration topic_type: reference last_updated: "2026-03-12" reading_time_minutes: 1 breadcrumb: [SSH activity pack, Orchestration activity packs, Classic Orchestration, ServiceNow AI Platform Additional Capabilities, Extend ServiceNow AI Platform capabilities] --- # File Write activity The File Write activity writes a file on a Linux or UNIX computer. The source file can be an absolute or relative path from the Directory. If an absolute path is used, then no value is required in the Directory field. This activity replaces an SSH activity by the same name available in releases prior to Istanbul. If you have a workflow created in a previous version that uses the deprecated activity, your workflow will continue to work normally after upgrading to Istanbul. However, all new workflows must use the custom version of this activity. This activity was built with the [SSH activity template](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/t_CreateAnSSHActivity.md), which gives workflow administrators the ability to store input and output variables in the [databus](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/c_OrchestrationDatabus.md). ## Input variables
Field Description
hostname Hostname or IP address of destination server for SSH activity.
directory Name of the working \(target\) directory.
file Name of the file to be written.
behavior Select one of the following:- **overwrite**: Creates the file if it does not exist and overwrites the file if it does exist. - **append**: Creates the file if it does not exist and appends the new content to an existing file. - **create only**: Creates the file if it does not exist and fails if the file does exist.
contents What to write or append \(depending on the behavior\) to the file
## Output variables |Variable|Description| |--------|-----------| |return\_code|Indicates whether or not the file write operation was successful.| |error\_message|Message that indicates if an error has occurred. Any value other than **0** indicates a failure.| ## Conditions |Condition|Description| |---------|-----------| |Success|The activity wrote a file in the target directory.| |Failure|The activity failed to write a file in the target directory.| **Parent Topic:**[SSH activity pack](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/c_OrchestrationSSHCustomActivities.md)