SFTP File


The SFTP File node automatically scans and downloads the files in the specified directory of an SFTP server according to the interval. Nodes under the Action node type such as the File node can subsequently be used to read/write to the file.


Before You Start

Ensure that you have configured the SFTP server connection in EnOS Management Console > Connection Configurations. For more information, see Connection Configurations.


Node Type

Input.

Input and Output Ability

This node does not have an entry point and has 1 exit point.


The output is the files in the specified directory, displayed in the metadata of the output msg. Each file produces an output msg, which can be used by the expression ${metadata.files} in the next node.

Node Properties

../../_images/sftp_file.png


Name

The name for this node.


Target Connection

Choose an SFTP server to download the files.


Directory

The directory of the files to download.

  • Starting with a forward slash. For example, enter /download/ to scan and download all the files in the download folder.

  • Supports single files. For example, enter /download/test.csv to scan and download the test.csv file in the /download/ folder.

  • Supports wildcard ? and *.

  • Supports multiple directories. Each directory must be separated by a comma(,).


Scheduling Interval

The interval to scan the directory. The unit is in seconds. Configuring this enables the node to have a self-triggering capability, which can scan the directory and download the files automatically. The interval range is 1-86400 seconds, and the default is 60 seconds.


Note

As it takes some time to download and process files, the actual trigger time may be delayed when the download and processing time exceeds the Scheduling Interval.


Post Processing Action

  • Auto Delete: After downloading, automatically deletes the files specified in Directory. For example, enter /download/ in Directory with the current switch triggled on to delete the /download/ directory after downloading. Supports a single file and multiple directories.

  • Move to Directory: After downloading, moves the files specified in Directory to another directory.

    • Starting with a forward slash. For example, enter /move/ in Move to Directory with /download/ in Directory to move the files from /download/ to /move/ after downloading. The /download/ directory will be deleted at the same time. If the target directory does not exist in the server, it will be created.

    • Supports a single file.

    • Supports expressions ${msg.XXX}, which refers to the output msg of the last node of the flow. For example, enter /download/${msg.test} in Move to Directory with /download/ in Directory, the files in /download/ will be moved to /download/123 after downloading if the last node has msg={"test":"123"} in the output msg.

    • Supports renaming directory. For example, enter /download/456 in Move to Directory with /download/123 in Directory, /download/123 will be renamed to /download/456.

    • If you enter a target directory in Move to Directory with wildcards or multiple directories separated by a comma(,) in Directory, all files that match in Directory will be moved to the target directory.


Description

The description for the node.


Limitations

  • Max download file size: 100M

  • The interval range: 1-86400 seconds

  • As the SFTP server is not managed by EnOS, connection problems could occur due to server downtime or other instances that are not within our control.

Samples

Input Sample

There is no input msg for this node.

Output Sample

Every file scanned in the directory will produce an outlog. For example:

{
  "MetaData": {
    "files": "[\"/var/data/sftp/text.csv\"]"
  },
  "Body": {}
}