Skip to content

feat: (developing-agentforce) use sf org create agent-user command#234

Merged
hsinghbisht-sfdc merged 6 commits intoforcedotcom:developfrom
npiccolo:npz/createAgent
May 7, 2026
Merged

feat: (developing-agentforce) use sf org create agent-user command#234
hsinghbisht-sfdc merged 6 commits intoforcedotcom:developfrom
npiccolo:npz/createAgent

Conversation

@npiccolo
Copy link
Copy Markdown

@npiccolo npiccolo commented Apr 30, 2026

Summary

  • Replace the legacy multi-step Einstein Agent User creation flow (profile ID query → manual record creation → separate permset assignment) with the new unified sf org create agent-user command (SF CLI 2.131.7+)
  • Update three reference files: agent-user-setup.md, agent-design-and-spec-creation.md, salesforce-cli-for-agents.md
  • Legacy path preserved with a "manual/legacy" label for teams on older CLI versions

Changes

  • agent-user-setup.md: replaced Steps 1–3 with single sf org create agent-user call; updated critical notes, troubleshooting table, and validation footer
  • agent-design-and-spec-creation.md: updated "if no results returned" block to emit the new command and read result.username
  • salesforce-cli-for-agents.md: replaced 4-step user creation section with the new single command

Motivation

The new command works across all org types (scratch, sandbox, production) and auto-assigns AgentforceServiceAgentBase, AgentforceServiceAgentUser, and EinsteinGPTPromptTemplateUser — eliminating a common source of "Internal Error" on publish caused by missing permsets.

Test Plan

  • Ensure SF CLI 2.131.7+ is installed (sf --version)
  • On a scratch or sandbox org, run the skill and ask Claude to create an Einstein Agent User — verify it emits sf org create agent-user instead of the legacy sf data create record flow
  • Confirm the command output contains result.username with a GUID suffix and all 3 permsets listed under permissionSetsAssigned
  • Verify the created user is active: sf data query --json -q "SELECT Username, IsActive FROM User WHERE Profile.Name = 'Einstein Agent User' AND IsActive = true" -o <your-org>
  • Run npm run validate:skills -- --changed --base=origin/main and confirm it passes

Closes @W-22190552@

🤖 Generated with Claude Code

npiccolo and others added 3 commits April 30, 2026 12:29
Replace the legacy multi-step Einstein Agent User creation flow
(profile query + record creation + permset assignment) with the
new unified `sf org create agent-user` command available in SF CLI
2.131.7+. The new command works across all org types and auto-assigns
required permission sets.

Closes W-22190552

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@npiccolo npiccolo changed the title feat(developing-agentforce): use sf org create agent-user command feat: (developing-agentforce) use sf org create agent-user command May 4, 2026
Comment thread skills/developing-agentforce/references/agent-user-setup.md Outdated
Co-authored-by: Steve Hetzel <shetzel@salesforce.com>
@hsinghbisht-sfdc hsinghbisht-sfdc merged commit 9b91619 into forcedotcom:develop May 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants