Skip to main content

Disconnect

Closes the S3 client connection and releases associated resources from memory.

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 client connection ID returned from the Connect node.

How It Works

The Disconnect node properly terminates an S3 client connection and cleans up resources. When executed, the node:

  1. Validates that the Client ID is provided and not empty
  2. Removes the client from the internal client pool
  3. Releases all associated resources from memory
  4. Completes successfully once the client is removed

Requirements

  • A valid Client ID from a Connect node
  • The client must exist in the client pool

Error Handling

The node will return specific errors in the following cases:

  • Missing or empty Client ID
  • Failed to retrieve the Client ID from the message context

Usage Notes

  • The Disconnect node should be executed at the end of your S3 automation flow
  • Each Connect node should have a corresponding Disconnect node
  • Disconnecting removes the client from memory, preventing resource leaks
  • After disconnecting, the Client ID can no longer be used for S3 operations
  • If the flow terminates unexpectedly, clients are automatically cleaned up
  • It is safe to call Disconnect on an already disconnected client (no error will occur)

Best Practices

  • Always pair Connect nodes with Disconnect nodes to ensure proper resource cleanup
  • Place the Disconnect node at the end of your flow, or in error handling paths
  • Use a Try-Catch-Finally pattern to ensure Disconnect is called even if errors occur
  • Disconnect as soon as you're done with S3 operations to free up resources
  • In long-running flows, disconnect and reconnect periodically to refresh credentials

Example Flow Structure

A typical S3 automation flow should follow this pattern:

  1. Connect - Establish S3 connection
  2. S3 Operations - Upload, download, list, etc.
  3. Disconnect - Clean up connection

Example:

Try Block:

  • Connect node (outputs: client_id)
  • Upload Object node (uses: client_id)
  • Download Object node (uses: client_id)
  • List Buckets node (uses: client_id)

Finally Block:

  • Disconnect node (uses: client_id)

This ensures the connection is always cleaned up, even if errors occur during S3 operations.

Inputs Example

Client Id: 550e8400-e29b-41d4-a716-446655440000 (from Connect node)

After execution, this client connection will be removed from memory and can no longer be used.