n8n · troubleshooting · reproduced on n8n 2.25.7, 6 September 2026

n8n could not import file

“Could not import file” in n8n always means one thing: the file did not parse as JSON. Its companion message is “The file does not contain valid JSON data”. If the JSON is fine but the shape is wrong you get a different message — “The imported data does not contain valid workflow data (‘nodes’ and ‘connections’ are missing)” — and that one means you imported something that is not a workflow. A third, “Skipped N node(s) with missing type”, means the import worked and your instance is missing node types the file uses.

Which sentence you got decides the fix, so read it before editing anything. Below: all four editor messages, the four errors the CLI prints instead, and the one difference between the two importers that catches people out — import:workflow needs a top-level id and the editor does not.

The four messages the editor can show

MessageWhat it meansUsual cause and fix
Could not import file — The file does not contain valid JSON dataThe file is not parseable JSON at all.Almost always a copy-paste artifact: a trailing comma, smart quotes from a chat window or a doc, an HTML page saved with a .json extension, or a partial file. Run it through any JSON parser before blaming n8n.
Problem importing workflow — The imported data does not contain valid workflow data (‘nodes’ and ‘connections’ are missing)Valid JSON, wrong shape.You imported something that is not a workflow: a credentials export, a single node copied to the clipboard, an n8n API response wrapped in {"data": …}, or a list of workflows. A workflow object has top-level nodes and connections keys.
Problem importing workflow — Skipped N node(s) with missing typeThe workflow imports, but nodes are missing from the canvas.The file references node types this instance does not have — typically community nodes that are not installed, or nodes newer than your version. Install the community node or upgrade, then re-import.
Could not import workflowImport from a URL rather than a file.The URL did not return a workflow n8n could read. Fetch the URL yourself and check you are getting raw JSON, not an HTML page — a GitHub blob page is HTML; the raw.githubusercontent.com URL is JSON.

Message wording read from n8n’s English string file on 6 September 2026 (keys mainSidebar.showMessage.handleFileImport.title / .message and nodeView.showError.importWorkflowData.*). They go through n8n’s translation layer, but the repository ships only en.json, so in practice the editor shows them in English.

What the CLI prints instead

Every failure of n8n import:workflow starts with the same unhelpful line — An error occurred while importing workflows. See log messages for details. — followed by the reason. These four are what we got on n8n 2.25.7:

# 1. malformed JSON — the parser's own message, with the position
Expected double-quoted property name in JSON at position 17 (line 1 column 18)

# 2. valid JSON, but nothing that looks like a workflow
File does not seem to contain valid workflows.

# 3. the path is wrong
ENOENT: no such file or directory, open '/tmp/wf/nope.json'

# 4. the workflow JSON has no top-level "id"
SQLITE_CONSTRAINT: NOT NULL constraint failed: workflow_entity.id

Reproduced on n8n 2.25.7 in Docker on 6 September 2026. Error 4 is the one worth remembering: the same file that drag-and-drops into the editor without complaint can be rejected by the CLI purely because its id was stripped. Add a top-level "id" — any unique string — and the import succeeds.

A 30-second triage

  1. Is it JSON at all?Run python3 -m json.tool your-workflow.json > /dev/null or jq . your-workflow.json. If either complains, the file is the problem and n8n never got as far as reading it. The most common causes are a trailing comma and curly quotes pasted out of a chat or a document.
  2. Is it a workflow?jq 'has("nodes"), has("connections")' your-workflow.json must print true twice. If you exported from the n8n API you probably have the workflow wrapped in a data object — unwrap it with jq '.data'.
  3. Are the node types installed?jq -r '[.nodes[].type] | unique[]' your-workflow.json lists them. Anything that is not n8n-nodes-base.* or @n8n/n8n-nodes-langchain.* is a community node you must install first, or the import will drop those nodes and tell you so.
  4. Importing from the CLI?Check for a top-level id with jq -r '.id // "MISSING"' your-workflow.json. If it prints MISSING, add one before running import:workflow.

If the file came from us

Every template on this site is exported from a real n8n instance and then re-imported into a blank one before it is published, so a download from here should import cleanly through the editor. Two things to know. First, credential values in our files are placeholders like {{YOUR_API_KEY}}, so nodes will show a “credentials not set” warning after import — that is expected, not an import failure. Second, the files are sanitised of instance-specific fields, so if you script the import with import:workflow you may hit error 4 above; add an id first.

Start with the step-by-step import guide, browse the free n8n templates, or, if the import worked and the workflow still will not answer, read “webhook not registered” next.

Sources and last verified

CLI output reproduced on n8n 2.25.7 in Docker on 6 September 2026; editor wording read from n8n’s own string file the same day.

Frequently asked questions

Why does n8n say “Could not import file”?

That exact title always pairs with the message “The file does not contain valid JSON data”, and it means the file failed to parse before n8n ever looked at its contents. A different failure — valid JSON that is not a workflow — produces a different message: “The imported data does not contain valid workflow data (‘nodes’ and ‘connections’ are missing)”. Reading which of the two you got tells you whether to fix the syntax or the source of the file.

What does a valid n8n workflow file have to contain?

At minimum the top-level keys nodes and connections — n8n names exactly those two in its error text when they are missing. In practice an export also carries name, settings and per-node parameters, type, typeVersion and position. Anything else in the file is optional as far as the editor import is concerned.

Why does the same file import in the editor but fail on the command line?

Because the CLI writes straight to the database and the editor does not. On n8n 2.25.7 we imported a workflow JSON with no top-level "id" and n8n import:workflow failed with SQLITE_CONSTRAINT: NOT NULL constraint failed: workflow_entity.id. Adding a top-level "id" made the same file import successfully. Sanitised template files often have the id stripped on purpose, so this is a common surprise when moving from drag-and-drop to scripting.

What errors does n8n import:workflow print?

On n8n 2.25.7 it always prints “An error occurred while importing workflows. See log messages for details.” and then the real reason. We reproduced four: a JSON syntax error quoted from the parser, “File does not seem to contain valid workflows.” for JSON with no workflow shape, an ENOENT line naming the path when the file is not there, and the SQLITE_CONSTRAINT line when the top-level id is missing.

The workflow imported but half the nodes are gone. What happened?

n8n imported what it recognised and told you the rest was dropped, with “Skipped N node(s) with missing type”. Those nodes reference a node type this instance does not have installed — most often a community node, sometimes a core node newer than your version. Install the package or upgrade n8n, then import again; the file itself is fine.

Can I import a folder of workflows at once?

Yes. n8n’s CLI documents n8n import:workflow --separate --input=<directory> for a directory of files. By default import:workflow deactivates every imported workflow; the docs add --activeState=fromJson to keep the active field from each JSON instead, and note that option is only supported in multi-main and queue mode.