Using Version Control in n8n

We have a server. Or we just got one. Now we want to install n8n on it. We opened the documentation. It says one of the best methods for this is Docker. It even provides a docker-compose yaml snippet to get started. We accept it. We excitedly add it and start. Everything is going well when the need to use a database arises. We go back to the server. We update our docker-compose. Then, whenever we need something, we find ourselves in front of the nano/vim editor on the server. Now adding something new is almost impossible.

Let’s say this system has two separate systems called preprod-prod. Does that mean two different dockers with two different configurations? Unfortunately, yes. Wait, weren’t pre-prod and prod supposed to be equivalent systems with the same configuration but different data loads on two separate systems? That equivalence also went in the trash. What’s left? Nothing. So what’s the solution? Going back to the beginning…

Before Setting Up the System

Before setting up the system - this can be any docker or system, doesn’t have to be n8n - your first task should be “git init”. Of course, if you’re using git. You could use Mercurial or SVN. But why use version control when this isn’t code? That’s exactly why it’s called “VERSION CONTROL” - anything that will definitely host more than one change somewhere and has the possibility of working in more than one place MUST have version control. Otherwise, you become the controller of the version you have.

A Bit of Self-Criticism

When n8n came out, I didn’t understand it at first. It seemed like a Knime-like structure to me. But the existence of n integrations inside excited me so much that I forgot rule number 1 and went directly to installation. What I should have done was git init and define the subdirectories within the main folder as submodules.

Final Word…

The best motto when starting a job is to work thinking about the medium-term. Neither think short-term and work disorganized, nor think long-term and lose motivation by designing a scalable system for a job that hasn’t even started yet.