Help: Can't connect n8n Postgres Account to my Supabase PostgreSQL database

Hi everyone,
I’m currently trying to set up Postgres Chat Memory in n8n using a Supabase Postgres database, but I can’t get it to work and I’m stuck.
The screenshots show what I’ve done so far.
The credentials save, but I get an error notification.
Any help would be greatly appreciated. Thanks in advance!

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Sanders_Rohling_Immo , welcome to the n8n community :tada: !
Could you please share “more details” about the message in red that appears?
Are you using port 5432 or 6543?

Hi @tamy.santos , thanks for your fast reply :slight_smile: . I am using port 6543.

Hi @Sanders_Rohling_Immo Welcome!
What you are trying to do can be done and there is no bad about it, but i recommend using official SUPABASE nodes within n8n to perform any action related to supabase, they are more easy to setup and does not require much effort and can be get going in minutes.

Hi @Anshul_Namdev thanks! I am trying to set up a chat memory. It seems that Supabase is not offering a special node that I can use in an AI agent.

@Sanders_Rohling_Immo Understood. Please consider REVOKING your credentials and then trying again to setup the PostgrSQL Memory, let me know if this works as revoking them would refresh the settings on both ends.

@Anshul_Namdev Do you mean revoking the database passwort? If yes I already thried it but it did not work.

@Sanders_Rohling_Immo No, I didn’t mean revoking the database password. What I meant is that you should revoke/refresh your n8n API/connection credentials for Supabase (the Postgres credentials inside n8n) and then reconnect them, so the connection settings get refreshed on both sides.

@Sanders_Rohling_Immo
Happy to help. Just to confirm, have you already checked if SSL is enabled in the Postgres credentials in n8n? You can find it under Postgres Credentials, then Additional Options, and SSL.

@Anshul_Namdev Got you. Unfortunately it did not work. Same error message as before.

@tamy.santos I have created new credentials trying to first set the SSL to allow and then to required. Unfortunately both did not work.

So, my concern now is the changes you made that caused an error in something that could be the solution. I recommend making a checklist and validating all the steps, one at a time.

Hi @Sanders_Rohling_Immo ,

Open your Postgres Credential in n8n.

  1. Set SSL to Allow.
  2. (Recommended) Change Port to 5432 and update the Host to the direct connection string found in Supabase under “Session” mode.

@Sanders_Rohling_Immo I guess now try using supabase’s Postgres connection string (host, port 5432, database, user, password, SSL required) directly in the n8n Postgres credential and select that in the Chat Memory node instead of any Supabase API keys. Let me know if this helps.

I tested all the changes with revoked credentials to make sure I do not cause an additional error.

Hi, thanks but the same error appears.

I dont exactly know what you mean. Could you please elaborate? Should I use it in the same view i send the screenshots of?

Let me elaborate that: Use a Postgres credential in n8n with your Supabase DB details, not any Supabase API key.

In Supabase settings > database, copy the Postgres connection string and map it like this in n8n’s Postgres credential:

  • Host: db.someHost.supabase.co

  • Port: 5432

  • Database: postgres

  • User: postgres

  • Password: your Supabase DB password

  • SSL: Require

Save and Test this Postgres credential, then select it in the Postgres Chat Memory node. If the test still fails, share the full error message and a screenshot of that Postgres credential (with password hidden). This will give us more context to see what exactly is the error

The Error: "No testing function found for this credential." is not a connection failure. It simply means that n8n’s “Test Connection” button logic does not exist for this specific type of Postgres setup. The button itself is failing, but your credentials might actually be correct
**
Step 1: Ignore the Test Button**

  1. Close the credential window (click “X” or “Save” if allowed).

  2. Execute the Node directly in your workflow (click “Execute Step”).


Step 2: The “IPv6” Trap (If execution fails)

If you try Step 1 and the node spins forever or errors out with “ETIMEDOUT”, you are hitting the Supabase IPv6 issue.

  • The Problem: You are using the Direct URL (db.aaqac...). This URL is IPv6 only. Most Docker containers (self-hosted n8n) do not have IPv6 enabled by default, so they cannot reach this address.

  • The Fix: You must use the Supavisor (Pooler) URL, but in Session Mode.

How to get the correct IPv4-compatible settings:

  1. Go to Supabase → Connect.

  2. Change Mode to Session (this is critical).

  3. Copy the Host: It should look like aws-0-[region].pooler.supabase.com (NOT db.aaqac...).

  4. Copy the Port: It should be 5432 (NOT 6543).
    Try Step 1 first. If that fails, apply Step 2.

1 Like

I

It is correct that I have to choose connect at the top?

After it I use the direct connection? Its the only option that gives me “postgres” as the user.

If i do it like that I receive this error. If i run the workflow the node outputs this error: