Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Copy Directory

Copies a directory from the source SFTP server to the target SFTP server.

Note: If you wish to use the Managed File Transfer feature while copying a directory, activate the ServiceNow IntegrationHub Action Step - MFT (com.glide.hub.action_step.mft) plugin.

Fields

FieldDescription
Connections
Source Connection

Type of connection to use to connect to the source SFTP server.- Define Connection Inline: Define connection information within the action step. - Use Connection Alias: Define connection information using the Connection Alias table. Using an alias eliminates the need to configure multiple credentials and connection information profiles when using an action in multiple environments. Likewise, if the connection information changes, you don't need to update your custom action.

To learn more about connections and credentials, see Introduction to credentials, connections, and aliases.

Source Connection AliasConnection & Credential alias record that the system uses to run the action step. Users with the flow_designer or admin role can create or select an associated Connection record. Using an alias eliminates the need to configure multiple credentials and connection information profiles when using an action in multiple environments. Likewise, if the connection information changes, you don't need to update your custom action. To learn more about connections and credentials, see credentials, connections, and aliases. The credential value is displayed as a Password (2 Way Encrypted) data pill on the data panel. This field is available when Use Connection Alias is selected from the Source Connection list.
Target Connection

Type of connection to use to connect to the target SFTP server.- Define Connection Inline: Define connection information within the action step. - Use Connection Alias: Define connection information using the Connection Alias table. Using an alias eliminates the need to configure multiple credentials and connection information profiles when using an action in multiple environments. Likewise, if the connection information changes, you don't need to update your custom action.

To learn more about connections and credentials, see Introduction to credentials, connections, and aliases.

Target Connection AliasConnection & Credential alias record that the system uses to run the action step. Users with the flow\_designer or admin role can create or select an associated Connection record. Using an alias eliminates the need to configure multiple credentials and connection information profiles when using an action in multiple environments. Likewise, if the connection information changes, you don't need to update your custom action. To learn more about connections and credentials, see credentials, connections, and aliases.
Source Credential aliasCredential alias that the system uses to run the action step. Users with the flow_designer or admin role can create or select an associated Connection record. Using an alias eliminates the need to configure multiple credentials when using an action in multiple environments. Likewise, if the credential information changes, you don't need to update your custom action. To learn more about connections and credentials, see credentials, connections, and aliases. The credential value is displayed as a Password (2 Way Encrypted) data pill on the data panel. This field is available when Define Connection Inline is selected from the Source Connection list.Note: The SFTP step requires a credential record that supports either SSH private key credentials or SSH credentials. This step does not support Windows credentials where the Use MID Server service account option is selected.
HostName or IP address of the SFTP server that contains the files you wish to copy.
PortPort number to communicate with the server.
MID Selection

Option to select a specific MID Server or MID Cluster. Choose any one of the following options. - Auto-Select MID Server: Your ServiceNow instance selects the MID Server without manual input. - Specific MID Server: Your ServiceNow instance uses MID Server that you specify. - Specific MID Cluster: Your ServiceNow instance uses the MID Cluster that you specify.

A MID Cluster is a group of MID Servers that enables your ServiceNow instance to handle multiple integrations, and improve integration speed. For more information, see Configure a MID Server cluster.

This field is available when Define Connection Inline is selected from the Source Connection list.

MID ApplicationOption to use a MID Server to run the SFTP step. This field is available when Define Connection Inline is selected from the Source Connection list and Auto-Select MID Server is selected from the MID Selection list.
CapabilitiesCapability of the MID Server. Select SSH. This field is available when Define Connection Inline is selected from the Source Connection list and Auto-Select MID Server is selected from the MID Selection list.
MID ServerData pill of the required MID Server. This field is available when Define Connection Inline is selected from the Source Connection list and Specific MID Server is selected from the MID Selection list.
MID ClusterData pill for the MID Cluster you want to use. This field is available when Define Connection Inline is selected from the Source Connection list, and Specific MID Cluster is selected from the MID Selection list.
Command Details
Source PathFull path to the file in the source server you wish to copy. For example, `/root/doc/tempwsdl.rtf`.
Target PathFull path to the file in the target server you wish to copy the contents. For example, `/root/doc/attribute.rtf`. In this case, the contents of the tempwsdl.rtf are copied to the file, attribute.rtf.
Include Files

List of target files to remove. This is a semicolon separated list that accepts wild cards, such as *.txt.Note:

  • If no value is provided, subfolders in the specified directory are deleted.
  • If a value is provided, subfolders are not deleted even if they are empty.
Exclude Files

List of target files that should not be removed. This is a semicolon separated list that accepts wild cards, such as *.txt.Note:

  • If no value is provided, subfolders in the specified directory are deleted.
  • If a value is provided, subfolders are not deleted even if they are empty.
Include SubfoldersOption to copy subfolders in the source directory.
Managed File Transfer
Target File NameName of the target file.
Target Directory NameName of the target directory.
Datetime Format $\{DateTime\}Format in which the date and time should be appended to the file name upon copying to the target server.
Preserve File AttributesOption to preserve the file attributes upon copying files to the target directory.
Apply Move ConditionsOption to specify conditions while moving files.
Minimum File Size \(Bytes\)Minimum size requirements to move files.Note: This field is available when Apply Move Conditions is enabled.
Maximum File Size \(Bytes\)Maximum size requirements to move files.Note: This field is available when Apply Move Conditions is enabled.
File is Newer thanFiles created after this date are moved.Note: This field is available when Apply Move Conditions is enabled.
File is Older thanFiles created before this date are moved.Note: This field is available when Apply Move Conditions is enabled.
Move OrderOrder in which the files should be moved.Note: This field is available when Apply Move Conditions is enabled.
Sort OrderOrder in which the files should be sorted.Note: This field is available when Apply Move Conditions is enabled.
Duplicate File ActionAction to be performed when a duplicate file exists in the target directory.Note: This field is available when Apply Move Conditions is enabled.
Retry Policy
Enable Retry PolicyOption to enable the retry policy. For more information, see Retry policy.
Override Default Policy for AliasOption to override the default retry policy. This option is not applicable when Define Connection Inline is selected from the Connection list.
Retry PolicyDefault retry policy associated with Connection Alias. If Override Default Policy for Alias is selected, you can override the default retry policy and select another existing retry policy based on your requirement.
Managed File Transfer Error Cleanup
Upon Failure, Remove Files on TargetOption to remove files from the target SFTP server when the copy command fails.
Upon Success, Remove Files from SourceOption to remove files from the source SFTP server when the copy command is executed successfully.

Action error evaluation

  • If this step fails

    Data type: Choice

    Option to continue running the next step or go to error evaluation. To use the step status code or message for a custom action error condition, see Action error evaluation.

Parent Topic:SFTP step