Ghost Connection Repair for n8n Workflow JSON with Patch Log
Loading workflow…
Workflow Description
A fully self-contained workflow that inspects a local n8n workflow export and removes only dangling connections. A Code node accepts workflowJson as an object or JSON string, validates the nodes array, connections object and node-name uniqueness, then deep-copies the export and deletes exclusively source keys with no matching node plus destination links pointing to missing nodes, keeping valid sibling links. Every removal is recorded in patchLog with path, reason and removed value. A second verification pass requires remainingDanglingCount to be zero; IF routes on repairSafe, Set nodes expose counts and a final Code node returns one audit report.
How it works
- 1.Manual Trigger fires with an empty item.
- 2.Load Sample Workflow Exports emits three fictional cases.
- 3.Repair Dangling Connections parses, validates, deep-copies, strips ghost connections and logs them.
- 4.A second pass computes remainingDanglingCount and repairSafe.
- 5.If Repair Safe splits verified repairs from blocked cases.
- 6.Two Set nodes add status and summaryLine with detected/removed/remaining counts.
- 7.Merge (append) then Build Audit Report returns exactly one report item.
Use cases
- Clean a workflow export before import to avoid Destination node not found
- Audit every removed connection before applying the change
- Scan batches of workflow files for missing node references
Requirements
- n8n instance supporting the listed node type versions
- workflowJson field containing a workflow export object or valid JSON string
- No credentials needed; no external calls are made
- Keep the originalWorkflow output yourself; the workflow writes no files
Setup and testing in n8n
- Import the JSON and open the workflow.
- Click Execute Workflow and inspect Build Audit Report output.
- Confirm case-A-dangling shows detected 2, removed 2, remaining 0 with two patch reasons.
- Confirm case-B-duplicate-names is blocked with duplicate_node_names and case-C-broken-json with invalid_json.
- Edit the sample node to add a fully valid workflow and verify patchLog stays empty.
Service Value
Ready-made workflow template for automation delivery and service execution.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (9)
Manual Trigger
Manual Trigger
Load Sample Workflow Exports
Code
Repair Dangling Connections
Code
If Repair Safe
If
Set Repaired Summary
Set
Set Blocked Summary
Set
Mark Blocked For Review
No Op
Merge Branches
Merge
Build Audit Report
Code
Note Input
Sticky Note
Note Repair
Sticky Note
Note Routing
Sticky Note
Fresh workflows, straight to your inbox
Get newly published DROPIDEA workflows, a clear overview of what they do, and a link to explore them.
- New workflows
- Clear overviews
- Setup guides