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?
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.
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)?
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:
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?
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.