Problem saving workflow after using n8n AI Assistant to rename nodes

Hi everyone,

I recently ran into this and fixed it manually. Posting my findings here in case it’s not intended behavior — or in case the AI Assistant needs improving..

The Issue

I asked the n8n AI Assistant to rename a few nodes in one of my workflows. It made the edit and everything looked fine in the canvas. But right after that, the workflow became completely unsavable — every edit I made afterward failed with:

Problem saving workflow
Autosave failed: Cannot convert undefined or null to object

The browser console showed the same error firing repeatedly from the canvas renderer and the save handler:

The Symptoms (AI)

  • Renaming was the only thing I asked the AI Assistant to do, but after its edit, the workflow JSON came back with several node-level fields explicitly set to null — things like credentials, webhookId, notes, notesInFlow, executeOnce, retryOnFail, alwaysOutputData, and onError.
  • Any node that didn’t need those properties normally just omits the key entirely in a standard n8n export. The AI Assistant’s edit round-trip instead wrote them out as null.
  • Once that shape hit the canvas, every subsequent action (moving a node, saving, autosaving) crashed with the same Object.keys TypeError, because nodeTransforms.ts tries to normalize those fields and doesn’t expect a literal null.

The Root Cause (AI)

nodeTransforms.ts (used both by the canvas diffing logic and by useWorkflowSaving.ts) calls Object.keys(...) on certain node properties (like credentials) when computing the diff to save. Object.keys(null) throws, so as soon as one node in the workflow has null instead of an omitted key, saving/autosaving the whole workflow breaks — not just that node.

It looks like the AI Assistant’s node-editing path serializes the node object without dropping keys that resolved to null, which produces a technically-valid-JSON but not frontend-safe node shape.

The Solution (manually)

Export the workflow JSON, strip out any key on any node whose value is null (rather than setting it to null), and re-import. For example, on the affected nodes, remove keys like:

"credentials": null,
"webhookId": null,
"notes": null,
"notesInFlow": null,
"executeOnce": null,
"retryOnFail": null,
"alwaysOutputData": null,
"onError": null

so the node object simply doesn’t have those keys at all if it doesn’t use them. After stripping the null fields and re-importing (Import from File into a fresh workflow, not paste-into-canvas), the workflow saved and autosaved normally again.

Hope this saves someone a few hours of debugging!
This looks like a bug in how the AI Assistant serializes node edits — would appreciate confirmation from the n8n team, since anyone bulk-editing nodes with it could hit the same wall.

Great finding, @mohamed3nan !!!
Sounds like a bug indeed

Good write-up - reporting and documenting the root cause is genuinely helpful. If this happens again and you want to skip manual JSON editing, a small Code node can automate the cleanup:

const workflow = JSON.parse($input.item.json.workflowJson);
workflow.nodes = workflow.nodes.map(node =>
  Object.fromEntries(Object.entries(node).filter(([_, v]) => v !== null))
);
return { workflowJson: JSON.stringify(workflow) };

Paste the exported workflow JSON into a Set node, run it through this, and import the output - saves a few minutes if the bug hits a complex workflow.

One question, @mohamed3nan .
Did you self-host your AI sandbox?

Hi @kjooleng, I haven’t tried self-hosting yet since it seems a bit complex,

I’m currently using the Daytona option because it’s much easier to set up..

@mohamed3nan Since the AI Assistant feature is still in preview and has this bug, If it’s a simple tasks. Adjusting things normally or manually is much better.

I have created ADO-5601 as our internal ticket to resolve this.

New version n8n@2.33.0 got released which includes the GitHub PR 34668.