Nested JSON Field Pruner with Deletion Audit Trail
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.Manual Trigger starts the run.
- 2.Code node emits three fictional cases.
- 3.Code node validates paths, prunes a deep copy, logs removed/missing paths.
- 4.Set node adds status and removedCount.
- 5.IF splits valid from rejected configs.
- 6.Rejected branch is marked deletion_skipped.
- 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
- Import and execute manually.
- Check customer.internal and debugInfo on orders 0 and 2 are removed.
- Check REC-003 is rejected with nothing deleted.
- 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
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
Emit Sample Records And Paths
Code
Validate Paths And Prune Copy
Code
Set Unified Status
Set
Is Config Valid?
If
Cleaned Records Pass
No Op
Mark Deletion Skipped
Set
Append Both Branches
Merge
Build Audit Summary
Code
Note Setup
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