Hi everyone. We would like to transition from deploying Einstein bots via changesets to tracking them in git and using cicd for deployments of new versions to between environments. I've encountered a couple of issues when trying this:
- Bot User References: We use specific user for our Einstein bots. Therefore bot metadata contains org-specific user references (e.g., botUser field with sandbox-specific suffixes like .sandbox1, .sandbox2). These don't transfer cleanly between environments.
- Active bot versions can't be updated via Metadata API - do you create new versions each deployment, or deactivate before deploying?
Hello Vitaly,
For the bot user reference, this is a known pain point. The bot metadata does store an org-specific UserId / username, so it won’t translate cleanly across sandboxes. Most teams handle this by standardizing the bot user username across all orgs so the reference resolves automatically. If that’s not possible, the usual workaround is to exclude the botUser field from source control and then set/update it post-deploy using a script, Flow, or manual step. Some teams also use a small post-deploy Apex script to remap the user based on alias.
For active bot versions, you’re right — you can’t update an active version via the Metadata API. The common CI/CD pattern is to always deploy a new bot version and then activate it in the target org. Deactivating and re-deploying an existing version is risky and not automation-friendly. In practice, CI/CD deploys a new version, validates it, and then either auto-activates via a post-deploy step or leaves activation as a controlled/manual step. Hope this helps!