File Trigger

Monitor file changes with your Processes.

In order to launch a Process when files are added to a folder, File Trigger can be used.

You can learn more about Triggers in general here.

What is File Trigger?

File Trigger monitors specified locally mapped directories for new files to initiate Processes. Ideal for handling file-based data exchanges and automation.

Usage

To use a Trigger in your Process, add it to your Process canvas, and connect it to the beginning of your Process using a Sequence flow. If you are using multiple Triggers in your Process, all Triggers must connect to the same shape, which is also the first non-Trigger shape in your Process.

Once added to your Process, you can change the Trigger's type to match your requirement and give it a unique name. By default, the Trigger's type will provide a corresponding name for the Trigger. You can then configure the parameters for the chosen Trigger type.

For File Trigger, you can specify the target directory to monitor by the Trigger, as well as file name filter to only start the Process for specific files. You can also choose to monitor the subdirectories as well, or focus solely on the specified directory.

If needed, you can also fine tune the Trigger's parameters for how often to check for changed files in the folder, and if necessary, provide credentials for authenticating to the directory. If not provided, the executing Agent's credentials are used to access the files and folders.

Configuration

To set up a File Trigger, add the shape to Process canvas and connect it as part of your Process. After that, you can select the Trigger type and configure the parameters for it.

The common parameters available for all Triggers are explained on the Trigger reference page. The following configuration parameters are available for File Trigger.

Directory

Target directory to monitor for file changes. Has to be either local directory or a network drive that the server hosting the Agent has access to. If necessary, credentials can be provided to authenticate into the directory as another user account, instead of using the Agent's credentials.

File filter

Filter string to be used to choose which files will trigger the Process execution. Asterisk (*) and question mark (?) wildcards can be used in the filter string to allow variations in the file name. For example, *.csv will select all files that end in .csv, while file_v?.csv will match files such as file_v1.csv and file_v2.csv.

Without wildcards, the file name must match exactly the string in file filter parameter. If left empty, all files will be matched from the folder.

Multiple separate filters using pipe character (|) is not supported. You can use multiple Triggers instead.

Using Environment Variables is possible in this parameter field. You can learn more about using them at Environment Variables in Trigger parameters.

Include sub directories

If enabled, the Trigger will also monitor all the directories within the specified directory. Otherwise, sub directories will not be monitored.

Maximum number of files to process at a time

This numeric parameter can be used to limit the number of files being processed in one Process Instance. If more are found, multiple Process Instances will be launched to process them. Maximum of 1,000 files will be handled at any one time.

Poll interval in seconds

Numeric value to specify how often the directory is checked for new files.

Quiet period in seconds

Numeric value to specify how long to wait until Process executes and processes a file, after it has been written to the disk.

Operating system might not update the Last Write Time value for a file for performance reasons. Therefore always set the value to be large enough to take this into account when using this parameter. Defaults to empty.

Username

If authentication is required to access the files and directories, and the credentials Agent is using are not allowed to access the location, provide another username here. Expected format is domain\username.

Password

Password for the separate user account used to access the file location. Input type is secret to avoid logging the password in clear text.

Do not log trigger parameters

Toggle option that when enabled, hides the Trigger parameters from being logged in Process Instances.

Reference Values

In addition to the default Trigger reference values, File Trigger provides the following additional values.

#trigger.data (Frends.ExecutableProcess.CaseInsensitivePropertyTree)

Object containing the data derived from input parameters and the resulting data from processing the Trigger.

#trigger.data.filePaths (String[])

List of file paths for the files that triggered the Process.

#trigger.data.files (String[])

List of file names for the files that triggered the Process.

Last updated

Was this helpful?