CrateDB Table Setup and Data Population Automation - n8n Workflow

Use this structured n8n workflow to automate table creation and insert initial data into CrateDB. A crucial n8n template for consistent database deployment.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Database Administrators managing CrateDB environments.
Engineers needing a reliable n8n workflow for deploying repeatable database schemas.
Users looking to learn advanced data preparation techniques using the Set n8n node.
Developers exploring database integration using official n8n templates.

Overview

This n8n workflow provides a critical automation step for any project requiring structured CrateDB interaction. It solves the common problem of manual initial setup by automating both the schema definition and the first data entry. Utilizing the CrateDB n8n node, the workflow first executes a DDL command (CREATE TABLE) and then seamlessly transitions to data manipulation using the powerful Set n8n node to prepare structured input. Finally, it uses a second CrateDB n8n node to perform the data insertion. This reliable sequencing ensures that the database is ready for application use immediately after the n8n trigger is activated. This n8n template showcases effective core logic flow control.

How it Works

This structured n8n workflow executes a reliable sequence of database operations, beginning with a manual start which acts as the primary n8n trigger.


  1. Initialization (n8n Trigger): The workflow begins when executed manually via the "On clicking 'execute'" n8n trigger.

  2. Schema Creation: The first CrateDB n8n node immediately executes a raw SQL query (CREATE TABLE test (id INT, name STRING);). This ensures the necessary table structure exists before attempting data insertion.

  3. Data Structuring: The Set n8n node receives the flow and prepares the exact dataset required for insertion. It creates a simple data item defining id as 0 and name as n8n. This step demonstrates how to prepare structured payloads within an n8n workflow.

  4. Data Insertion: The subsequent CrateDB n8n node uses the input structured by the Set node and performs an insert operation, targeting the test table and mapping the id and name columns. This completes the fully automated process of setting up the table and inserting baseline data, making this a powerful n8n template.

Installation Guide

To deploy this useful n8n workflow, follow these steps:


  1. Import: Copy the entire JSON definition and import it into your n8n instance via the "New" menu -> "Import from JSON".

  2. Credentials Setup: Configure the required CrateDB credentials. Both CrateDB n8n node instances rely on the placeholder cratedb_creds. You must edit or create a new CrateDB credential set linking to your active database instance.

  3. Execution: Since this n8n template uses a manual n8n trigger, click the "Execute Workflow" button to run the sequence and verify that the test table is created and populated within your CrateDB.

Node Details

On clicking 'execute' (Manual Trigger n8n trigger):
Function: Serves as the initial execution point for this specific n8n workflow, suitable for testing and one-off setup tasks.
Key Configuration: Standard manual n8n trigger setup.
CrateDB (n8n node):
Function: Handles the creation of the required database schema.
Key Configuration: operation: executeQuery, using the query CREATE TABLE test (id INT, name STRING);.
Set (n8n node):
Function: Prepares a structured data payload, defining the exact data to be inserted in the next step. Essential for robust data handling in an n8n workflow.
Key Configuration: Sets the values id=0 (Number) and name='n8n' (String).
CrateDB1 (n8n node):
Function: Inserts the prepared structured data into the test table.
Key Configuration: operation: insert, targeting table: test, and specifying the columns: id, name for correct mapping.

Related n8n Workflows

Free

Nodes: 3 Nodes
Updated: December 26 2025
View all
Created by
amudhan
amudhan

Featured*