Copy work between environments#
The steps to send work from one n8n instance to another are different depending on whether you use a single Git branch or multiple branches.
If you have a single Git branch the steps to copy work are:
- Push work from one instance to the Git branch.
- Log in to the other instance to pull the work from Git. You can automate pulls.
If you have more than one Git branch, you need to merge the branches in your Git provider to copy work between environments. You can't copy work directly between environments in n8n.
A common pattern is:
- Do work in your developments instance.
- Push the work to the development branch in Git.
- Merge your development branch into your production branch. Refer to the documentation for your Git provider for guidance on doing this:
- In your production n8n instance, pull the changes. You can automate pulls.
Automatically send changes to n8n#
You can automate parts of the process of copying work, using the
/source-control/pull API endpoint. Call the API after merging the changes:
1 2 3
This means you can use a GitHub Action or GitLab CI/CD to automatically pull changes to the production instance on merge.
A GitHub Action example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16