- Docs
- Automations
Matching Source Path and Filenames
There are various methods to match the source content for the automation to act on. You can define patterns and criteria that the folders or files must meet for the automation to be triggered. These patterns can include folder structure, specific file names, extensions, or even wildcards to capture a range of files.
By setting these parameters, you ensure that the automation only processes files that match the defined criteria, allowing for precise control over which files are included in the workflow. For instance, you might specify that only .csv files in a particular directory should be acted upon, or use wildcards to include all files in a subfolder. This flexibility allows you to tailor the automation to suit various needs and scenarios.
Path Matching
The path attribute in automation specifies the folders to which the automation applies, working in conjunction with the source attribute to determine the affected files. This attribute supports globs and exclusively refers to folders, not files. The combination of the path and source attributes identifies which files the automation will target. It's important to note that automations only operate on files, even though paths can point to folders that do not yet exist.
Using Path Globs
Path globs provide a flexible way to match folder structures using wildcards instead of defining every directory manually. A double asterisk ** enables recursive matching, which is useful for managing deep directory trees.
For example, path/to/* means any folder, of any name, directly inside the path/to folder. It matches path/to/folder1 and path/to/folder2, but not path/to/folder1/subfolder. In contrast, path/to/** means any folder within path/to at any depth and therefore includes all nested subfolders.
The ? wildcard matches exactly one character. This is useful when a specific character position varies but the overall length remains consistent. For example, 202?_Audit matches 2025_Audit and 2026_Audit, but not 202_Audit or 20265_Audit.
Square brackets [] define a set or range of allowed characters in a single position. A pattern like Project_[A-Z] matches Project_A through Project_Z, ensuring the automation triggers only on folders ending with a single uppercase letter.
The * wildcard matches zero or more characters within a single folder level. A pattern like 2026_*_Reports captures folders such as 2026_Internal_Reports and 2026_Client_Reports while excluding folders that follow a different naming structure.
Wildcards can also be combined for more advanced matching. For example, 202?_[A-C]*_Report matches 2025_Audit_Report and 2026_ClientSummary_Report, but does not match 202_Audit_Report or 2027_Detail_Report.
If a folder name contains a literal *, ?, [ or ], you must escape the character so it is treated as text rather than a wildcard. This is done by placing the character inside square brackets. For example, to match Legal*Disclosures, use Legal[\*]Disclosures; to match Audit?, use Audit[\?]; and to match [Archive], use [\[]Archive[\]]. Without escaping, these characters are interpreted according to their wildcard meaning.
By default, Copy and Move automations that use globs will implicitly replicate matched folder structures at the destination. You can optionally flatten the folder structure at the destination.
When the source is a Mounted Folder or Remote Server, Automations that include glob patterns like * or ** in the source path are supported only when triggered by file action based triggers.
File Name Pattern Matching
File name patterns apply to Copy, Move, and Delete file automations. They control which files an Automation includes or excludes. Include Patterns limit which file names the Automation processes, while Exclude Patterns ignore specific files or folders.
Patterns are evaluated relative to the Automation source folder. Prefixing a pattern with **/ applies it to file names at any folder depth starting from the source folder.
Exclude Patterns always take precedence when a path matches both settings. Both settings support glob wildcards.
Include Patterns
Include Patterns control which file names the Automation processes. If no Include Patterns are specified, the Automation processes all triggering files.
Include Patterns match file names using standard text, wildcards, or file extensions. Patterns that start with **/ apply recursively to everything under the source folder.
A pattern like *.pdf matches all PDF files. A pattern like *paid* matches file names that contain paid, case insensitive. Prefixing a pattern with **/ applies it to file names at any folder depth. For example, **/*.docx includes only .docx files from all folders and subfolders.
You can build expressions to match individual characters or sets of characters. The ? wildcard matches a single character. Square brackets [] match any character from a defined set. To match special characters literally, escape them using a backslash and enclose them in square brackets, such as [\?].
You can negate characters or ranges using ^. The pattern [a-z].* matches file names that contain only letters. The pattern [^a-z].* excludes file names that contain letters.
Time based patterns are also supported. A pattern like %Y%m%d*.* matches file names that start with today’s date in YYYYMMDD format.
Curly brackets {} allow you to define multiple alternatives within a single pattern. These alternatives can include literal text, character ranges, or nested patterns. A pattern like *{Mon,Tue,Wed,Thu,Fri}* matches file names containing weekday abbreviations. A pattern like 202{6-{0[7-9],1?},4-0[1-6]}-* matches file names that start with dates from 2026-07-01 through 2026-06-30.
You can configure multiple Include Patterns for a single Automation. A file is included if it matches any one of the configured patterns.
Exclude Patterns
Exclude Patterns ignore files or folders based on their paths. When a path matches an Exclude Pattern, the Automation ignores it. Exclude Patterns always take precedence over Include Patterns when both match the same path.
Exclude Patterns match paths relative to the Automation source folder. Patterns that start with **/ apply recursively to everything under the source folder. An exclude pattern like **/*2026*.pdf excludes any PDF file containing 2026 anywhere under the source folder.
You can exclude files or folders based on specific words or phrases in their names. The pattern **/*temp* excludes files with temp in the name. The pattern **/*temp*/* excludes folders containing temp and all of their contents.
Character based exclusions provide additional filtering options. The pattern **/report_20??.* excludes files that start with report_20 followed by any two characters, including report_2026.csv. Numeric patterns are also supported. The pattern **/[0-9]*.txt excludes files that start with a number and end with .txt.
Day based exclusions allow filtering by date related naming patterns. The pattern **/*_{Mon,Tue,Wed}*.* excludes files containing weekday abbreviations. The pattern **/*[01..31]*.docx excludes files containing any day number from 01 to 31.
For complex exclusions, you can use alternatives in curly brackets {}. The pattern **/{temp,backup,old}*.* excludes files that start with temp, backup, or old, regardless of file extension.
Special characters can be excluded with precise matching. The pattern **/*$*.* excludes files that contain a $ symbol. To exclude files with specific characters in exact positions, use escaped patterns. The pattern **/*test[\*]file* excludes files that contain a literal test*file, while allowing files that do not match that exact character placement.
Get The File Orchestration Platform Today
4,000+ organizations trust Files.com for mission-critical file operations. Start your free trial now and build your first flow in 60 seconds.
No credit card required • 7-day free trial • Setup in minutes