Skip to main content

File Exists

Checks if a file exists in the specified FTP path

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

  • Session Id - The session id of the FTP connection. The ID is the output of the Connect node.
  • FTP File Path - The FTP file path to check if the file exists.

Output

  • Result - Returns true if file exists otherwise false.

This node checks if a file exists at the specified FTP path. It returns a boolean value to indicate if the file exists or not.

How It Works

The File Exists node verifies whether a file is present on the remote FTP server:

  1. Session Validation: Verifies the session ID is valid and active
  2. Path Validation: Ensures the file path is not empty
  3. File Check: Queries the FTP server for file existence
  4. Result Output: Returns boolean true if file exists, false otherwise

Requirements

  • Active FTP session from the Connect node
  • Valid file path on the FTP server
  • Read permissions on the remote directory
  • Network connectivity to the FTP server

Error Handling

Error CodeDescriptionCause
Core.FTP.FileExists.ErrOnCreateConfig parse errorNode configuration is malformed
Core.FTP.FileExists.OnMessageMessage parse errorInput message cannot be parsed
Core.FTP.FileExists.ErrSessionSession id can not be emptySession ID input is empty
Core.FTP.FileExists.ErrSessionInvalid sessionSession ID does not exist or has expired
Core.FTP.FileExists.ErrPathPath can not be emptyFile path input is empty
Core.FTP.FileExists.ErrorFile check errorFailed to check file existence (details in error message)

Usage Examples

Example 1: Check Before Download

// Input:
// Session ID: "ftp-session-123"
// FTP File Path: "/reports/daily-report.pdf"
//
// Output:
// Result: true or false
//
// Use in If condition to download only if file exists

Example 2: Conditional Processing

// Workflow:
// 1. Check if file exists at "/processing/data.csv"
// 2. If exists (Result = true):
// - Download and process the file
// 3. If not exists (Result = false):
// - Log message or skip processing

Example 3: Avoid Duplicate Uploads

// Before uploading:
// 1. Check if file already exists on server
// 2. If exists:
// - Skip upload or rename file
// 3. If not exists:
// - Proceed with upload
//
// Prevents overwriting existing files

Usage Notes

  • The node does not distinguish between files and directories (both return true if they exist)
  • Returns false for non-existent paths without throwing an error
  • File path is case-sensitive on most FTP servers (especially Unix/Linux)
  • Some FTP servers may restrict file listing in certain directories
  • The check is performed at the moment the node executes (file may change immediately after)
  • Use forward slashes (/) in file paths regardless of server OS

Tips

  • Use this node before download operations to prevent errors
  • Combine with If/Else nodes for conditional workflows
  • Check file existence before attempting to delete files
  • Use in loops to filter existing files from a list
  • Implement retry logic for files that should exist but might be delayed
  • Consider timing in workflows where files are created by other processes
  • Cache results temporarily if checking the same file multiple times
  • Use for implementing idempotent file operations