service-omni-agent-users-create
service-omni-agent-users-create
Create N agent users on a Salesforce org via Anonymous Apex so Omni-Channel has agents to route work to. Usernames follow a deterministic per-org pattern, detection is SOQL-based, and the skill inserts only the users that are missing — so it is safe to re-run. It is invoked by service-omni-channel-setup-coordinate after service-omni-base-settings-configure enables Omni-Channel; assigning permission sets (service-omni-permission-set-assign) and adding users to queues (service-omni-queue-members-assign) are separate leaves. Supervisor users come from service-omni-supervisor-users-create.
Inputs
Confirm once, up front:
org-alias(required, no default) — must resolve viasf org display.- User count (optional, default
3, range1..10). - Profile name (optional, default
Standard Userfor portability). The coordinator overrides this to a Service Cloud profile so agents consume Service Cloud licenses; on many CDOs the Salesforce license pool is saturated while Service Cloud has free slots.
Usernames and passwords are never accepted from the operator — both are generated (usernames from the org suffix, passwords via Anonymous Apex). Operator-supplied credentials would break re-run detection and risk weak or leaked secrets.
Preconditions and safety
- Target org authenticated via
sfCLI (My Domain URL, not.lightning.force.com), Service Cloud license present,sfCLI ≥ 2.139.6. - The executing user has
PermissionsModifyAllDataandPermissionsManagePasswordPolicies(standard on System Administrator). - Production guardrail: the detect script computes
safe_to_writeasIsSandboxORTrialExpirationDate != nullOROrganizationTypein {Developer Edition, Base Edition}, and the skill blocks with no override when it is false. CDOs, scratch orgs, and dev orgs are permitted.