Postgres: Create Table and Insert Sample Data

This workflow demonstrates creating a PostgreSQL table and inserting data using n8n's Postgres nodes. Ideal for quick database initialization in automations.

n8n
Postgres: Create Table and Insert Sample Data

This n8n workflow serves as a practical example for using the Postgres node to perform database operations. It starts with a manual trigger, executes a SQL query to create a simple table named 'test' with columns 'id' (INT, primary key) and 'name' (VARCHAR(255)), prepares sample data using a Set node (id and name='n8n'), and finally inserts the data into the table.

The benefits include rapid prototyping of database schemas, easy testing of Postgres connections, and seamless integration into larger workflows for data management. It's particularly useful for developers setting up initial database structures without manual SQL execution tools.

Use cases span IT and development scenarios such as initializing user tables for apps, seeding demo data for testing, or automating DB setup in CI/CD pipelines. With n8n's credentials management, it securely handles Docker-hosted Postgres instances, making it extensible for production environments.

$8.99
Last updated August 29, 2026
30-day money-back guarantee
Instant download
Lifetime updates included

New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.

Secure checkout powered by Stripe

Support

How to import this workflow into n8n

  1. 1Purchase or download the workflow to get the n8n workflow JSON file.
  2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
  3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
  4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

Related Human Resources workflows

More from Timo Salim

Need this deployed? We'll set it up for you.

Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.