Skip to main content

Disconnect

Disconnects FTP session

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing 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 - FTP session id. The ID is the output of the Connect node.

How It Works

The Disconnect node closes an active FTP session and releases server resources:

  1. Session Validation: Verifies the session ID is valid and active
  2. Logout Operation: Sends logout command to the FTP server
  3. Connection Closure: Closes the network connection
  4. Resource Cleanup: Releases session resources from memory

Requirements

  • Valid session ID from an active FTP connection
  • Session must have been created by the Connect node

Error Handling

Error CodeDescriptionCause
Core.FTP.Disconnect.ErrOnCreateConfig parse errorNode configuration is malformed
Core.FTP.Disconnect.OnMessageMessage parse errorInput message cannot be parsed
Core.FTP.Disconnect.ErrSessionSession id can not be emptySession ID input is empty
Core.FTP.Disconnect.ErrSessionInvalid sessionSession ID does not exist or has expired
Core.FTP.Disconnect.ErrLogoutLogout errorFailed to properly close connection (details in error message)

Usage Examples

Example 1: Basic Disconnect Pattern

// Workflow:
// 1. Connect to FTP server -> Session ID: "ftp-session-123"
// 2. Upload files
// 3. Download files
// 4. Disconnect using Session ID: "ftp-session-123"

Example 2: Disconnect in Try-Catch-Finally

// Best Practice Pattern:
// Try:
// 1. Connect to FTP
// 2. Perform FTP operations
// Catch:
// - Handle errors
// Finally:
// - Disconnect (ensures cleanup even if errors occur)

Example 3: Multiple Operations Before Disconnect

// Session ID: "ftp-session-123"
// Operations:
// - List directory
// - Download 5 files
// - Upload 3 files
// - Delete old files
// Finally: Disconnect
//
// One session can handle multiple operations

Usage Notes

  • Always disconnect when FTP operations are complete to free server resources
  • Each Connect node requires a corresponding Disconnect node
  • Sessions are automatically cleaned up if disconnect fails, but explicit disconnect is recommended
  • Disconnecting an already closed session will result in an error
  • Use Finally block to ensure disconnect happens even if operations fail
  • Network interruptions may cause disconnect to fail, use Continue On Error if needed

Tips

  • Place Disconnect node in a Finally block to guarantee execution
  • Use the same Session ID variable throughout the workflow for consistency
  • Don't reuse a Session ID after disconnecting - create a new connection instead
  • Monitor for connection leaks if automations fail before disconnect
  • Set reasonable timeouts for FTP operations to avoid hanging sessions
  • Consider connection pooling for high-frequency FTP operations
  • Log successful disconnections for debugging and monitoring