Skip to content
AI Agents

Nested JSON Field Pruner with Deletion Audit Trail

9 nodes 50 5 Manual trigger
Download

Loading workflow…

Workflow Description

Removes nested fields from JSON records using a per-record list of dot paths, with * applying deletion to every array element. Works on a deep copy so input stays unchanged, and logs actually removed and missing paths. Paths containing __proto__, prototype or constructor are rejected and routed to an invalid-config branch with no deletion. Both branches are merged into one report counting records processed, fields removed, missing paths and rejected paths.

How it works

  1. 1.Manual Trigger starts the run.
  2. 2.Code node emits three fictional cases.
  3. 3.Code node validates paths, prunes a deep copy, logs removed/missing paths.
  4. 4.Set node adds status and removedCount.
  5. 5.IF splits valid from rejected configs.
  6. 6.Rejected branch is marked deletion_skipped.
  7. 7.Merge appends branches; final Code builds one summary.

Use cases

  • Strip volatile fields before deduplication or comparison.
  • Remove internal fields before local archiving.

Requirements

  • No credentials; replace the sample node with a source providing caseId, paths and record.

Setup and testing in n8n

  1. Import and execute manually.
  2. Check customer.internal and debugInfo on orders 0 and 2 are removed.
  3. Check REC-003 is rejected with nothing deleted.
  4. Try an empty segment or non-object record to see rejection.

Service Value

Ready-made workflow template for automation delivery and service execution.

Apps Used

Manual Trigger Code Set If No Op Merge

Details

Trigger Manual trigger
Nodes 9
Apps 6
Views 50
Downloads 5

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

Emit Sample Records And Paths

Code

#2

Validate Paths And Prune Copy

Code

#3

Set Unified Status

Set

#4

Is Config Valid?

If

#5

Cleaned Records Pass

No Op

#6

Mark Deletion Skipped

Set

#7

Append Both Branches

Merge

#8

Build Audit Summary

Code

#9

Note Setup

Sticky Note

#10

Note Routing

Sticky Note

#11
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