Overview
This node integrates DuckDB, an in-process SQL OLAP database management system, into n8n workflows. It allows users to execute arbitrary SQL queries on DuckDB directly within their automation pipelines. This is particularly useful for data analysis, transformation, or querying structured data without needing an external database server.
Common scenarios include:
- Running complex analytical queries on local datasets.
- Transforming or filtering data using SQL before passing it to other nodes.
- Quickly prototyping data workflows with embedded SQL execution.
Example: A user can input a SQL query to select and aggregate data from a CSV file loaded into DuckDB, then use the results downstream in the workflow.
Properties
| Name | Meaning |
|---|---|
| Query | The SQL query to execute on DuckDB. This must be a valid SQL statement. |
Output
The node outputs an array of JSON objects under the json field. Each object contains a single property:
result: An array of rows returned by the executed SQL query. Each row is represented as an object with column names as keys and corresponding values.
No binary data output is produced by this node.
Dependencies
- Requires the
@duckdb/node-apipackage to interact with DuckDB. - No external database server is needed since DuckDB runs in-process.
- No special environment variables or API keys are required.
Troubleshooting
- Common issues:
- Syntax errors in the SQL query will cause the node to throw an error.
- Large result sets may impact performance or memory usage.
- Error messages:
- Errors thrown during query execution will be wrapped and reported as node operation errors.
- To resolve, verify the SQL syntax and ensure the query is valid for DuckDB.