N8n 2.30.4 – Safely restore a missing node with original ID and version protection

Hello n8n community,

We need guidance on safely repairing an existing workflow in self-hosted n8n 2.30.4, without risking unintended changes.

Current situation

  • The workflow is inactive and unpublished.
  • It currently contains 26 nodes.
  • One Data Table node (n8n-nodes-base.dataTable, typeVersion 1.1) is missing.
  • The original missing node has the ID b4-17.
  • We have verified backups of the current workflow and the original 27-node design.
  • Only the missing node and its two connections should be restored.
  • All existing nodes, credentials, webhook paths, workflow settings, and the workflow identity must remain unchanged.

A previous attempt to paste a partial JSON fragment into the editor unexpectedly changed the workflow title. We stopped and subsequently restored the intended title.

We do not want to repeat this approach without reliable safeguards.

Questions

1. Restoring a node with its original ID

Does the native n8n 2.30.4 editor support inserting or restoring a node while preserving its exact original JSON ID (b4-17)?

If this is not supported, is preserving the original node ID technically necessary, provided the node name, parameters, expressions, and connections remain correct?

Are there any internal references or mechanisms that could depend on this ID?

2. Version conflict protection

Does n8n 2.30.4 reliably protect against concurrent modifications when saving a workflow through the editor?

For the API endpoint PUT /api/v1/workflows/{id}, does versionId provide effective optimistic locking in this specific version?

The current API documentation refers to optimistic locking, but versionId also appears as read-only in the update schema. We would appreciate clarification on the actual supported behavior.

3. Safest officially supported repair procedure

What is the recommended approach for restoring exactly one missing node and its two connections in an existing inactive workflow?

Our priorities are:

  • Preserve the existing workflow ID and title.
  • Preserve every existing node and unrelated connection.
  • Preserve credentials, webhook paths, and security settings.
  • Prevent unintended activation or publishing.
  • Create a complete before-and-after JSON comparison.
  • Avoid overwriting concurrent changes.

Would you recommend a controlled editor operation or an API update for n8n 2.30.4?

We would especially appreciate references to official documentation or the relevant version-specific source code.

For security reasons, we are not publishing our complete workflow JSON, API keys, credentials, or internal infrastructure details.

Thank you for your help!

Hi @Zafer_Imre, in 2.30.4 the public PUT handler sets forceSave: true. Passing versionId therefore does not protect against overwriting a concurrent change.

  1. Normal clipboard paste regenerates node IDs. The importer also applies a top-level name, which can rename the workflow. Ordinary connections and node-name expressions use names, so b4-17 is not normally required for routing. IDs still matter elsewhere, for example nodeGroups.nodeIds.

  2. The editor sends expectedChecksum, but the controller bypasses that check when sharing support is disabled. Its checksum check and database update are separate operations. Neither route gives you an unconditional atomic versionId guard in this release.

  3. If b4-17 must be retained, I’d use the public API with all other editor/API writers blocked, rehearsing the repair on an isolated 2.30.4 copy first. Take a fresh GET of the current 26-node workflow and merge only the original node object, preserving its ID and typeVersion 1.1, plus the two intended connections. Use the current graph as the base, rather than replacing it with the old 27-node backup. Review the intended diff before sending PUT to the existing workflow ID.

The PUT body must follow that version’s writable schema, including name, the complete nodes and connections, and settings; don’t submit the entire GET response with read-only metadata. Confirm activeVersionId is null before updating: this path republishes an already-published workflow, but does not publish an unpublished one.

GET it again and retain the complete before/after JSON diff. Expect server-managed revision/timestamp changes; verify the title, existing nodes, credential references, webhook paths, settings and unrelated connections stayed unchanged. A GET/compare before PUT alone cannot prevent a race. If the original ID isn’t required, recreating just the node and its two connections in the editor is simpler.

2.30.4 source:

Safest way is to skip pasting into the editor altogether. Export the workflow JSON, add the node object back into the nodes array with its original id, then add its two entries under connections by hand. Import that as a new workflow, diff it against your backup, and only then swap it in.

exporting the raw workflow json and manually inserting the node block with its original id preserves all downstream pin references and prevents broken connection lines.

testing the patched workflow on a duplicated draft before saving changes to the active workflow ensures you avoid accidental production downtime.