CLI import failing with PostgreSQL

I’m self-hosting n8n in queue mode, I installed it locally so to import I need to go to the path /home/dogway/n8n/node_modules/n8n/bin and then run:
node n8n import:workflow --input=/home/dogway/workflow_bak/fifueWwhOz1cp6IP.json

It errors with:

An error occurred while importing workflows. See log messages for details.
workflows.map is not a function

And creates an sqlite db.

Before that I was importing the 33 workflows in bulk:
node n8n import:workflow --separate --input=/home/dogway/workflow_bak
But instead of loading them into the PostgreSQL db, it was creating a new sqlite one.

Any help is welcome.

Information on your n8n setup

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

I’ve faced similar issues with workflows that had special characters in their names or node names.

Sometimes this is very difficult to debug.

Would you be able to use the “Create workflow” node instead?

:point_right: If my reply answers your question, please remember to mark it as a solution.

Try the same thing with
npx n8n import:workflow --separate --input=/home/dogway/workflow_bak

I fixed it here. I recalled reading someone to pass the environments to the call, but didn’t know how then.

In any case using n8n along postgres is not the smoothest of the experiences…

2 Likes

So, if not postgres What do you suggest to use?

SQlite is fully integrated, I don’t know about MySQL. Better wait for a dev or experienced user to answer, or ask directly in a livestream.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.