Do you have any recommendations on setting up a testing environment before upgrading n8n in the running production ?
It looks kind of difficult to write tests since n8n’s main role is to query multiple APIs from different vendors, and you don’t want to call those APIs for real when testing, and they are all specific into how they manage data.
I was thinking:
replicate the production databases, run it in another environment where you block all outgoing API calls, and scan logs for errors. But this may not work because lots of workflow will error without the APIs properly responding.
find a way to emulate mock data and mock APIs with environment variables
find a way to set up multiple production instances, and manage a progressive switch of the loads and pending executions gradually towards the updated instance, while monitoring for errors in the logs
That is a very good question, There isn’t really a recommended approach as it can all depend on policies when it comes to updates.
I would say having a test environment and database that contains simplier workflows may be enough for most cases and you can run those and see how it goes before updating the main prod environment.
One thing that we do with Cloud that could be useful for you is we don’t make the current release available so right now 0.183.0 is the latest release but on Cloud we have 0.182.2 as the latest stable and 0.182.1 as latest beta. This won’t catch all things but if n8n is an important part of your process it could be worth thinking about.
What I did with the n8n environment I was managing was use the test option above and I would also book in an outage for the service so I can bring it up and do some tests and if needed roll back.
It will be interesting to see what others do and suggest.