Skip to main content

Wait File

Checks if file at given path is exist or not.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

if ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.

Input

  • Path - The path of the file/directory that will be checked whether exist or not.

Options

  • Condition- Two conditions can be specified.
    • To Exist: Waits till file/folder show up.
    • Until Deleted: Waits till file/folder is deleted.
  • Timeout- Time that shows how long it will be checked based on condition.
  • Name Filter - Optional filter pattern for matching specific files (e.g., *.txt, *.log)
  • File Properties - Select which properties to include in the output (version 23.1.0+):
    • Name - Include file/directory name
    • IsDir - Include directory flag
    • Size - Include file size in bytes
    • ModTime - Include modification time
    • CreateTime - Include creation time
    • Mode - Include file permissions/mode

Output

  • Files - Array of file information objects for files that matched the wait condition

How It Works

The Wait File node monitors the filesystem and waits for conditions through the following process:

  1. Validates that the path is not empty and timeout is specified
  2. Starts a ticker that checks every 150 milliseconds
  3. For each check:
    • If Name Filter is provided, uses filepath.Glob to find matching files
    • If no Name Filter, checks the specific path
    • For "To Exist" condition: Returns when file(s) appear
    • For "Until Deleted" condition: Returns when file(s) disappear
  4. If timeout is reached before condition is met, returns an error
  5. Returns matched file information with selected properties

Requirements

  • Valid path to check (can include wildcards if using Name Filter)
  • Timeout value must be greater than 0 (in seconds)
  • Read permissions on the directory being monitored
  • For version 23.1.0+, file properties to include can be selected

Error Handling

Error CodeDescription
Core.FileSystem.WaitFile.ErrOnCreateNode configuration parsing failed
Core.FileSystem.WaitFile.ErrOnMessageInput message parsing failed
Core.FileSystem.WaitFile.ErrPathPath is empty
Core.FileSystem.WaitFile.ErrNoTimeoutTimeout is empty or zero
Core.FileSystem.WaitFile.ErrTimeoutWait condition was not met within the timeout period

Usage Examples

Example 1: Wait for File to Appear

Wait for a report file to be generated by another process:

{
"path": "C:\\Reports\\daily_report.xlsx",
"timeout": 300
}

Configuration:

  • Condition: To Exist
  • Timeout: 300 seconds (5 minutes)

The node waits up to 5 minutes for the file to appear.

Example 2: Wait for File Deletion

Wait for a processing lock file to be removed:

{
"path": "C:\\Temp\\process.lock",
"timeout": 60
}

Configuration:

  • Condition: Until Deleted
  • Timeout: 60 seconds

Useful for coordinating between multiple automation processes.

Example 3: Wait for Any PDF File

Wait for any PDF file to appear in a directory:

{
"path": "C:\\Downloads\\",
"nameFilter": "*.pdf",
"timeout": 120
}

Configuration:

  • Condition: To Exist
  • Name Filter: *.pdf
  • Timeout: 120 seconds

Returns when any PDF file is detected in the Downloads folder.

Usage Notes

  • The node checks every 150 milliseconds for the specified condition
  • Timeout is specified in seconds
  • Name Filter supports glob patterns (e.g., *.txt, report_*.csv)
  • Name Filter is appended to the path, so ensure path ends with separator for directory checks
  • For "To Exist" with Name Filter, returns when any matching file appears
  • For "Until Deleted" with Name Filter, returns when all matching files are removed
  • For version 23.1.0+, you can select which file properties to include in output
  • The node was enhanced to support Name Filter for backward compatibility
  • File information is returned in the Files output for matched files

Tips

  • Use generous timeout values to avoid premature failures in production environments
  • Combine with error handling to gracefully handle timeout scenarios
  • Name Filter is useful for waiting on dynamically named files (e.g., timestamped reports)
  • Use "Until Deleted" to implement file-based locks and synchronization
  • Consider using Path Exists for immediate checks without waiting
  • Ideal for monitoring file drops from external systems or applications
  • Use with Loop nodes to continuously monitor for new files
  • Set appropriate timeout based on expected file generation time