Unable to connect Supabase from n8n workflow (working from my local MAC)

Describe the problem/error/question

I have installed n8n on my Mac (Docker) and trying to connect to my Supabase RAG and connection has failed. As required in “Host” I copied from Supabase (Project Settings >> Data API) which looks like “https://bmactddfrfrmvegzlrvt.supabase.co/rest/v1/” and in “Service Node Secret” I used the API Keys from Settings >> API Keys (Supabase) and the same looks like “sb_secret_x7O7Ea-PvGcWd_0MNMdgdQ_tsE7IkIH”. This one I used the Secret Keys and not Publishable keys. However, I get “Could not connect with these settings. More details”. When I clicked on More details link I got “The resource you are requesting could not be found”.

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 @subroto, welcome!

The 404 is coming from your Host field. n8n adds the /rest/v1/ part itself, so when you include it the path doubles and Supabase returns “resource not found.” Set Host to just the base project URL, like https://your-project.supabase.co with nothing after the .co, and the connection should go through.

Also, and this matters: rotate that secret key. You pasted a live sb_secret key in your post, so anyone reading this can use it. Generate a new one in Supabase and swap it in.

Your welcome! Feel free to mark one of the replies as the solution and have a good day!

Thanks a lot. I tried out your suggestion and was successful.
Thanks and Regards,

I switched to n8n self-hosted (Hostinger) and tried out the steps. (a) On Supabase, I have removed the Project and recreated a new one (b) Created “documents” and ran ‘select schemaname from pg_tables where tablename = ‘documents’ limit 100;’ >> which returned ‘public’ (c) Setup Credential from n8n (for Supabase Vector Store) successfully. (d) Ensured Extension for vector is enabled.
However, the table name is still not coming up, was expecting to find ‘documents’ (I continue to get 404). Thanks

@subroto good, the credential saved cleanly so the Host is right this time, the 404 is now the table layer, not the connection. Two causes:

  1. PostgREST schema cache. Supabase’s Data API caches the schema, so a freshly-created table 404s until it reloads. Run in the SQL editor: NOTIFY pgrst, ‘reload schema’; (or wait a minute / restart the project), that usually makes documents appear.

  2. A bare table isn’t enough. The Vector Store needs documents with id, content, metadata, embedding vector(N) columns plus a match_documents function. Run the SQL from the Supabase vector-store quickstart (linked in the node docs), set Query Name to match_documents, and match the vector dimension to your embedding model (1536 for OpenAI small/ada).

Also, the node ignores a custom table name and always uses documents, so keep it named exactly that.

Hey @subroto, just to add to what @achamm said on the Vector Store setup.

When you run the Supabase quickstart SQL, make sure the vector dimension matches your embedding model exactly. A mismatch e.g. using vector(1536) but your model outputs vector(3072) will silently fail or return a 404 on insert. Double-check your model’s output dimension before running the setup script.

Also worth confirming: the match_documents function needs to exist in the public schema, if it ends up in a different schema, n8n won’t find it even if the table is correct.

Once those are in place, do a quick NOTIFY pgrst, ‘reload schema’; as achamm suggested and you should be good to go!

Thanks!
Will check that out.