Node.js toolkit for safely auditing and deleting Data Extensions and folders in Salesforce Marketing Cloud (SFMC). Features dependency checking, dry-run mode, schema backups, protected item detection, and comprehensive audit logging.
git clone https://github.com/aali87/sfmc-scripting.gitSFMC Scripting is a Node.js toolkit designed for Salesforce Marketing Cloud administrators and developers who need to safely manage Data Extensions at scale. The toolkit provides dependency analysis across queries, automations, journeys, and triggered sends to prevent accidental breakage. All operations default to dry-run mode, requiring explicit confirmation before making changes, while automatic schema backups and resumable operations protect against data loss. Features include multi-business unit support, 24-hour metadata caching to minimize API calls, and protected item detection to prevent deletion of system-critical resources. Whether cleaning up archive folders, analyzing stale data extensions, or bulk-deleting with confidence, this toolkit brings safety and visibility to SFMC Data Extension lifecycle management.
Install Node.js 18+, clone the repository, configure your SFMC credentials in a .env file with your Installed Package client ID and secret, and test the connection with `node src/index.js test`. Run audit commands like `audit-folder.js` for read-only analysis or `delete-data-extensions.js` in dry-run mode first to preview changes before adding `--confirm` for live execution.
Audit folder contents and identify unused or stale Data Extensions before deletion
Preview dependencies and potential impacts before deleting Data Extensions or automations
Bulk delete archived Data Extensions with automatic cleanup of safe dependent queries
Analyze Business Units to identify candidates for deletion based on activity thresholds
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/aali87/sfmc-scriptingCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
I need to clean up outdated Data Extensions in our [COMPANY] SFMC account. Here's what I want to do: [DESCRIBE TASK]. Please provide a step-by-step guide using the SFMC Scripting toolkit, including any necessary precautions or best practices for [INDUSTRY] compliance.
# SFMC Data Extension Cleanup Guide ## Step 1: Initial Assessment - **Current Data Extensions**: 147 - **Potentially Obsolete**: 42 (last modified > 12 months) - **Dependencies Identified**: 15 (active automation workflows, cloud pages, etc.) ## Step 2: Dry Run Execution - **Items Flagged for Deletion**: 27 - **Protected Items Detected**: 3 (system-critical extensions) - **Schema Backups Created**: 24 ## Step 3: Safe Deletion Process - **Data Extensions Deleted**: 24 - **Folders Cleaned**: 8 - **Audit Log Generated**: `DECleanup_20231015.log` **Recommendation**: Review the audit log and verify no active campaigns were affected.
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan