Skip to main content

Connect

Establishes a connection to a ClickHouse database server using credentials.

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.

Options

  • Credentials - Database credentials containing server, port, database, username, and password for the ClickHouse server.

Output

  • Connection Id - A unique identifier for the established database connection.

How It Works

The Connect node establishes a connection to a ClickHouse database using the provided credentials. When executed, the node:

  1. Validates that database credentials are provided
  2. Extracts connection parameters (server, port, database, username, password) from the credentials
  3. Creates a new ClickHouse connection with optimized settings:
    • LZ4 compression for efficient data transfer
    • 30-second connection timeout
    • 60-second query execution timeout
    • Optimized buffer sizes for batch operations
  4. Tests the connection with a ping
  5. Generates a unique connection ID and stores the connection
  6. Returns the connection ID for use in subsequent operations

Requirements

  • Valid ClickHouse server hostname or IP address
  • Valid port number (default: 9000)
  • Valid database name
  • Valid username and password credentials
  • Network access to the ClickHouse server

Error Handling

The node will return specific errors in the following cases:

  • ErrInvalidArg - Database credentials are required or server hostname is missing
  • ErrConnection - Cannot connect to ClickHouse server (connection timeout, invalid credentials, server unreachable)

Usage Notes

  • The connection ID should be stored and used in subsequent ClickHouse operations
  • Connections should be properly closed using the Disconnect node when no longer needed
  • The default port for ClickHouse is 9000 (native protocol)
  • The connection uses LZ4 compression automatically for better performance
  • All queries executed on this connection will have a maximum execution time of 60 seconds

Credential Configuration

To create a ClickHouse Database credential:

  1. In Robomotion, go to Credentials section
  2. Create a new credential of type "ClickHouse Database"
  3. Fill in the required fields:
    • Server: Hostname or IP address (e.g., "localhost", "192.168.1.100")
    • Port: Port number (default: 9000)
    • Database: Database name (e.g., "default", "analytics")
    • Username: ClickHouse username (e.g., "default")
    • Password: ClickHouse password

Example

Scenario: Connect to a ClickHouse analytics database

Options:

  • Credentials: Select your stored ClickHouse Database credential

Output:

Connection Id: "550e8400-e29b-41d4-a716-446655440000"

This connection ID can then be used with other ClickHouse nodes like Execute Query, Execute Non Query, or Create Batch.

Best Practices

  • Store your ClickHouse credentials securely using Robomotion's credential management
  • Use a single Connect node at the beginning of your flow
  • Always pair Connect with Disconnect nodes to properly clean up resources
  • For multiple database operations, reuse the same connection ID
  • Use descriptive names for your credential configurations to easily identify different ClickHouse servers
  • Consider using read-only credentials for query-only operations

Common Use Cases

  • Analytics Automation: Connect to ClickHouse to extract analytics data and generate reports
  • Data Pipeline: Establish connection as part of an ETL process
  • Real-time Monitoring: Connect to query real-time metrics and event data
  • Data Integration: Connect to insert data from external sources into ClickHouse tables