--- title: Create an SSH activity description: Create an activity that extracts data from a target host that uses the SSH network protocol.Use execution parameters to create the input process script in the Pre Processing form of the activity designer.Use these parameters to create a post-processing script, payload parsing, and tagging.Use the input variables you created to configure the command that Orchestration executes on the host target. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/servicenow-platform/orchestration/t\_CreateAnSSHActivity.html release: australia product: Orchestration classification: orchestration topic_type: task last_updated: "2026-03-12" reading_time_minutes: 7 breadcrumb: [Orchestration custom activity templates, Orchestration activity designer, Classic Orchestration, ServiceNow AI Platform Additional Capabilities, Extend ServiceNow AI Platform capabilities] --- # Create an SSH activity Create an activity that extracts data from a target host that uses the SSH network protocol. ## Before you begin Role required: activity\_creator or workflow\_admin ## About this task For instructions on using the activity template process flow, see [create custom activities](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/create-custom-activities.md). ## Procedure 1. Create a [custom activity](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/integrate-applications/create-custom-activities.md). This action creates a custom activity using a template. 2. After setting up [general properties](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/General-Flds-Templates.md) and [creating input variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/CreateInputVariables.md), configure the SSH Execution Command.
| **[Map the input variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/CreateInputVariables.md)** | Use the variables you created to configure the command that Orchestration executes. |
| **Target host** | Host name or IP address of the target server for this activity. |
| **Command** | Command this activity runs on the target host. You can invoke a MID Server script from this field using any script type that the SSH command line supports. For more information, see **Advanced SSH script options** below the table. |
| **Directory** | Directory on the target host where the command is run. |
| **Credential tag** | The Orchestration credential tag to use when running the command. |
| **Required MID Server capabilities** | MID Server with the appropriate capabilities for connecting to the host. By default, the system selects a MID Server with SSH capabilities. |
| **Long running** | If checked, disables the SSH connection timeout for commands that might take longer to run than the default 60 seconds. Orchestration periodically checks the running process to determine its status until it is finished. |
| **Must Sudo** | If checked, enables the use of [sudo](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/r_SSHCredentialsForm.md) to run commands. |
| Name | Variable | Type | Usage |
|---|---|---|---|
| Source | source | String | Intended target or host. |
| Command | command | String | Comment to run on the host. |
| Directory | directory | String | Directory on the host in which to run the command. |
| Credential tag | credential\_tag | String | Orchestration credential tag to use when running the command. |
| MidCapabilities | midCapabilities | String \(comma separated\) | List of required MID Server capabilities. |
| ValueCapabilities | valueCapabilities | Array of hashmap | Capability values used to select the MID Server. For more information, see [MID Server capabilities](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown). If there are additional capabilities that are assigned by value, use this example to customize the MID Server selection:``` var valueCapability = {'NEW_MID_CAPABIILTY':'NEW_MID_CAPABILITY_VALUE'}; executionParam.valueCapabilities.push(valueCapability); ``` |
| Long running | long\_running | Boolean | Indicates whether or not the command is long running. A value of true indicates that the command is long running. |
| Must sudo | must\_sudo | Boolean | Indicates whether or not this activity must use sudo to run root commands. A value of true indicates that [sudo](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/r_SSHCredentialsForm.md) [SSH credentials](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/r_SSHCredentialsForm.md) must be used. |
| Name | Variable | Type | Usage |
|---|---|---|---|
| Output | output | String | Contains the output returned from the SSH command. |
| EccSysID | eccSysID | String | Contains the reference ID associated with the ECC Queue input message returned by the activity. |
| ErrorMessages | errorMessages | String | Contains the error messages retrieved from the SSH command. This value is **null** if there are no error messages. |
| Tags | tags | Hashmap of tag values returned from the SSH command | Contains the tags used to extract output using the SSH commands. The tag output is delimited by double percentage signs, as in `%%tagname%% … %%`. Set up the command using the following format:``` %%tagname1%% output1 line 1 output1 line 2 … %% %%tagname2%% output2 line 1 output2 line 2 … %% ``` The tags returned are JavaScript hashmap objects in which each key is prefixed with `tag` appended with the tagname.``` {"__text__": "", "tagtagname1":"output1 line1\noutput1 line2\n", "tagtagname2":"output2 line1\noutput2 line2\n"} ``` |
| Field | Description |
|---|---|
| Input | Input variable builder. [Create input variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/CreateInputVariables.md) to map to available fields. |
| Target host | Host name or IP address of the target server for this activity. |
| Command | Command this activity runs on the target host. You can invoke a MID Server script from this field using any script type that is supported by the SSH command line. For more information, see **Advanced SSH script options** below the table. |
| Directory | Directory on the target host where the command is run. |
| Credential tag | The [Credential aliases for Orchestration activities](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/c_AssignCredsOrchActivities.md) to use when running the command. |
| Select MID Server by capabilities | MID Server with the appropriate capabilities for connecting to the host. By default, the system selects a MID Server with SSH capabilities |
| Long running | Check box to disable the SSH connection timeout for commands that might take longer to run than the default 60 seconds. Orchestration periodically checks the running process to determine its status until it is finished. |
| Must Sudo | Check box to allow the use of [SSH credentials](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/r_SSHCredentialsForm.md) to run commands. |