Help Needed: n8n is not saving workflows to Postgres on Render

:police_car_light: Help Needed: n8n is not saving workflows to Postgres on Render

Hi all, I’m trying to self-host n8n on Render.com, and I’ve set up a Postgres database, but workflows are still not saving to it. After every restart, everything is lost.

Here’s what I’ve done:

:white_check_mark: Configured render.yaml with these environment variables (scrubbed passwords):

services:

  • type: web
    name: n8n
    runtime: docker
    env: docker
    plan: free
    envVars:
    • key: N8N_BASIC_AUTH_ACTIVE
      value: true
    • key: N8N_BASIC_AUTH_USER
      value: <REDACTED_EMAIL>
    • key: N8N_BASIC_AUTH_PASSWORD
      value: <REDACTED_PASSWORD>
    • key: DB_TYPE
      value: postgresdb
    • key: DB_POSTGRESDB_DATABASE
      value: n8n_vlsv
    • key: DB_POSTGRESDB_HOST
      value: <REDACTED_HOST>
    • key: DB_POSTGRESDB_PORT
      value: 5432
    • key: DB_POSTGRESDB_USER
      value: <REDACTED_DB_USER>
    • key: DB_POSTGRESDB_PASSWORD
      value: <REDACTED_DB_PASSWORD>
    • key: DB_POSTGRESDB_SCHEMA
      value: public
    • key: N8N_RUNNERS_ENABLED
      value: true
    • key: N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS
      value: true

:white_check_mark: I redeployed the service
:white_check_mark: Logs show Postgres accepts connections
:white_check_mark: I created workflows in the UI
:cross_mark: But when I check via psql, I get:

ERROR: relation “workflow_entity” does not exist

I suspect n8n is silently falling back to SQLite, but I can’t figure out what’s wrong. Any guidance or known fixes?

Thanks in advance!

Hey @LoveCurrency,

I see that you mentioned you’re using the free instance of Render.

  • Render’s free instance always shuts down after 15 minutes of inactivity.
  • That’s why, when you restart the server, it starts fresh and doesn’t retain any saved workflows.

For this use case, I recommend using an external Postgres database instead of the one provided by Render itself.

Why?

  • Because in this case, even if your instance becomes inactive, when you restart the server, it will reconnect to the same external database with all your saved data.

How to do this?

  • The easiest and free way is by using Supabase. Create a database there and get the credentials.

:light_bulb: Pro tip: Set the Supabase project’s region to the same region where you’ve deployed n8n on Render for better performance.

  • Next, just replace the Postgres database-related environment variables with the ones you get from Supabase.

That’s it…hope it helps!

Still, if you need any help or would like a detailed guide on setting up n8n on Render, let me know. I’ll write up a step-by-step document and share it here.

Sudhanshu

For anyone else who finds this post/thread re: render.com’s free/hobby tier services, also be aware that Render will expire the postgres instance after 30 days, and then hold your n8n instance data hostage, only allowing you to get the data back in exchange for an upgrade to a paid plan. You have to dig a bit (scroll down, expand the detailed info, and notice the subtle parenthetical note - screenshot below) to find the “30 day limit” on their pricing page. IMO, this database instance “expiration” is an even more compelling reason to configure n8n’s database somewhere NOT on Render if what you want is a free/experimental hosted instance. Given how buried this information is regarding the significant “gotcha” limitation on the “free” service, (i.e. drug-sample tactic), I would be reluctant to use Render at all.