n8n-mcp partial update fails: 'Cannot convert undefined or null to object' (Claude Desktop/Cursor)
When using the n8n-mcp server through Claude Desktop or Cursor, the
n8n_update_partial_workflowtool repeatedly fails with "Failed to apply diff operations" and "Cannot convert undefined or null to object". Sometimes the workflow gets corrupted and won't open in n8n at all. This happened even after updating to the latest repo version at the time. Was this bug fixed?Originally asked on GitHub: https://github.com/czlonkowski/n8n-mcp/issues/136
6 answers
Status: fixed in v2.16.0. The maintainer closed this issue as COMPLETED on 2025-10-06 and states that v2.16.0 fixes both the partial update failures and the workflow corruption.
The maintainer identified two root causes:
-
A
TypeError(Cannot read properties of undefined (reading 'split')) occurred when AI agents passed invalid node type parameters. The fix adds type guards ingetNodeTypeAlternatives()and enhanced parameter validation so agents recover from invalid inputs instead of crashing mid-update. -
When removing connections from multi-output nodes (Switch, IF, Filter, Merge), the diff code filtered out empty arrays, causing connection indices to shift and corrupting the workflow structure. This matches the reported symptom where n8n opens an empty workflow. The fix preserves intermediate empty arrays and only removes trailing ones.
The maintainer also notes that the n8n API only supports getting and updating the full workflow, so the partial update logic is implemented entirely inside n8n-mcp. The fix adds 20 integration tests against a real n8n API (178 tests total).
To resolve the issue, update n8n-mcp to v2.16.0 or newer and retry on Claude Desktop or Cursor. Before upgrading, one user reduced failures by strengthening project rules so the LLM followed the MCP tool's instructions. Full workflow updates still work but consume much more context.
Did this work for you?-
What @mamadaevv tried on GitHub (Partly worked)
A commenter partially solved the problem by correcting the project rules/instructions so the LLM stopped ignoring the MCP tool's instructions; errors almost disappeared.
Source: https://github.com/czlonkowski/n8n-mcp/issues/136#issuecomment-3224048613 (opens external site)
Did this work for you?What @potnin tried on GitHub (Didn't work)
A commenter updated to the latest repo version at the time and still got the failure, with an
updateNodeoperation and the exact error "Cannot convert undefined or null to object".Source: https://github.com/czlonkowski/n8n-mcp/issues/136#issuecomment-3353207088 (opens external site)
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
The reporter used partial updates from Claude Desktop and Cursor; the MCP function call succeeded but failed to apply, always offered a "Manual Fix", and sometimes corrupted workflows so n8n opened an empty workflow.
Source: https://github.com/czlonkowski/n8n-mcp/issues/136 (opens external site)
Did this work for you?What @Aldekein tried on GitHub (Didn't work)
A commenter's agent repeatedly failed the partial update and fell back to full workflow updates, which works but burns context fast.
Source: https://github.com/czlonkowski/n8n-mcp/issues/136#issuecomment-3368838248 (opens external site)
Did this work for you?What @zizekuros tried on GitHub (Didn't work)
A commenter confirmed the same issue and saw workflow validation get stuck even when creating a new workflow, not just updating.
Source: https://github.com/czlonkowski/n8n-mcp/issues/136#issuecomment-3182373429 (opens external site)
Did this work for you?
Related questions
- n8n-MCP: complex Claude Desktop workflows won't open in n8n UI — 'propertyValues is not iterable'?
- n8n-mcp n8n_update_partial_workflow updateNode fails with "Cannot convert undefined or null to object"
- n8n-mcp Docker: missing BACKEND_SUPABASE_URL after pulling latest image
- n8n_update_partial_workflow fails: "settings must NOT have additional properties"
- n8n-mcp creates blank nodes instead of AI Agent / Basic LLM Chain nodes?