Hello. Suppose you have several clients using n8n, each with a large number of workflows. n8n is developing fast enough. And my question is about updating workflows. The task is to update n8n from old versions (0.1xx or 0.2xx) to the latest - 1.9.
It is known that in the new versions of n8n, there are differences in workflows. Some of them are:
- Manual Trigger is used instead of Start.
- Code node is used instead of Function and Function item.
- Changed the syntax of expressions inside Code node.
What are the recommendations from the n8n team for updating workflows?
Will workflows be updated automatically when n8n is updated? at least partially - what can be automatically updated.
What are the recommendations for switching from Function and Function Item to Code node? Will expressions from old versions work on new ones? An example of an old expression:
$node['node name'].json. Example of a new one:
I’m wondering the same question
As I know it still has a backward compatibility, so the earlier Function (item) nodes will work, but you or your clients will need to rewrite the code with the new nodes to avoid any problems in the future.
General advice: Deploy secondary n8n, copy the workflows there, and update the n8n. Then checks that everything is working
So generally if we make a change to a node that may break previous functionality we will create a new version so if you were to add that node to your workflow you would get the latest version but previous versions would stay on the older version until you replace the node.
There are nodes that we have removed as well like Cron, Interval, Function, Function Item and the HTML Extract node, If you a workflow using these nodes they will continue to work and if you wanted to you can copy / paste those nodes into new workflows you just can’t add them from the nodes panel.
As we don’t really delete anything there is no real need to update them unless we mention something in the breaking changes list which can be found here: https://github.com/n8n-io/n8n/blob/master/packages/cli/BREAKING-CHANGES.md
When it comes to v1 though we figured as it was a major version change we would make a lot more breaking changes to fix some things that have been bugging us for a while, Because of that we do have this migration guide if you are going from pre v1 to v1: n8n v1.0 migration guide | n8n Docs
With Function node to Code node changes there are some syntax differences and I don’t think we ever actually put a guide together for it but for most changes it is fairly quick annoyingly I don’t have any examples to hand at the moment.
Typically if you are using any software in a production environment I would recommend having a test environment somewhere just so that you can test updates before possibly breaking anything important so the advice from @barn4k is pretty solid.
Let me know if I missed anything.