How to Migrate n8n Workflows from Cloud to Self-Hosted

7.9K views
•
January 14, 2026
by
Nate Herk | AI Automation
YouTube video player
How to Migrate n8n Workflows from Cloud to Self-Hosted

TL;DR

You can migrate hundreds of n8n workflows between instances with two manually run workflows. The first pulls every workflow from the old instance through the n8n API and logs each ID and name in a Google Sheet with the status 'to process'. The second reads only the unprocessed rows, fetches each workflow's JSON, creates it in the new instance and marks the row processed, so nothing gets duplicated.

Transcript

Today I'm going to be showing you guys a really easy and safe way to migrate hundreds of workflows between two NIDN instances. And in this example, I'll be going from NAND cloud to my NAND self-hosted. I'm going to give you guys everything that you need for free to do this migration. So first I'm just going to walk through exactly how this workflow... Read More

Key Insights

  • Migrating n8n workflows between instances uses only three node types: the n8n node, Google Sheets nodes and a loop. They are split across two manually executed workflows, one for exporting and one for importing.
  • Logging workflows in a Google Sheet before migrating is the key to a safe transfer. A status column records which workflows have moved and which have not, so no workflow is copied many times and the new instance stays clean.
  • Each n8n instance needs its own API key, created under Settings, then n8n API, then Create API key. The key can be set to expire, for example after 30 days, or to never expire.
  • The base URL in an n8n API credential must be the instance URL followed by /api/v1. When pasting the URL, check that it does not end up with two slashes before the api path.
  • An n8n workflow is a large JSON object behind the scenes. It holds the name, nodes, parameters, connections, settings, versions, created and updated timestamps and whether the workflow is active.
  • The import workflow filters Google Sheet rows on a status of 'to process'. Only workflows not yet migrated are pulled in, and marking a row processed by hand removes it from the next run.
  • The 'get workflow' operation on the n8n node looks up each workflow by ID in the old instance. This returns the full JSON needed to rebuild that workflow in the new instance.
  • The 'create workflow' operation sends a workflow object containing the name, nodes, connections and settings. A loop processes one workflow at a time, which lowers the chance of a crash affecting the migration.

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: How do you migrate n8n workflows from n8n Cloud to a self-hosted instance?

Build two manually executed workflows. The first uses the n8n node with an API credential for the old instance to fetch all workflows and write each ID, name and a 'to process' status into a Google Sheet. The second reads the rows still marked 'to process', fetches each workflow's JSON by ID, creates it in the new instance with a second API credential, then marks the row processed.

Q: How do you create an n8n API key?

In the n8n instance, open Settings and choose n8n API, then click Create API key. Give the key a name, choose whether it expires, for example after 30 days, or never, and save it. Copy the key that appears and paste it into a new n8n credential. A migration needs one key for the old instance and one for the new instance.

Q: What base URL should an n8n API credential use?

The base URL is your instance's address followed by /api/v1. For a cloud instance that is the app.n8n.cloud address in the browser bar, and for a self-hosted instance it is your own domain, such as a Hostinger cloud address. When combining the address with /api/v1, make sure there are not two slashes before api, or the credential will be wrong.

Q: Why log n8n workflows in a Google Sheet during migration?

Workflows are large JSON objects, and moving hundreds of them can crash partway through. Without an external record, you may move some workflows many times and fill the new instance with duplicates. A sheet with each workflow's ID, name and a status column shows exactly which have been migrated and which still need processing, so a failed run can resume safely.

Q: How does the status filter work in the n8n migration workflow?

Each workflow is added to the Google Sheet with the status 'to process'. The import workflow's Google Sheets node only returns rows where the status column equals 'to process'. After a workflow is created in the new instance, its row is updated to processed. In the demo, marking one of the 25 rows processed by hand left 24 workflows ready to migrate.

Q: What data does an n8n workflow JSON contain?

An n8n workflow's JSON includes its name, created and updated timestamps, whether it is active, every node with its parameters, the connections between nodes, settings and version information. It is the same data you see when you download and import a JSON template. To create a workflow through the API, you send a workflow object containing the name, nodes, connections and settings.

Q: Why process n8n workflows one at a time with a loop during migration?

A migration can involve hundreds of workflows, each a large chunk of JSON. Looping over them one at a time lowers the chance of something going wrong. Each iteration creates a single workflow in the new instance and updates that workflow's row in the Google Sheet, so progress is recorded continuously and an interrupted run can pick up where it stopped.

Q: How can you test an n8n workflow migration without moving everything?

Add a limit to the n8n node that fetches workflows from the old instance. In the demo, the cloud account had 512 workflows, so the creator limited the fetch to 25 to keep execution fast and avoid problems while recording. The same logging and filtering steps then apply to the smaller set, and you can confirm workflows appear in the new instance before scaling up.

Summary & Key Takeaways

  • The migration uses two manually executed n8n workflows. The first uses the n8n node with an API credential for the old cloud instance to pull every workflow, then loops through them and writes each workflow's ID, name and a 'to process' status into a Google Sheet that serves as an external log.

  • The second workflow reads the Google Sheet, keeping only rows whose status is 'to process', and uses each ID to get that workflow's full JSON from the old instance. It then loops through the workflows one at a time, creates each in the new self-hosted instance through the API and marks the row processed.

  • Setup needs two API keys, one from each instance, created under Settings and n8n API. Each credential's base URL is the instance address followed by /api/v1. The demo found 512 workflows in the cloud account and limited the run to 25 so recording would not be slow.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from Nate Herk | AI Automation 📚