Create way to migrate json config via API

Being able to save configuration to version control and have reproducible builds is important for modern workflows (CI/CD systems, etc). For example, I develop some n8n workflows on my local environment. I should have an option for n8n to automatically save the json configs to file so that they can be checked into version control. And when I promote to staging/production, I should be able to manually or programmatically run a migration task that reads in these files and sets up the exact state as development (with the ability to read in environment specific values). This would allow you to roll back to specific versions of a n8n workflow. For example, I might be running the latest iteration of my n8n workflows on staging for testing purposes while a version behind on production. Having this type of feature is essential for modern application development and deployment and would also help differentiate n8n vs some of the other options.

References:

This would be fantastic.

As I consider running n8n in production, I’d love a workflow like this:

  • Make updates locally
  • Commit those changes
  • Push to version control
  • Updates deployed automatically to prod via a GitHub action or other CI tool

It seems like I’d have to write a lot of custom code to do this today.

1 Like

@karllhughes
@jan
Hi,

I developed a python script to take workflows from one environment to another using http://xx:5678/rest/workflows/ and http://xx:5678/rest/workflows/ID and saved the information into workflow_entity into the target environment. When I run on the target environment, workflow nodes, and connection is missing though it shows in the sqlite table. Am I missing anything in pushing workflows from one environment to another?

Version control and deployment implementation of the workflow with ci/cd are things that are really missing!