--- name: agent-channel-deployment description: "Use when deploying an Agentforce agent to a channel surface: Embedded Service web chat, Slack, Experience Cloud, Agent REST API, or Salesforce Mobile. Triggers: 'deploy agent to website', 'add Agentforce to Slack', 'enable agent for mobile app', 'configure embedded service for agent', 'agent API for custom integration', 'multi-channel agent deployment'. NOT for agent logic design — use agentforce/agent-topic-design or agentforce/agent-actions for topics, instructions, and action contracts." category: agentforce salesforce-version: "Spring '25+" well-architected-pillars: - Reliability - User Experience triggers: - "how to deploy my Agentforce agent to the website so customers can chat with it" - "add Agentforce agent to Slack channel for internal support team" - "enable agent for mobile app using the Agent REST API" - "configure embedded service deployment to surface my Agentforce agent on Experience Cloud" - "how do I set up multi-channel deployment so the same agent works on web and Slack" - "CORS error when deploying Agentforce Embedded Service to my external site" tags: - agentforce - agent-channels - embedded-service - slack-deployment - agent-api - experience-cloud - multi-channel - channel-deployment inputs: - "Active Agentforce agent (agent must not be in Draft or Inactive state)" - "target channel type: Embedded Service, Slack, Experience Cloud, Agent API, or Mobile" - "target domain URLs for Embedded Service (required for CORS and CSP Trusted Sites)" - "Slack workspace details and OAuth app configuration (for Slack channel)" - "Named Credential or OAuth configuration for Agent API channel (for API/mobile)" outputs: - "channel deployment configuration steps and checklist per channel type" - "Embedded Service snippet code for web/Experience Cloud embedding" - "CORS and CSP Trusted Sites configuration guidance" - "Slack app OAuth scope list and Slack channel association guidance" - "Agent API authentication and request/response usage guidance" - "multi-channel testing and validation checklist" dependencies: [] version: 1.0.0 author: Pranav Nagrecha updated: 2026-04-04 --- # Agent Channel Deployment Use this skill when an Agentforce agent has been created and activated and now needs to be surfaced on a channel so that end users can interact with it. This skill covers all supported Agentforce channel surfaces — Embedded Service (web chat), Slack, Experience Cloud, the Agent REST API for programmatic integrations, and Salesforce Mobile — including configuration, CORS/CSP requirements, OAuth setup, and multi-channel coordination. It does NOT cover agent logic design: topics, instructions, action contracts, or reasoning engine configuration are handled by `agentforce/agent-topic-design` and `agentforce/agent-actions`. Channel deployment is a distinct lifecycle stage that comes after agent creation and activation. A successfully activated agent in Agentforce Builder is not yet accessible to users. Each channel requires its own separate configuration and publishing step. --- ## Before Starting Gather this context before working on anything in this domain: - Is the agent in Active state? Navigate to Setup > Agentforce Agents and confirm the status is Active, not Draft or Inactive. A non-Active agent cannot be associated with any channel deployment. - Which channel type or types are required? Each channel (Embedded Service, Slack, Agent API) has independent prerequisites and configuration steps. - For Embedded Service: what is the domain (origin URL) where the chat widget will be embedded? This is required for CORS Allowed Origins and CSP Trusted Sites configuration. - For Slack: does the Salesforce org have the Salesforce Slack app installed with admin consent? Slack channel deployment requires org-level OAuth token exchange, not per-user configuration. - For Agent API: what authentication method will the calling application use? Session ID (for Salesforce-authenticated clients) vs. OAuth 2.0 Connected App (for external apps) have different setup paths. - Has the Einstein Trust Layer been reviewed? Data sent through channels passes through the Trust Layer. Confirm ZDR and masking policies before opening a channel to external users. --- ## Core Concepts ### Channel Surfaces Are Independent Of Agent Definition An Agentforce agent definition (the Bot + BotVersion + GenAiPlannerBundle metadata bundle) exists independently of any channel. The same agent can be associated with multiple channel surfaces simultaneously. Each channel surface is a separate Salesforce metadata component or platform configuration record that points to the agent. Changing the agent definition (adding topics, updating instructions) requires republishing each dependent channel deployment for the changes to reach users — the channels do not auto-refresh. ### Embedded Service Deployment Is The Primary Web Channel Embedded Service Deployment (ESD) is the standard mechanism for surfacing an Agentforce agent in a web chat widget. The ESD produces a JavaScript snippet that is added to an Experience Cloud site or any external web page. The snippet loads the Salesforce Messaging for In-App and Web runtime and connects to the agent. For external pages (not hosted on Salesforce), CORS Allowed Origins must include every domain origin where the snippet runs, and CSP Trusted Sites must whitelist the Salesforce domain serving the widget assets. Omitting either setting causes the widget to silently fail to load. ### Slack Deployment Uses A Salesforce-Managed Slack App Agentforce deploys to Slack via a Salesforce-managed Slack application — not a custom Slack app created by the admin. The admin installs this managed Slack app into the Slack workspace through the Salesforce Setup flow (Setup > Agentforce > Slack Deployment). The OAuth flow during installation grants the necessary scopes: `chat:write`, `channels:read`, `app_mentions:read`, and `im:read` at minimum. After installation, the agent can be configured to respond in specific Slack channels or via direct messages. DM mode and channel-mention mode have different user experience implications and are configured separately. ### Agent REST API Enables Programmatic And Custom-Surface Integrations The Agentforce Agent API is a REST endpoint (`/services/data/vXX.0/einstein/ai-agent/agents/{agentId}/sessions`) that allows any external application to open a session with an Agentforce agent, send messages, and receive responses. This is the correct channel for mobile apps, custom web surfaces, IVR integrations, or third-party tools that cannot use Embedded Service. Authentication uses either a Salesforce Session ID (for internal Salesforce clients) or a Connected App OAuth 2.0 flow (for external clients). The Agent API is not the same as a custom Apex REST endpoint — it is a Salesforce platform endpoint managed by the Einstein Platform Services runtime. ### Multi-Channel Coordination Requires Per-Channel Testing A single agent deployed across multiple channels will behave identically in terms of reasoning, but the conversational experience differs: Embedded Service has a visual chat widget with rich formatting support, Slack follows Slack's message formatting conventions, and Agent API responses are JSON-structured for the calling app to render. Each channel should be tested independently in sandbox before production promotion. Channel-specific issues (CORS failures on web, OAuth scope errors on Slack, JSON malformation on API) do not surface in Agentforce Builder's Conversation Preview — they only appear when testing the actual channel surface. --- ## Common Patterns ### Pattern 1: Deploy Agent To Embedded Service (Web Chat) **When to use:** The agent needs to be accessible as a chat widget on an Experience Cloud portal or an external website. **How it works:** 1. Navigate to Setup > Embedded Service Deployments > **New**. 2. Select **Messaging for In-App and Web** as the channel type. 3. On the Basic Setup tab: enter a deployment name and API name. Select the target Experience Cloud site (or "None" for external sites). 4. On the **Messaging** tab: select the Agentforce agent from the agent selector. The agent must be in Active state for it to appear in the dropdown. 5. Configure the **Chat Settings**: set the pre-chat fields (if any), offline behavior, and branding colors. 6. On the **Security** tab: add each domain origin (e.g., `https://www.mycompany.com`) to **CORS Allowed Origins**. Also add the same domain to Setup > CSP Trusted Sites if the page includes `frame-src` or `connect-src` restrictions. 7. Click **Publish**. Salesforce generates the embedding snippet. 8. Copy the two-part snippet (the `