---
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


---

# Remove File or Directory activity

# Remove File or Directory activity {#ariaid-title1}

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

The Remove File or Directory activity removes a file or a directory on an SFTP server,
including subdirectories, when configured.

## Input variables

{#r_RemoveFileOrDirectoryActivity__table_fjr_y4w_mt__entry__2}

| Variable | Description |
|-|-|
| sourceHost | Name or IP address of the server containing the files you want to remove. |
| 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 to remove. To remove multiple files or directories using a single activity, enter a semicolon-separated list of paths in this field. |
| isDirectory | True/false variable that determines if the specified file path is a directory. The default value for this variable is false. |
| includeSubfolders | True/false variable that determines if the given directory and all of its subfolders should be removed. The default value for this variable is false. If the value for this field is false, then the activity can only remove an empty directory. This field appears when the isDirectory checkbox is selected. |
| sourceCredentialTag | Specific [Credential aliases for Orchestration activities](https://www.servicenow.com/docs/access?context=c_AssignCredsOrchActivities&version=australia&pubname=australia-platform-security&ft:locale=en-US) this activity must use to run SSH commands on the host. |
[Tabelle : 1. Remove File or Directory input variables]

{#r_RemoveFileOrDirectoryActivity__table_fjr_y4w_mt}

## Output variables

{#r_RemoveFileOrDirectoryActivity__table_omt_xqw_mt__entry__2}

| Variable | Description |
|-|-|
| errorMessage | The executionResult.errorMessages from the [Activity designer parsing sources](https://servicenow-prod.fluidtopics.net/jecuRsCuzIyfFDyPkB_Ehw#r_ActivityDesignerParsingSources "This table lists the parsing sources available with each execution template."). If this variable is not null, the operation has failed. |
| result | Either success or failure. |
| deletionResults | The deletionResults array contains these attributes: * fullPath: Full path to the file or directory targeted. * status: Either succeeded or failed. * reason: Text message describing the cause of a failure. {#r_RemoveFileOrDirectoryActivity__ul_ch1_vsw_mt} |
[Tabelle : 2. Remove File or Directory output variables]

{#r_RemoveFileOrDirectoryActivity__table_omt_xqw_mt}

## Conditions

{#r_RemoveFileOrDirectoryActivity__table_f5t_4vw_mt__entry__2}

| Condition | Description |
|-|-|
| Success | The activity succeeded in removing the file or directory specified. |
| Failure | The activity failed to remove the file or directory specified. |
[Tabelle : 3. Remove File or Directory conditions]

{#r_RemoveFileOrDirectoryActivity__table_f5t_4vw_mt}

