Do I need persistent storage?

I’m currently setting up n8n for one of our teams. For that I’m using ECS to host the container and RDS to host a Postgres instance. I am providing my own encryption key via the environment. Everything is being configured via environment variables.

Since I am not using a tunnel, not using SQLite and providing my own encryption key it seems to me that I don’t have to go trough the trouble to setup persistent storage for my containers? Or is there something else that is being stored on the filesystem?

1 Like

Welcome to the community @Frank!

Yes, you are totally correct. If you use an external database and provide all other information (esp. the encryption key) via environment variables there is no need for persistent storage.

1 Like

Thanks for your quick reply @jan!

Glad to hear that I don’t need any persistent storage for n8n with my current setup. With ECS Fargate that’s shown to be a bit troublesome.

1 Like

Could you please, advice - what is the list of all environment variables that are required to make sure it runs smoothly without persistent storage (except for encryption key)?

Hey @alexander-potemkin!

Welcome to the community :sparkling_heart:

You can find the information on configurations here: Configuration | Docs

1 Like

The only data for which the persistent storage does get used in a production setup is the encryption key (environment variable N8N_ENCRYPTION_KEY) and the SQLite database. So if you use another database, literally the only thing that is different running n8n without persistent storage is that the encryption key.
So you can simply check out the documentation which @harshil1712 linked above and set the rest according to your needs.

But other important ones you probably want to set are:

EXECUTIONS_PROCESS
GENERIC_TIMEZONE
N8N_BASIC_AUTH_ACTIVE
N8N_BASIC_AUTH_PASSWORD
N8N_BASIC_AUTH_USER
N8N_HOST
N8N_PORT
N8N_PROTOCOL
EXECUTIONS_DATA_MAX_AGE
EXECUTIONS_DATA_PRUNE
WEBHOOK_TUNNEL_URL

Obviously also the ones for the database you want to use:

2 Likes

Thank you, that’s a lot of help!

1 Like

You are welcome. Have fun!

1 Like

Let me make sure I understand:

If I have a workflow that saves something to the filesystem, the backup flows to github or a workflow that writes a json file for config for example, and I am running with multiple servers each with worker nodes in queue mode, I don’t need each server to have the same persistent shared directory?

Does each workflow get executed in queue mode on the same worker or does each node get distributed to different workers?

Hey @bcromie,

Welcome to the community :tada:

If you are having a workflow that writes to a local file you would need to make sure that n8n can access it. If you had multiple workers the jobs would be picked up by whichever instance is free at the time so you would need to make sure each instance has access to the location you are working on.

Thanks Jon!

Makes sense.

1 Like