Connection Conservation Diff Between Two n8n Workflow Snapshots
Loading workflow…
Workflow Description
A self-contained workflow that compares a baseline and a candidate n8n workflow JSON snapshot. A Code node emits two fictional review cases, then the diff node builds a canonical edge key per connection containing source name, output type and index, target name, input type and index. It produces sorted unique preserved, added and removed connection lists, flags duplicate node names and connection endpoints that match no node in the same snapshot, applies a local policy, routes with an If node and merges both branches into a deterministic per-case diff report. No snapshot is modified.
How it works
- 1.Manual Trigger fires one empty item
- 2.Inject Sample Snapshots emits two demo review cases in the required schema
- 3.Diff Connections extracts edges, compares sets, checks duplicates and dangling endpoints, applies policy
- 4.Policy Passed? routes clean cases to output 0 and flagged cases to output 1
- 5.Mark Approved and Mark Needs Review add decision fields while keeping all other fields
- 6.Merge Decisions appends both branches
- 7.Build Diff Report sorts by caseId and emits one report item per case
- 8.Report Output terminates the branch
Use cases
- Prove no wiring was lost after editing a workflow
- Detect ghost connections pointing at deleted nodes
- Block candidates that added unapproved connections
- Catch duplicate node names before merging a snapshot
Requirements
- n8n 2.49.x
- Baseline and candidate workflow JSON snapshots
- A local policy for allowed additions/removals
- No credentials or network calls
Setup and testing in n8n
- Import the JSON and run Execute Workflow
- Verify release-42 ends as approved with one added connection
- Verify release-43 ends as needs_review for duplicate name, dangling edge, removal and addition
- Set allowNewConnections to false for case one and confirm it flips to review
- Clear connections in one snapshot to test the empty edge case
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
Inject Sample Snapshots
Code
Diff Connections
Code
Policy Passed?
If
Mark Approved
Set
Mark Needs Review
Set
Merge Decisions
Merge
Build Diff Report
Code
Report Output
No Op
Note Input
Sticky Note
Note Diff
Sticky Note
Note Decision
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