This project exports a Membrane workspace, lets you keep only selected integrations, and produces a filtered zip that can be imported into another workspace.
There are two supported flows:
CLI: exports withnpx @membranehq/cli@latest pullAPI: exports with Membrane's/exportAPI and background-job polling
Both flows:
- ask which integrations to keep
- remove unselected integrations
- keep only the shared resources still referenced by the selected integrations
- create
filtered-membrane-workspace.zip
Create a local .env file based on .env.example.
Source workspace:
MEMBRANE_PULL_WORKSPACE_KEY=your-workspace-key
MEMBRANE_PULL_WORKSPACE_SECRET=your-workspace-secret
MEMBRANE_PULL_API_URI=https://api.getmembrane.comTarget workspace:
MEMBRANE_PUSH_WORKSPACE_KEY=your-target-workspace-key
MEMBRANE_PUSH_WORKSPACE_SECRET=your-target-workspace-secret
MEMBRANE_PUSH_API_URI=https://api.getmembrane.comMEMBRANE_PUSH_API_URI is optional and falls back to MEMBRANE_PULL_API_URI.
npm installRun:
npm run pull-and-filter-cliWith preselected integrations:
npm run pull-and-filter-cli -- --integrations slack,salesforceCustom output:
npm run pull-and-filter-cli -- --output ./my-filtered-export.zipAt the end, the script can optionally push the filtered workspace to the target workspace with Membrane CLI push.
Run:
npm run export-and-filter-apiWith preselected integrations:
npm run export-and-filter-api -- --integrations slack,salesforceCustom output:
npm run export-and-filter-api -- --output ./my-filtered-export.zipThe API flow:
- creates an admin JWT
- calls
GET /export - polls the background job
- downloads the zip
- filters the workspace
- creates the filtered zip
- can optionally import the filtered zip into the target workspace
If you choose import, the script asks about:
dryRun: preview changes without applying thempartial: preserve existing elements not included in the archivediff: request textual diff outputforce: bypass read-only restrictions and allow archiving missing elements
After import, the script:
- prints the response
- saves a timestamped JSON log under
logs/ - can optionally delete the generated zip
API import logs are saved as:
logs/membrane-import-YYYYMMDD-HHMMSS.json
Each log contains:
- timestamp
- target workspace key
- output zip path
- import options
- full import response
Default output:
filtered-membrane-workspace.zip
If that file already exists, the script stops before doing any work so an existing artifact is not overwritten.
scripts/filter-membrane-export-cli.jsscripts/filter-membrane-export-api.js
- The dependency pruning is UUID/key aware, so shared actions, flows, data sources, field mappings, packages, and connectors are only kept when still referenced.
- The CLI and API scripts intentionally share nearly the same pruning logic. The main difference is only how the Membrane export is retrieved.
