This repository contains Code Engine packages and a Workflow that allow Domo administrators to bulk update the ownership of all objects owned by a specific user to a new owner, and then delete the original user from the Domo instance.
-
majordomo-user-offboarding.js- Main Code Engine package containing functions for transferring content ownership and deleting users. Supports 20+ Domo object types including DataSets, Cards, Pages, Workflows, DataFlows, and more. -
majordomo-user-offboarding-package-definition.json- Package definition file for the main user offboarding package, specifying exported functions and metadata. -
domo-product-apis-supplemental.js- Supplemental Code Engine package containing helper functions for advanced Domo API operations not available in standard libraries. -
domo-product-apis-supplemental-package-definition.json- Package definition file for the supplemental APIs package. -
workflow-definition.json- Workflow definition that orchestrates the user offboarding process, including content transfer, user deletion, and email notifications.
creation-script.js- Automated deployment script that creates/updates Code Engine packages, datasets, and workflows in your Domo instance. This script eliminates manual setup by:- Searching for existing packages and intelligently updating versions
- Creating required log and DomoStats datasets
- Deploying Code Engine packages with proper dependencies
- Creating and configuring the workflow
- Personalizing configurations with your user ID and instance URL
There are deployed examples of these Code Engine packages and Workflow in the Domo Community instance:
- Code Engine Package Example - MajorDomo User Offboarding
- Code Engine Package Example - Domo Product APIs Supplemental
- Workflow Example
The fastest way to deploy this solution is using the automated creation script:
-
Prerequisites:
- Node.js installed on your machine
- Domo access token with admin permissions
- Your Domo instance URL (e.g.,
https://your-company.domo.com)
-
Clone the repository:
git clone https://github.com/brycewc/majordomo-user-offboarding.git cd majordomo-user-offboarding -
Run the deployment:
node creation-script.js
The script will prompt you for:
- Your Domo instance URL
- Your Domo access token
-
What the script does:
- Searches for existing packages and updates them (or creates new ones)
- Creates/finds the Log DataSet for tracking operations
- Creates/finds the DomoStats Scheduled Reports DataSet
- Deploys both Code Engine packages with latest versions
- Creates the Workflow with personalized configuration
- Replaces hardcoded IDs with your user ID and instance URL
-
Post-deployment:
- Update the Send Email to MajorDomo step of the workflow. Replace the cardId and column placeholders in the body to work with a card built on the log dataset in your instance
- Once you're satisfied with the workflow, deploy it
- Configure workflow triggers and notifications
If you prefer manual setup or need to customize the deployment:
- Copy the code from
majordomo-user-offboarding.jsinto a new Code Engine package in your Domo instance. - Copy the code from
domo-product-apis-supplemental.jsinto another Code Engine package. - Configure the two DataSet ID variables at the top of
majordomo-user-offboarding.js:- Log DataSet: Can be a webform DataSet with columns:
userId,newOwnerId,type,id,date,status,notes. - Scheduled Reports DataSet: The DomoStats Scheduled Reports DataSet that contains scheduled reports in your instance.
- Log DataSet: Can be a webform DataSet with columns:
- Deploy both Code Engine packages.
- Create a Workflow using the deployed Code Engine packages and a trigger of your choice. You can use
workflow-definition.jsonas reference. - The Code Engine function
transferContentrequires two input parameters:userIds: An array of user IDs whose objects you want to reassign and who you want to delete.newOwnerIds: An array of user IDs who will become the new owners of the objects.
- Update the email step as desired.
- Save and deploy the Workflow.
The function currently supports the following Domo object types for ownership reassignment:
- Accounts
- AI Models
- AI Projects
- Alerts
- App Studio Apps
- AppDB Collections
- Approval Templates
- Cards
- Code Engine Packages
- Custom Apps
- DataFlows
- DataSets
- Domo Everywhere Subscriptions
- FileSets
- Functions (Beast Modes and Variables)
- Goals
- Groups
- Jupyter Workspaces
- Metrics (Automated Insights)
- Pages
- Pending Approvals
- Projects and Tasks
- Sandbox Repositories
- Scheduled Reports (using DomoStats DataSet)
- Task Center Queues
- Task Center Tasks
- Workflows
- Domo Everywhere Publications (still gets logged but not reassigned)
- Sent Back Approvals (still gets logged but not reassigned)