Wait for a file before your workflow continues
Sometimes a workflow shouldn't start until the data it needs has actually landed: a nightly export from your core banking system, a file dropped by a partner, a report another team produces. The Wait for File job holds your workflow until that file is there and ready, so the work that follows always runs against complete data.
It's built in, so there's nothing to install. Add it to any workflow and point it at a file.
Without it, a workflow can start the moment it's scheduled: before the file it needs has arrived, or while that file is still being written. The job then runs against missing or half-written data, and the failure often isn't obvious until the results are wrong downstream.
Use it when
- A downstream job must not run until an upstream file arrives.
- A file is delivered on an unpredictable schedule and you want the workflow to react the moment it's ready.
- A file is written gradually and you need to be sure it's finished before processing it.
How it works
The job watches a file path and checks it on a set interval. As soon as the file exists and meets the conditions you set (size, freshness, stability), the job completes and your workflow moves on. If the file never shows up in time, you decide whether that's a failure or simply nothing to do.
Add a Wait for File job to a workflow
A Wait for File job runs as a job in your workflow. To add one, complete the following steps:
- Go to Workflows and open the workflow you want to edit.
- Add a job: on an empty workflow, select First Job; otherwise select New Job from the sidebar.
- In the job editor, select the Job Definition tab.
- Select Show Job Types.
- In the job type catalog, under Utility, select Wait for File.
- Under Job Parameters, in the File Path field, enter the full path to the file: for example,
/tmp/incoming/report.csv. - Set any optional conditions you need (see Settings).
- Select Save & Close. The job is added to the workflow and runs the Wait for File job.
Settings
| Setting | Required | What it does |
|---|---|---|
| File path | Yes | The file to watch for. It must be in a folder your administrator allows the agent to access. |
| Check interval | No | How often to look for the file. Default is every 10 seconds. |
| Minimum file size | No | Wait until the file reaches at least this size. Use it to avoid picking up an empty or partial file. |
| Maximum file age | No | Require a recent file: one modified within this many seconds. Use it when only a freshly delivered file should count. |
| Stable for | No | Wait until the file stops changing size for this long. Ideal for files still being written. |
| Delete after detection | No | Remove the file once it's found and meets every condition. Off by default. |
| Fail on timeout | No | If the file doesn't arrive in time: leave this on to fail the workflow, or turn it off to let the workflow continue. On by default. |
When the file doesn't arrive in time
The job waits at most one hour — a fixed limit on every job a Universal Agent runs, which no setting changes. If the hour passes and the file still isn't ready:
- Fail on timeout on (default): the job fails, so the workflow can alert or branch.
- Fail on timeout off: the job succeeds and the workflow simply continues.
Tips for reliable file waits
- Avoid partial files. If a file is written gradually, set Stable for (and/or a Minimum file size) so the job only completes once the file is whole. Without it, a fast workflow can grab a file mid-write.
- Only accept fresh files. Use Maximum file age when an old file left in the folder should not count, but be aware that a file older than this limit will never satisfy the job, so leave it off if any existing file is fine.
- One-and-done deliveries. Turn on Delete after detection when each file should be processed once and cleared, but leave it off if a later job in the workflow still needs the file.
- Wait for File runs on Universal Agents, on Windows, Linux, and macOS.
- The folders an agent can watch are controlled by your administrator. If a path is rejected, ask your administrator whether that location is permitted. See Prepare agents for connectors: File access.
Related topics
- Wait for File job — full configuration reference and troubleshooting
- Respond to a stuck or failed Wait for File job (Operator)