Skip to content
Data & Databases

Connection Conservation Diff Between Two n8n Workflow Snapshots

9 nodes 13 1 Manual trigger
Download

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. 1.Manual Trigger fires one empty item
  2. 2.Inject Sample Snapshots emits two demo review cases in the required schema
  3. 3.Diff Connections extracts edges, compares sets, checks duplicates and dangling endpoints, applies policy
  4. 4.Policy Passed? routes clean cases to output 0 and flagged cases to output 1
  5. 5.Mark Approved and Mark Needs Review add decision fields while keeping all other fields
  6. 6.Merge Decisions appends both branches
  7. 7.Build Diff Report sorts by caseId and emits one report item per case
  8. 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

  1. Import the JSON and run Execute Workflow
  2. Verify release-42 ends as approved with one added connection
  3. Verify release-43 ends as needs_review for duplicate name, dangling edge, removal and addition
  4. Set allowNewConnections to false for case one and confirm it flips to review
  5. 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

Manual Trigger Code If Set Merge No Op

Details

Trigger Manual trigger
Nodes 9
Apps 6
Views 13
Downloads 1

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (9)

/

Manual Trigger

Manual Trigger

#1

Inject Sample Snapshots

Code

#2

Diff Connections

Code

#3

Policy Passed?

If

#4

Mark Approved

Set

#5

Mark Needs Review

Set

#6

Merge Decisions

Merge

#7

Build Diff Report

Code

#8

Report Output

No Op

#9

Note Input

Sticky Note

#10

Note Diff

Sticky Note

#11

Note Decision

Sticky Note

#12
Stay in the loop

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

Be first to discover what is new

Your name, your email, and one confirmation.

Email confirmation · Unsubscribe anytime