Skip to main content

Disconnect

Disconnects from the Claude API and releases the client session created by the Connect node.

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 Claude client session identifier from the Connect node that you want to disconnect.

How It Works​

The Disconnect node cleans up resources by removing the stored Claude client session. When executed, the node:

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

Requirements​

  • A valid Connection Id from a Connect node

Error Handling​

The node will return specific errors in the following cases:

  • Empty or missing Connection Id
  • Connection Id that doesn't exist (already disconnected or invalid)

Usage Notes​

  • The Disconnect node should be executed after all Claude operations are complete
  • Once disconnected, the Connection Id cannot be used anymore
  • If you need to make more Claude API calls after disconnecting, you must create a new connection with the Connect node
  • It's a best practice to always disconnect when you're done to free up resources
  • Use this node in a Finally block or at the end of your flow to ensure cleanup happens even if errors occur

Best Practices​

  • Always pair each Connect node with a corresponding Disconnect node
  • Place the Disconnect node in a Finally block to ensure it runs even if errors occur
  • Don't reuse a Connection Id after it has been disconnected
  • For flows with multiple Claude operations, use a single Connect at the start and Disconnect at the end

Example Flow​

1. Connect → (Connection Id)
2. Generate Text (using Connection Id)
3. Generate Chat Text (using Connection Id)
4. Analyze Document (using Connection Id)
5. Disconnect (using Connection Id) ← Clean up when done

Example with Error Handling​

Try:
1. Connect → (Connection Id)
2. Generate Text (using Connection Id)
3. Other Claude operations...

Finally:
4. Disconnect (using Connection Id) ← Always runs, even if errors occur