Skip to main content

Wait for File job

In briefA Wait for File job holds a workflow until a file appears at a path on a Universal Agent machine. It can also wait until the file is big enough, new enough and has stopped changing. It checks again on a fixed interval, and gives up after one hour. It is a built-in job type, so it needs no plugin and no connection.

WhereIn Design › Workflows, open a workflow and open the job in the Job Editor (open its context menu on the canvas › Edit Job). On the Job Definition tab, choose Wait for File as the job type, set the fields under Job Parameters, and pick a Universal Agent under Agent Assignment. The job output lists each check, so it shows which test a waiting job has not yet passed.

WhenUse a Wait for File job when:

  • a later job needs a file that another system drops on the agent machine;
  • the file is written slowly, and the next job must not read it half-written;
  • a trigger file should be used once and then removed.

On a legacy LSAM machine, use that machine's own file-arrival job type instead — see Wait for a file to arrive.

How

  1. Choose Wait for File as the job type and set File Path to a path inside a directory the agent allows.
  2. Set Minimum File Size (bytes), Maximum File Age (seconds) or Stable For (seconds) if the file must meet them.
  3. Set Fail on Timeout off only if the workflow should go on without the file.
  4. Assign the job to a Universal Agent and save.

For the full steps, see Wait for a file before your workflow continues.

Notes
  • The wait is always one hour at most. No setting changes it. Fail on Timeout only decides whether the hour ends in failure or success.
  • The checks run in a fixed order: the path is a file, then minimum size, then maximum age, then stability. A size change starts the stability timer again.
  • With Delete After Detection on, the file is removed once every check passes.
Watch out
  • A path outside the allowed directories fails at once. By default the allowed directories are the temp directories and the agent's working directory. Setting OPCON_ALLOWED_FILE_PATHS on the agent replaces that list rather than adding to it.
  • A Maximum File Age (seconds) that is too short means an old file never passes, and the job waits the full hour.
  • Without Minimum File Size (bytes) or Stable For (seconds), the job can pass on a file that is still being written.
  • Kill does not stop the wait on a Universal Agent.