Skip to main content

Creating Expectations

An Expectation has three parts: the success criteria, the trigger and timing, and the scope of files to watch for.

Expectation Success Criteria

Success criteria define what a valid delivery looks like. Files.com evaluates the matched files against these rules when the window closes.

The rules describe file-level requirements the delivered files must meet: how many files arrive, how large they are in total, what extensions they carry, and what filenames are forbidden. Only enabled rules are evaluated.

The File Count rule specifies how many files are expected. It supports an exact number, a range, a minimum, or a maximum.

The File Size rule sets a size constraint on the combined set of matched files. It supports an exact size, a range, a minimum, or a maximum.

The Allowed Extensions rule limits which file extensions are expected. Every matched filename must satisfy this rule. Other file extensions cause the criteria to fail.

The Filename Pattern rule takes a Regular Expression (regex) pattern that every received filename must match. A regex tester is provided so you can validate your pattern. For example, to match filenames that start with "Acme" followed by an underscore and an 8-figure date (YYYYmmdd), specify a regex pattern of ^Acme_\d{8}.

The Forbidden Files rule is a glob pattern for filenames that must not appear in the matched set, such as *.tmp or *.partial. If any forbidden file is present, the criteria fail. The rule succeeds only when the listed glob patterns are not found.

The Required Files rule checks that a particular file, or subset of files, exists among the delivered files. For each required file, you can specify criteria for filename, file count, file extension, and file size. Use this rule when a batch delivery of multiple files must also include specific files among them. For example, a batch of XML files might need to be accompanied by a single manifest CSV file.

Expectation Trigger

The trigger controls how each evaluation window opens. Files.com supports multiple triggers: scheduled, interval, manual, and upload-triggered.

Custom Schedule

Custom Schedule runs an Expectation on specific days of the week.

Choose the Days of the Week and enter a Time of Day as the due time for those days.

Schedules run in the selected time zone. Selecting a Holiday Region causes the Expectation to be skipped during national holidays of that region.

Interval

Interval triggers run on a recurring cadence: daily, weekly, monthly, quarterly, or yearly. Use this trigger for Expectations that run once per period — for example, every 15th of the month.

Choose an interval (daily, weekly, monthly, quarterly, or yearly), the targeted day for the selected interval, and a Time of Day as the due time.

Intervals run in the selected time zone. Selecting a Holiday Region causes the Expectation to be skipped during national holidays of that region.

Upload

Upload-triggered windows open when the first matching file upload is detected.

The window stays open until uploads matching your scope have been quiet for the configured Inactivity Interval. There is no deadline for this trigger, so results cannot be late. This trigger suits Expectations driven by upload bursts rather than a clock.

Manual

The Manual trigger starts an Expectation on an ad-hoc basis using the Evaluate now option. Our API and SDKs can also trigger Manual Expectations.

Delivery Windows

Delivery Window specifies the duration prior to the due time that files are expected to arrive in. Files delivered before this duration are ignored when the Expectation is evaluated. The maximum length of a delivery window is 14 days.

The optional Late Window accepts expected files delivered after the due time. Files delivered during the late window cause the Expectation to be marked as "Late" rather than "Missed".

The optional Inactivity Interval is a grace period that waits for in-transit file uploads to complete when the due time occurs while uploads are still active.

Max Open Interval sets a maximum duration for the delivery window. When this duration is reached, the delivery window closes and the Expectation is evaluated. This option is only available for Upload and Manual triggers.

Scope

The scope defines which files Files.com considers when evaluating your Expectation.

The Path field specifies the folder to watch. You can select whether only this folder is watched or whether subfolders are included. The path supports globs and refers to folders, not files.

Target Pattern specifies a file glob pattern for matching files within folders, such as *.csv.

The optional Exclude Pattern specifies a file glob pattern for files that are ignored, such as *.tmp.

The combination of path, target pattern, and exclude pattern identifies which files the Expectation evaluates.

If your path glob matches multiple folders, Files.com treats all matched files as a single candidate set. It does not create separate evaluation windows per folder. If you need independent evaluations for separate partners or customers, create one Expectation per scope.