/service-engagement:service-digital-engagement-channel-configurefrom Salesforce Service Engagement
Creates and deploys MessagingChannel metadata for Salesforce Messaging for In-App and Web (MIAW). Configures Omni-Channel routing, user verification, pre-chat forms, automated responses, and consent settings via Metadata API.
Ships in Salesforce Service Engagement. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Creates MessagingChannel metadata XML for Salesforce Messaging for In-App and Web (MIAW). This skill produces a fully configured enhanced chat channel with routing, user verification, pre-chat, and automated response settings ready for Metadata API deployment.
MessagingChannel metadata with Omni-Channel Flow routing, Omni-Channel Queue routing, or Agentforce Service Agent (ASA) routing; enabling User Verification; configuring all channel settings (pre-chat forms, automated responses, consent keywords, file attachments, custom parameters)automation-flow-generate), creating the Embedded Service Deployment (separate metadata type — use service-digital-engagement-deployment-configure), creating permission sets for messaging (use platform-permission-set-generate), configuring the Embedded Service Code Snippetcontext.calledFrom == "service-onboarding"): use the supplied values for parameter transport only. Before any mutation, verify that the target org and change description match an explicit user authorization obtained by the caller. If context.userAuthorizationRef is absent, prompt the user to confirm. Return failed naming any missing required key. Standalone (no context): ask for the Inputs below.^[A-Za-z0-9_.@+-]+$ before use in a command; otherwise stop and ask (delegated: failed). Pass the channel label single-quoted, escaping any ' as '\''.dispatch / dispatch_readonly on /headless/metadata. Transport B: the sf commands below, only where a probe shows Transport A unavailable.Details: references/onboarding_contract.md (§1 entry points, §2 transport, §3 pre-scan, §5 result).
Standalone: ask for anything not already clear. Delegated: take values.
masterLabel and file name (<Name>.messagingChannel-meta.xml)Queue, Flow, User, or AgentforceServiceAgentfalse, so authMode UnAuth). true makes an Auth channel; a keyset name is optional (with one, also an authIdentifier, a free-form label defaulting to the file name). Creating keys is a separate setupApply every other default from references/channel_settings.md unless the user specifies otherwise.
Run in order; step 3a may jump to step 15 or Phase 4. All SOQL below: Transport A dispatch_readonly first, sf data query as fallback.
Verify org API version — run scripts/check-api-version.sh 67.0 '<org-alias>' (skip it when Transport A is in use). If the script exits non-zero (1 below minimum, 2 unknown), STOP and report the error to the user (delegated: failed). Do NOT generate sfdx-project.json or proceed with any metadata writes until the API version is successfully verified. A failed version check is a blocking precondition.
Collect inputs — standalone: ask for the Inputs. Delegated: from values. Then probe transport with a read-only GET of MessagingChannel (contract §2).
Determine file name — run scripts/normalize-channel-name.sh '<LABEL>' and surface any errors it returns.
3a. Pre-scan — GET MessagingChannel by the step 3 name (contract §3): none → create; matches and active → no write, already-configured, skip to Phase 4; matches but inactive → activate only (step 15); differs → announce each change, then write the full document (standalone: ask first; delegated: confirm per contract section 3).
Verify routing target exists — skip when step 3a ended in already-configured or activate-only, so a re-run never creates a queue. Names must match ^[A-Za-z0-9_.@+-]+$ before they go into a query. Query the org to confirm the referenced routing target exists:
sf data query --query "SELECT Id, DeveloperName FROM Group WHERE Type='Queue' AND DeveloperName='<QUEUE_NAME>'" --target-org <org-alias>sf data query --query "SELECT Id, ApiName FROM FlowDefinitionView WHERE ApiName='<FLOW_NAME>' AND IsActive=true" --target-org <org-alias>sf data query --query "SELECT Id, Username FROM User WHERE Id='<USER_ID>' AND IsActive=true" --target-org <org-alias>sf data query --query "SELECT Id, DeveloperName FROM BotDefinition WHERE DeveloperName='<BOT_NAME>'" --target-org <org-alias>If any target is not found: standalone — inform the user and ask whether to create it. Delegated — return failed naming the missing target; never create it. If the standalone user confirms creating:
.queue-meta.xml with MessagingSession as the queueSobject type and deploy it before the channel. A new queue needs a QueueRoutingConfig, or sessions fail with "Agents are not available. Try again later" even though the channel deploys and activates. Right after the queue deploys, resolve or create one per service-agentforce-channel-configure's references/queue-resolution.md Step 4 — do not defer it.Read the channel settings reference — load references/channel_settings.md to understand all available configuration options and their valid values.
Read the metadata template — new channel: load assets/messaging_channel_template.xml as the starting structure. Existing channel (3a): start from its current document (Transport A GET xmlRep; Transport B sf project retrieve start -m MessagingChannel:<Name>) and change only the targeted elements, so pre-chat, responses, and authorizations survive.
Apply routing configuration — set sessionHandlerType and the corresponding handler field:
| Routing Type | sessionHandlerType | Required Fields |
|---|---|---|
| Omni-Channel Queue | Queue | sessionHandlerQueue |
| Omni-Channel Flow | Flow | sessionHandlerFlow + sessionHandlerQueue (fallback) |
| User | User | sessionHandlerUser + sessionHandlerQueue (fallback) |
| Agentforce Service Agent | AgentforceServiceAgent | sessionHandlerQueue (fallback) + sessionHandlerAsa (bot dev name — required, see v67 note below) |
v67 note —
<sessionHandlerAsa>is required (omitting it fails with "Missing required Agentforce Service Agent"); the deploy then bindsSessionHandlerId, no PATCH needed. The bot must be Active first: runsf agent activate -o <org> --api-name <BotDevName>and confirmBotVersion.Status = Active.
Apply user verification — not enabled: set embeddedConfig.authMode to UnAuth and omit <messagingAuthorizations>. Enabled: follow references/user_verification.md (add <messagingAuthorizations> only for a keyset name the user gave; never invent one, and without one still write Auth).
Configure embedded settings — populate <embeddedConfig> per references/channel_settings.md: anonymousUserJwtExpirationTime for UnAuth, verifiedUserJwtExpirationTime for Auth.
9a. Configure session inactivity (optional) — ask using the Setup labels and set the top-level fields per references/channel_settings.md → "Setup Prompts: Session Inactivity".
Configure messaging keywords — generate <messagingKeywords> elements:
OptOut type with individual <keyword> elements: cancel, end, quit, stop, stopall, unsubscribeHelp type with <keyword>: helpApply standard parameters — if the user needs standard pre-chat fields, follow references/prechat_params.md → Standard parameters.
Apply custom parameters — if the user needs pre-chat data collection, follow references/prechat_params.md → Custom parameters (parameterDataType is always String).
Generate the file — produce the .messagingChannel-meta.xml file following the template structure. Place at the path the user specifies, or default to <source-path>/messagingChannels/<ChannelName>.messagingChannel-meta.xml under the project's metadata source path.
Write the channel — Transport A: POST to create, PUT the full document to update (a minimal PUT drops embeddedConfig); check results[].success, then re-GET. Transport B:
sf project deploy start --source-dir <path-to-messagingChannels-folder> --target-org <org-alias>
Activate the channel — after a successful write, activate the messaging channel (IsActive is not part of the metadata). Transport A: sObject update {"IsActive": true} through dispatch. Transport B:
sf data update record --sobject MessagingChannel --where "DeveloperName='<CHANNEL_NAME>'" --values "IsActive=true" --target-org <org-alias>
15a. ASA routing only — verify the bind landed (skip for Queue, Flow, User):
```bash
sf data query -o <org> --json \
-q "SELECT SessionHandlerId, FallbackQueueId FROM MessagingChannel WHERE DeveloperName='<CHANNEL_DEV_NAME>'"
```
Both must be non-null; if not, check both handler elements were in the XML and the bot was Active before the deploy.
Verify against checklist — confirm all items in the Verification Checklist below pass before presenting output.
Report — delegated: return the contract §5 result and stop. Standalone: continue.
Present output (standalone) — in a few lines: confirm the channel is created and its activation status, and list each setting the user asked for with its final value, whatever field it is. Say everything else uses the defaults, without listing them. Give transport details, file paths and record Ids only after a failure or if asked. Then offer next steps:
references/channel_settings.md → "Setup Prompts: Automated Responses", then redeploy.references/recaptcha_handoff.md.| Constraint | Rationale |
|---|---|
| File name serves as the channel API name | No channelPlatformKey field in the XML body |
sessionHandlerType must match the handler fields present | Setting Queue but populating sessionHandlerFlow causes deployment error |
Flow routing requires both sessionHandlerFlow and sessionHandlerQueue | Queue is the mandatory fallback for human escalation |
User routing requires both sessionHandlerUser and sessionHandlerQueue | Queue is the mandatory fallback when user is unavailable |
masterLabel max 40 characters | Platform limit on channel labels |
File name must match ^[a-zA-Z][a-zA-Z0-9_]*$ | API name format enforced by Metadata API |
allowedFileTypes is a comma-separated string with no spaces | Not a nested list or array |
keyword elements are individual — one per trigger word | Not a comma-separated list |
customParameters need name, masterLabel, parameterDataType, and externalParameterName | Incomplete parameters fail silently |
File extension is .messagingChannel-meta.xml | Metadata API uses this specific extension |
Do not hardcode file paths — respect sfdx-project.json package directories | Customer orgs customize source paths |
| Channel must be activated after deployment | Channels are inactive by default — messages won't route until activated |
isSynchronousChatEnabled defaults to false; can only be true for UnAuth channels upon user request | Platform rejects "You can't enable Session-Based Chat for verified users" for Auth channels |
| Issue | Resolution |
|---|---|
ASA routing: include both sessionHandlerQueue and sessionHandlerAsa in the XML | sessionHandlerAsa is required at v67 — the deploy fails with "Missing required Agentforce Service Agent" if omitted; the deploy itself binds SessionHandlerId, no PATCH needed |
Bot must be Active before the metadata deploy that binds SessionHandlerId | API rejects with "Only active Agentforce Service Agents are supported" if the bot is inactive |
| Channel name conflicts with existing channel | Check org for existing channels; file name must be unique |
| Queue not found on deploy | Ensure the referenced queue exists and has MessagingSession as a queueSobject type |
| Channel deploys and activates fine, but widget shows "Agents are not available. Try again later." at session start | The queue has no QueueRoutingConfig — this is silent at deploy time. Check SELECT QueueRoutingConfigId FROM Group WHERE Id='<QUEUE_ID>'; if null, resolve/create one per queue-resolution.md Step 4 |
| Omni-Channel Flow not found on deploy | Ensure the referenced flow exists and is active before deploying the channel |
| ASA bot reference invalid | Bot must be published and active; use exact developer name from BotDefinition metadata |
ASA channel deployed but SessionHandlerId is null after deploy | Bot was not Active at deploy time — run sf agent activate, confirm BotVersion.Status = Active, then redeploy |
| ASA channel deploy fails with "Missing required Agentforce Service Agent" | <sessionHandlerAsa>{BotDevName}</sessionHandlerAsa> is missing from the XML — it's required at v67, not optional |
| "Only active Agentforce Service Agents are supported" on deploy | Bot is inactive — run sf agent activate before deploying |
| Flow or ASA routing fails without fallback queue | sessionHandlerQueue is mandatory when sessionHandlerType is Flow or AgentforceServiceAgent |
| JWT verification not working | The keyset (PublicKeyCertificateSet) named in messagingAuthorizations must exist in the org and match the token's kid and issuer |
| Custom parameters not collected | name must be unique per channel |
<customParameters> deploy fails: "bad value for restricted picklist field" | parameterDataType was set to something other than String. Channel custom parameters are always String; set the field's actual type (Number, Checkbox, dropdown) at the deployment level, not here |
| Removing a custom parameter: "can't be deleted as it is referenced elsewhere" | Check before deploying, not after. Every deployment on this channel whose pre-chat form uses the param must first drop that field and be published (user-approved); remove the param's actionParameterMappings in a separate deploy first. See references/channel_settings.md §Removing a Custom Parameter |
| Automated response / session-inactivity deploy fails | See references/channel_settings.md → "Automated Responses", "Session Settings" |
| Channel deployed but messages not routing | Channel must be activated after deployment — it defaults to inactive |
| "You can't enable Session-Based Chat for verified users" | Set isSynchronousChatEnabled to false for Auth channels — session-based chat is only valid for UnAuth |
^[a-zA-Z][a-zA-Z0-9_]*$, masterLabel is 40 characters or fewer, messagingChannelType is EmbeddedMessaging?embeddedConfig.authMode is Auth when verification is enabled, UnAuth when not, with the matching JWT expiration set in range (references/channel_settings.md)?chatAbandonmentTimeout is a positive integer, allowedFileTypes is comma-separated with no spaces, maxFileSize is 1-5 MB?OptOut keyword is defined, keywords are individual <keyword> elements, and language is set on each keyword block?references/channel_settings.md?sessionHandlerType value set (Queue, Flow, User, or AgentforceServiceAgent)?sessionHandlerQueue in the XML?sessionHandlerFlow in the XML, plus sessionHandlerQueue as fallback?sessionHandlerUser in the XML, plus sessionHandlerQueue as fallback?sessionHandlerQueue and sessionHandlerAsa in the XML?SessionHandlerId and FallbackQueueId non-null after the deploy?IsActive=true)?| Need | Delegate to |
|---|---|
| Creating the Omni-Channel Flow for routing | automation-flow-generate skill |
| Creating permission sets for messaging agents | platform-permission-set-generate skill |
| Creating the Embedded Service Deployment | service-digital-engagement-deployment-configure skill |
Creating the ConversationMessageDefinition an automated response references | conversation-message-definition-builder skill |
| File | When to read |
|---|---|
references/onboarding_contract.md | Delegated mode (context.calledFrom == "service-onboarding"), org writes (transport), module registration |
assets/messaging_channel_template.xml | Before generating — use as the starting structure |
references/channel_settings.md | When configuring channel options beyond defaults |
references/user_verification.md | The user turns user verification (Auth mode) on |
references/prechat_params.md | The user needs standard or custom pre-chat parameters |
references/recaptcha_handoff.md | The user asks about reCAPTCHA / captcha, or at the end of standalone output |
scripts/check-api-version.sh | Phase 1 — verify org API version meets the passed minimum (67.0) |
scripts/normalize-channel-name.sh | Phase 1 — derive file API name from channel label |
examples/omni_flow_channel.xml, omni_queue_channel.xml, asa_agent_channel.xml, auth_queue_channel.xml (Auth with keyset) | To verify output for Flow, Queue, or Agentforce Service Agent routing |
assets/messaging_channel_template.xml (opens in a new tab)examples/asa_agent_channel.xml (opens in a new tab)examples/auth_queue_channel.xml (opens in a new tab)examples/omni_flow_channel.xml (opens in a new tab)examples/omni_queue_channel.xml (opens in a new tab)references/channel_settings.md (opens in a new tab)references/onboarding_contract.md (opens in a new tab)references/prechat_params.md (opens in a new tab)references/recaptcha_handoff.md (opens in a new tab)references/user_verification.md (opens in a new tab)scripts/check-api-version.sh (opens in a new tab)scripts/normalize-channel-name.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
13 skills in this plugin
/service-agentforce-channel-configureWires an existing, active Agentforce agent to a channel by resolving a fallback queue, setting up inbound routing (either PATCH SessionHandlerId on the MessagingChannel, or an inbound RoutingFlow for Voice/Email), and optionally configuring outbound escalation. Use when the user wants to add a channel to an existing agent, connect an agent to a messaging or voice channel, route Voice or Email-to-Case to an Agentforce agent, or set up a fallback queue for an agent channel. Also applies to an existing Help Agent. The channel infrastructure must already exist — this skill adds routing. DO NOT TRIGGER when the agent does not yet exist or still needs Help Agent setup (use agentforce-generate or service-helpagent-coordinate), when setting up Email-to-Case with an agent end-to-end (use service-email-to-case-configure), when creating the MessagingChannel itself (use service-digital-engagement-channel-configure), or when creating an Embedded Service Deployment (use service-digital-engagement-deployment-configure)./service-agentforce-human-escalation-configureUse to configure and verify Agentforce agent-to-human escalation, including human handoff, a staffed fallback queue, and failure-threshold directives. Triggers: configure agent escalation, escalate to a human agent, agent handoff to a queue, configure a human escalation queue, set an Agentforce fallback handoff. Do not use to create an agent or configure inbound channel routing; use service-agentforce-channel-configure for inbound routing.npx claudepluginhub forcedotcom/sf-skills --plugin service-engagementOther plugins' skills for the same job