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:
- Session Validation: Verifies the session ID is valid and active
- Logout Operation: Sends logout command to the FTP server
- Connection Closure: Closes the network connection
- 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 Code | Description | Cause |
|---|---|---|
| Core.FTP.Disconnect.ErrOnCreate | Config parse error | Node configuration is malformed |
| Core.FTP.Disconnect.OnMessage | Message parse error | Input message cannot be parsed |
| Core.FTP.Disconnect.ErrSession | Session id can not be empty | Session ID input is empty |
| Core.FTP.Disconnect.ErrSession | Invalid session | Session ID does not exist or has expired |
| Core.FTP.Disconnect.ErrLogout | Logout error | Failed 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
Related Nodes
- Connect - Establish FTP connection
- Upload - Upload files before disconnecting
- Download - Download files before disconnecting
- List Directory - List files in session
- Delete File - Delete files before closing
- Move File - Move files in session