Disconnect
Closes an established connection to the OpenAI API service and releases associated resources.
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 the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Connection Id - The connection identifier from the Connect node that you want to close.
Options
This node does not have any options.
Outputs
This node does not produce any output variables.
How It Works
The Disconnect node properly closes an OpenAI connection. When executed:
- Validates that a connection ID was provided
- Locates the active connection
- Closes the connection and releases resources
- Removes the connection from the active connection pool
Usage Example
1. After completing all OpenAI operations
2. Add a Disconnect node
3. Set Connection Id input to the connection_id from your Connect node
4. The node will close the connection cleanly
Requirements
- A valid connection ID from a Connect node
- The connection must still be active (not already disconnected)
Error Handling
The node will return errors in these cases:
- ErrInvalidArg: Connection ID is empty or invalid
- Connection not found: The connection ID doesn't exist or was already closed
Tips for RPA Developers
- Always use Disconnect to close connections properly, even though connections auto-close at flow end
- Place Disconnect nodes after all OpenAI operations are complete
- Use a Finally block or error handler to ensure connections are closed even if errors occur
- Multiple Disconnect calls for the same connection ID are safe (subsequent calls do nothing)
- Disconnecting early frees up resources for other workflows
Common Errors and Solutions
Error: "Connection Id cannot be empty"
- Solution: Ensure you've passed the connection_id from a Connect node to this Disconnect node
Error: "Connection not found"
- Solution: The connection ID is invalid, or the connection was already closed. Check that you're using the correct connection_id variable