Deploy an Agentforce Agent to Experience Cloud

Deploy Agentforce to Experience Cloud: messaging channel, embedded deployment, site component

Hey friends,

You’ve built a service agent. Now you want customers to chat with it on your Experience Cloud site. Here’s how the pieces connect.

To add an Agentforce agent to an Experience Cloud site, you need four things: an Enhanced Chat messaging channel routed to the agent, a published embedded service deployment, the Embedded Messaging component on the site, and the site’s domain on your CORS allowlist.

These steps follow Salesforce’s Agentforce workshop and a Trailhead deployment unit. Start with an activated agent. If you don’t have one, my Agentforce Builder walkthrough covers that.

What do I set up in Messaging first?

  1. In Setup, open Messaging Settings and set Messaging to On.
  2. Create a Routing Configuration.
  3. Create a Queue for the Messaging Session object. This is the fallback queue. Conversations go there when the agent hands off to a person.
  4. Create a presence status, a permission set that grants it, and a presence configuration. This lets service reps go online.

What domain do I enter?

Publish your Experience Cloud site and copy its URL. The channel wants just the domain, with no https:// and no path (workshop).

So https://mydomain.my.site.com/s/ becomes mydomain.my.site.com. (Pasting the full URL is an easy mistake to make here.)

How do I connect the channel to the agent?

  1. In Messaging Settings, click New Channel, then Start.
  2. Select Enhanced Chat.
  3. Enter a channel name, set Deployment Type to Web, and paste the domain.
  4. For Routing Type, choose Agentforce Service Agent and pick your agent. Or choose Omni-Flow and pick an inbound flow (Omni-Flow is a flow that decides where a conversation goes).
  5. Choose the fallback queue, accept the terms and save.
Add a Channel wizard at the Channel Routing step with Routing Type set to Omni-Flow, and empty Flow Definition and Fallback Queue fields
In the Add a Channel wizard, set Routing Type to Omni-Flow, then pick a flow and a fallback queue.

How do I publish the embedded service deployment?

An embedded service deployment is the settings package for the chat window. Trailhead notes that creating the channel can create one for you. If you need to make it yourself:

  1. In Setup, open Embedded Service Deployments and click New Deployment.
  2. Select Messaging for In-App and Web, then Web.
  3. Use the same domain and select your channel.
  4. Save, then click Publish.

Want a pre-chat form that asks for a name and email first? In the deployment, click Edit Pre-Chat and activate it. Parameter mappings on the channel pass those values to your flow. Use Test Messaging to try it before it goes on the site (Trailhead).

Cert Lab by Nick Frates

Practice deployment questions

Exam-style questions on deploying and testing agents, with each answer explained, plus lessons for all six Agentforce Specialist sections.

Start the Agentforce Specialist Cert Lab for $9.99 →

How do I add the chat to the site?

  1. In Setup, go to All Sites and click Builder next to your site.
  2. Open the Components panel, search for Embedded Messaging, and drag it onto the page.
  3. Make sure your messaging configuration is selected.
  4. Click Publish.

Publishing can take a few minutes. Then open the site and look for the messaging icon in the lower-right corner (workshop).

Experience Builder Components panel searched for Embedded Messaging, with the component listed under Support (1)
Search the Components panel for Embedded Messaging; it appears under Support.

Why won’t the chat window load?

Check CORS first. CORS (cross-origin resource sharing) is the list of outside domains Salesforce trusts. Without your site on it, the chat window won’t load, and you get no obvious error (Trailhead).

  1. In Setup, open Digital Experiences > Settings and copy the default domain name.
  2. In Setup, open CORS, click New, and enter that domain with https:// in front.
  3. If the *.live-preview domain gives you trouble, add it too.

How do I test the handoff to a person?

Start a chat on the site as an existing contact. With no reps online, ask for a human. The agent should say no one is available and offer to create a case.

Then set yourself Online in Omni-Channel in the Service Console, ask again, and accept the request. If both work, you’re done.

If the agent can’t read data during the chat, check the agent user’s access. My Agentforce permissions setup post covers that. Deploying and testing agents is part of the Testing, Deployment, and Maintenance section (10%) of the Agentforce Specialist exam guide. For more, see the Agentforce guide and my Salesforce certification study guides.

Cert Lab by Nick Frates

Get ready for the Agentforce Specialist exam

Lessons, practice questions and flashcards for every exam section, with each answer explained.

Start the Agentforce Specialist Cert Lab for $9.99 →

Where are you putting your agent first? Let me know!

Hope this helps!

Best,

Nick

Keep reading

See all posts →

Salesforce Saturdays

Join 1,034 Salesforce pros getting one 10-minute tip on Salesforce tech or career growth every Saturday.