Migrating from n8n workflows from local instance to my n8n hosted on railway

I have been using n8n on localhost and decided to move it to railway for it to be 24/7 accessible/online. I am, however, having a challenges with importing my workflows here and ended up copy pastingn(Which is way hard). How can I go about this Using the cli command?

  1. I have backed up these workflows to Git Hub. I had tried reading the workflows from the file and loading it to the n8n “create workflow” but didn’t get the final workflow created.
    How can i read a json file with the workflow an the workflow can be correctly created?

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Imperol,

The quickest option would be to use the CLI but I don’t know if Railway let you access this, You would also need to have the workflows somewhere that the railway instance can access.

If you have the workflows in Github though you should be able to read the files and use the n8n node to import the workflows, You may need to strip some of the data to follow what we expect in the API. I don’t have an example of how to do this but it would make a very good workflow template for the community if you decide to make one.

Once I figure a way out I’ll drop it as a template

How about using the read json file method. I tried using chat gpt for the final code manipulation but didn’t quite get it right

Hey @Imperol,

When you say the read json method what do you mean? I still think the best and quickest option would be to try what I mentioned earlier with the CLI or manually import them, Do you have a lot of workflows?

I have a lot of workflows so doing this manually would take forever

Hey @Imperol,

Did you try downloading your Github repo to your Railway instance then running the CLI to import from the exucute command node?