ClickHouse icon

ClickHouse

Query and ingest data into ClickHouse

Actions2

Overview

This node integrates with ClickHouse, a columnar database management system, allowing users to either execute SQL queries or insert rows into a specified table. The "Insert" operation is designed to ingest data by inserting multiple rows into a chosen table within the ClickHouse database.

Common scenarios for this node include:

  • Bulk importing data from other sources into ClickHouse tables.
  • Automating data ingestion workflows where new records need to be added continuously.
  • Integrating ClickHouse as a data sink in ETL pipelines.

For example, you might use this node to insert product information collected from an e-commerce platform into a ClickHouse table named "product" for analytics purposes.

Properties

Name Meaning
Table name The name of the ClickHouse table where the data rows will be inserted. Supports expressions.

Output

  • For the "Insert" operation, the node does not produce any JSON output data because its purpose is to send data into the database.
  • If the node were used with the "Query" operation (not requested here), it would output an array of JSON objects representing each row returned by the query.
  • The node does not output binary data.

Dependencies

  • Requires access to a ClickHouse database instance.
  • Needs credentials including host URL, database name, username, and password to connect.
  • Uses the official ClickHouse client library (@clickhouse/client) for communication.
  • The user must configure these credentials securely within n8n.

Troubleshooting

  • Connection errors: If the node cannot connect, verify that the ClickHouse server URL, database, username, and password are correct and accessible from the n8n environment.
  • Insert failures: Ensure the target table exists and the input data matches the table schema. Mismatched columns or data types can cause insertion errors.
  • Empty input data: If no input data is provided to insert, the node will attempt to insert an empty array, which may result in no action or an error.
  • Permission issues: The database user must have INSERT privileges on the target table.
  • Error messages: Errors thrown by the ClickHouse client typically include details about connection problems or SQL syntax issues. Review these messages to adjust credentials or data accordingly.

Links and References

Discussion