Setting up PostgreSQL in n8n
This guide walks you connecting Postgres to your n8n workflows as a database.
Prerequisites
Access to your n8n instance.
Access to PostgreSQL with admin or tool management permissions (superuser).
Step 1: Find PostgreSQL Credentials
On the GLBNXT Platform, go to Application Management on your sidebar.
Scroll through your applications until you find PostgreSQL.
Click on
Configure. This screen with your Application Details will appear:

Step 2: Open n8n
Open n8n in you Dashboard and create a workflow.

Add a PostgreSQL node to your workflow.

Step 3: Configure PostgreSQL Credentials
Double-click the first PostgreSQL node (
Create a Table)

Click underneath
Credentialand selectCreate new credential.

Enter the credentials found in Step 2. Your pop-up screen should look like this:

Click on
Save, your see the below shown notification and are now able to work with PostgreSQL in n8n.

Step 4: Use PostgreSQL in the Use Cases
Now you know how to add your credentials, try PostgreSQL out for yourself.
Open the Use Cases Page and click on
Download JSONin the column of Chat With Your Database.

Copy the URL of the page that opens up.
Open n8n in you Dashboard and create a workflow. Click on the three dots in the right corner of your screen and then on
Import from URL....

Enter the URL in the pop-up that appears.

The following workflow will show on your screen:

Click on
Open chatand type a message. To give you some inspiration we have some ready-to-use prompts:"Hey! Can you list all the tables available in my database right now and tell me briefly what they seem to be for?"
You will see the AI Agent1 node activate, fire off a background connection to your Postgres node using your credentials, and read the catalog tables to give you a list.
"I see we have a table called [insert your table name here]. Can you inspect it and tell me exactly what columns, types, and primary keys it uses?"
The agent will inspect the columns and summarize the structure for you.
"Give me a breakdown of how many records were created on each day of the week, sorted from highest to lowest."
The agent will write a raw SQL query and then hands it to the Execute a SQL query in Postgres tool to run against your database.
Troubleshooting
If your
Hostname looks like this: your-host-name:1234, then the numeric combination after : is yourPort. To successfully connect your credentials, enter your-host-name forHostand 1234 forPort.
Need help? Contact the GLBNXT support team or ask a GLBNXT agent to walk you through the setup.
Last updated
Was this helpful?