---
sourceDocument: Australia ServiceNow AI Platform Capabilities
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/servicenow-platform

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia ServiceNow AI Platform Capabilities

ft:clusterId :

    - platcap

bundleId :

    - platcap

workflow :

    - Platform


---

# Create an SSH activity

# Create an SSH activity {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 Minuten Lesedauer

Create an activity that extracts data from a target host that uses the SSH network
protocol.

## Vorbereitungen

Role required: activity_creator or workflow_admin

## Warum und wann dieser Vorgang ausgeführt wird

For instructions on using the activity template process flow, see [create
custom activities](https://servicenow-prod.fluidtopics.net/0eg3YSA_OLwnlcnztlbEUw "You can create and update different types of custom activities in the Workflow Editor using a custom template.").

## Prozedur

1. Create a [custom
   activity](https://www.servicenow.com/docs/access?context=create-custom-activities&version=australia&pubname=australia-integrate-applications&ft:locale=en-US).  
   This action creates a custom activity using a template.
2. After setting up [general properties](https://servicenow-prod.fluidtopics.net/0Sm9zu2rRND~nSxb9VUhVw "The following General Property fields are common to all activity designer templates.") and [creating input
   variables](https://servicenow-prod.fluidtopics.net/9cajF_Pe381UXOE8RYlECw#CreateInputVariables "Create the variables to pass into the activity in the Inputs form of the activity designer."), configure the SSH Execution Command.

   | Option | Bezeichnung |
   | [Map the input variables](https://servicenow-prod.fluidtopics.net/9cajF_Pe381UXOE8RYlECw#t_MapAnInputVariable "After you create the input variables, map them to the fields in the Execution Command form.") | 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://www.servicenow.com/docs/access?context=r_SSHCredentialsForm&version=australia&pubname=australia-platform-security&ft:locale=en-US) to run commands. |
   |-|-|

   {#t_CreateAnSSHActivity__choicetable_j2l_k2s_d1b}  
   Hinweis:  
   You can map parameter values in a test payload to variables in the Outputs tab automatically. See [automap output variables](https://servicenow-prod.fluidtopics.net/zQra3zyXD57jq4LB0fHzRQ "You can map parameter values in a test payload to variables in the Outputs tab automatically.").

## Advanced SSH script options

To run a MID Server script on the target host, specify the script type and pass the name of the script into the `${syncFile()}` parameter. The system uses this parameter to locate the named script in the MID Server Script File \[ecc_agent_script_file\] table and run it on the target host. For example, a bash script can be expressed as:

    bash ${syncFile("<MID script name>")} argument1 argument2 argument3

A base script (`main_script.bash`) can reference another script (`my_include.bash`) as well as a separate file (`.my_profile`) located on the target host. Both scripts and the file referenced must be synced to the MID Server, using the `${syncFile()}` parameter, to execute properly.

    source ${syncFile(".my_profile")}
    cp ${syncFile("my_include.bash")} /usr/ssmith/my_include.bash
    bash ${syncFile("main_script.bash")} one two three four five six 
    rm /usr/ssmith/my_include.bash

A Python example with inline comments might look like this:

    set $LIB_DIR=/usr/bin;. 
    # Sync a file that is referenced inside myF5CreateLBPool.py 
    cp ${syncFile("specialFunctions.py")} ~/specialFunctions.py 
    # set up environment variables 
    source ${syncFile(".python_profile")} 
    # call script that sets up dependencies on the box from remote package repos 
    python ${syncFile("setupPythonDependencies.py")} pycontrol 
    # call a script that requires functions from the package as well as a function from myIncludedFile 
    python ${syncFile("myF5CreateLBPool.py")} snow_pool myActualValue 
    # user is responsible for their own cleanup 
    rm ~/specialFunctions.py 

## Nächste Maßnahme

* Use [auto-mapping](https://servicenow-prod.fluidtopics.net/zQra3zyXD57jq4LB0fHzRQ "You can map parameter values in a test payload to variables in the Outputs tab automatically.") to generate outputs and parsing rules
* If you do not use auto-mapping, you can manually [create output
  variables](https://servicenow-prod.fluidtopics.net/4NlOweZ9wgBtc9OOpy0QJg#t_CreateAnOutputVariable "The Outputs form in the designer contains a variable builder for creating data structures of objects and arrays.") and [create parsing
  rules](https://servicenow-prod.fluidtopics.net/jecuRsCuzIyfFDyPkB_Ehw#t_CreateAParsingRule "Populate output variables defined in a custom activity with payload data returned from an inputs test on an external host or endpoint.")
{#t_CreateAnSSHActivity__ul_u45_vbq_xz}

## SSH template execution parameters {#ariaid-title2}

Use execution parameters to create the input process script in the Pre Processing form of the activity designer.
For descriptions of the command fields, see [Configure the SSH execution command](https://servicenow-prod.fluidtopics.net/8fPnC2A~dq4pdTWS848KCA#t_MapSSHVariablesToExecutionCommand "Use the input variables you created to configure the command that Orchestration executes on the host target.").  
Hinweis:  
You must use the `executionParam.` prefix with all variables in this table.  
{#r_SSHTemplateExecutionParameters__table_wl1_yxc_dr__entry__4}

| 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://servicenow-prod.fluidtopics.net/Ixqp8gLvT6tnD2ksANEvaQ "MID Server capabilities define the specific functions of a MID Server within an IP address range."). 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://www.servicenow.com/docs/access?context=r_SSHCredentialsForm&version=australia&pubname=australia-platform-security&ft:locale=en-US) [SSH credentials](https://www.servicenow.com/docs/access?context=r_SSHCredentialsForm&version=australia&pubname=australia-platform-security&ft:locale=en-US) must be used. |
[Tabelle : 1. SSH execution parameters]

{#r_SSHTemplateExecutionParameters__table_wl1_yxc_dr}

## SSH post-processing parameters and payload parsing {#ariaid-title3}

Use these parameters to create a post-processing script, payload parsing, and
tagging.
{#SSH-payload-parsing-tags__table_nzv_q1d_dr__entry__4}

| 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"} |
[Tabelle : 2. SSH post-processing parameters]

{#SSH-payload-parsing-tags__table_nzv_q1d_dr}

## Configure the SSH execution command {#ariaid-title4}

Use the input variables you created to configure the command that Orchestration
executes on the host target.

### Vorbereitungen

Create the input variables you need in the Inputs form before you advance to the Execution Command stage.

Role required:
activity_creator, admin  
Hinweis:  
You can test the SSH connection between the MID Server and the target without having to run the acvitity in a workflow context. For details, see test template outputs.

### Prozedur

1. Drag variables from the list of inputs and drop them into command fields.  
   The system formats the variable in the proper syntax for the command.  
   Abbildung : 1. SSH execution command
2. Complete the fields shown in the table.  
   {#t_MapSSHVariablesToExecutionCommand__table_xf4_kvc_dr__entry__2}

   | Field | Description |
   |-|-|
   | Input | Input variable builder. [Create input variables](https://servicenow-prod.fluidtopics.net/9cajF_Pe381UXOE8RYlECw#CreateInputVariables "Create the variables to pass into the activity in the Inputs form of the activity designer.") 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://www.servicenow.com/docs/access?context=c_AssignCredsOrchActivities&version=australia&pubname=australia-platform-security&ft:locale=en-US) 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://www.servicenow.com/docs/access?context=r_SSHCredentialsForm&version=australia&pubname=australia-platform-security&ft:locale=en-US) to run commands. |
   [Tabelle : 3. SSH activity inputs]

   {#t_MapSSHVariablesToExecutionCommand__table_xf4_kvc_dr}
3. Click Save.
4. Click Continue to advance to the Outputs stage.
{#t_MapSSHVariablesToExecutionCommand__steps_pr1_jlm_s5}

