Workflow fails to open in UI - "Could not find workflow" / "useInjectWorkflowId undefined"

Hello

I am running n8n self-hosted version 2.14.2 via Docker/Coolify.

Problem: A workflow containing @n8n/n8n-nodes-langchain.agentTool nodes fails to open in the UI. When navigating to the workflow URL, the page redirects to a blank new workflow.

Console Errors:

Error: Could not resolve undefined
at useInjectWorkflowId.ts:5:9
at setup (NodeView.vue:268:20)

What I tried:

  • Verified workflow exists in SQLite database :white_check_mark:

  • Fixed model field format to {"__rl": true, "mode": "id", "value": "..."}

  • Cleared agentTool parameters to {}

  • Tested on n8n versions 2.10.2, 2.14.2, 2.20.7-exp.0 — same issue on all

What works:

  • Simple test workflow with 1 agent + 1 agentTool (empty parameters) opens fine

  • All other workflows without agentTool nodes open normally

Question: What is the correct JSON structure for agentTool nodes in n8n 2.14.x? Does agentTool require a valid workflowId to render in the UI? If so, what is the correct format?

Workflow node structure:

json

{
  "type": "@n8n/n8n-nodes-langchain.agentTool",
  "typeVersion": 1,
  "parameters": {}
}

Thank you.

Welcome to the community @Habib_Al_tal

This looks like corrupted or incompatible JSON.
I would export the workflow, recreate the agentTools in a new workflow, and reimport them gradually until I find the point that breaks the UI.
If it persists, it’s a bug.

Thank you Tamy!

Important note: This workflow was built programmatically via REST API
(Python script using Claude AI / Antigravity tool), NOT manually in the UI.

Simple test workflow with 1 agent + 1 agentTool opens fine.
The complex workflow (49 nodes) fails to open.

Is there a known issue with workflows created via REST API that causes
agentTool nodes to break in the UI?

Can you escalate to human support?

Workflow export: https://paste.c-net.org/FeliciaTonio

Hi Habib,

I’m afraid this is not something we can provide support with unless you’re on an Enteprise license.. Try dropping it in Claude and asking why it fails?