Skip to main content

Disconnect

Closes the connection to Binance exchange and cleans up the client session, freeing system 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

  • Client Id - The unique identifier returned from the Connect node.

How It Works

The Disconnect node closes the Binance client session and removes it from memory.

When executed, the node:

  1. Validates that the Client Id is not empty
  2. Removes the client session from the internal client manager
  3. Frees up system resources associated with the connection

Requirements

  • A valid Client Id from a previously executed Connect node

Error Handling

The node will return specific errors in the following cases:

  • ErrInternal - Failed to retrieve Client Id from the message context
  • ErrInvalidArg - Client Id is empty or not provided

Usage Notes

  • The Disconnect node should be the last Binance operation in your flow
  • Always pair Disconnect with Connect to prevent resource leaks
  • Once disconnected, the Client Id cannot be reused
  • If you need to perform more operations, create a new connection with Connect
  • Client sessions are automatically cleaned when the flow stops, but explicit disconnection is recommended

Best Practices

  • Place the Disconnect node at the end of your Binance automation flow
  • Use it in a Finally block or after error handling to ensure cleanup
  • Don't disconnect in the middle of a flow if you plan to execute more operations
  • For long-running bots, consider periodic reconnection to refresh credentials

Example Flow

[Connect]
|
v
[Get Balance]
|
v
[Place Order]
|
v
[Disconnect]

Resource Management

The Disconnect node is important for:

  • Preventing memory leaks in long-running automations
  • Ensuring clean shutdown of flows
  • Proper resource cleanup
  • Following best practices for connection management