Sub topic 13
Activating the agent and choosing where it runs
An agent that works in the builder preview is not yet available to anyone else. Activation makes a version of the agent live, and a channel decides where users reach it. This chapter covers both steps and what changes when you edit an active agent. It also covers which channels are realistic in a Developer Edition org.
This chapter assumes you have already built an agent with at least one topic and some actions, and have tested it in the conversation preview. It also assumes you can navigate Setup and have a Developer Edition org with Agentforce enabled and the right permission sets assigned.
What activation does
An agent in Agentforce Builder is saved as a version. A new version starts inactive. In that state you can edit it freely and run it in the preview, but real users and channels cannot reach it.
Activating a version has three effects:
- The version becomes the one that channels and APIs call.
- The version becomes locked. To change topics, instructions, or actions, you make a new version and edit that.
- Any previously active version of the same agent is deactivated, because only one version is active at a time.
Two things are easy to confuse. Saving a change is not the same as activating it. Testing in the preview is also not the same as running in a channel. The preview uses the builder's own session, so it does not exercise routing, channel permissions, or deployment configuration.
Activate the agent
- Open the agent in Agentforce Builder.
- Run a final pass in the conversation preview, including one off-topic message to confirm the scope instruction holds.
- Click Activate in the builder header and confirm.
- Check that the status now reads as active.
Menu labels move between releases, so if you cannot find a button, look for the same action in the agent's header or its Setup page.
If you work with source control, you can retrieve the agent's metadata and check its status without opening the UI. The commands below reuse the org alias from the earlier login step.
sf project retrieve start --metadata Bot --target-org agentforce-dev
grep -r "<status>" force-app/main/default/botsThe retrieved files vary with the API version of your project. Some versions put version details in a separate botVersions folder. The <status> element shows Active or Inactive for the version.
Deactivating and versioning
Deactivate a version when you need to stop traffic immediately, for example after an agent gives a wrong answer. Users in a channel then get the channel's fallback behavior, which depends on the channel and may mean no agent answer at all.
For routine changes, prefer making a new version over deactivating. The sequence is:
- Create a new version from the active one.
- Edit and test the new version in the preview.
- Activate the new version, which replaces the old one.
This keeps the agent available while you work. It also leaves the earlier version in place if you need to switch back.
Two agent types, two sets of channels
The channels available to you depend on the agent type chosen when you created the agent.
| Agent type | Intended users | Typical places it runs |
|---|---|---|
| Employee agent | Your own Salesforce users | The Agentforce panel in Lightning Experience, and employee-facing tools such as Slack |
| Service agent | Customers and other external users | Messaging-based chat on a website or Experience Cloud site, and other service channels |
Salesforce adds channels regularly, and availability depends on release, licenses, and edition. Check the current documentation before committing to a channel.
The practical difference is how the user gets authenticated. An employee agent runs for a logged-in Salesforce user, so that user's permissions apply. A service agent runs for people who are usually not Salesforce users. It acts through a dedicated agent user, which is why the agent user's permissions matter so much for service agents. The chapter on permission sets covered that user.
Employee agent in Lightning Experience
This is the easiest channel to try in a Developer Edition org, because it needs no external routing setup.
- Activate the agent.
- Confirm the users who should reach it have the required permission set assigned.
- Open a Lightning Experience app and look for the Agentforce entry point, usually in the header or utility area.
- Select the agent if more than one is listed, and send a message.
Because the agent runs as the signed-in user, check that user's access to objects used by your actions. The GetOpenCaseCountAction class from the earlier chapter uses with sharing, so it only counts cases the running user can see. Two users can get different counts from the same agent, and that is correct behavior. It is not a bug.
Service agent with messaging
A service agent on a website or site uses Salesforce's messaging infrastructure. The agent is one piece of a chain, and every link must be configured:
- Messaging channel. A channel record that defines the entry point, such as an embedded chat.
- Omni-Channel routing. A routing configuration and queue or flow that decides where an incoming conversation goes. To send it to the agent, you point the routing at the agent rather than at human reps.
- Deployment. An embedded deployment that generates the snippet to place on a site or Experience Cloud page.
- Agent user permissions. The agent user needs access to the data your topics and actions touch.
The dotted escalation path shows an optional design choice. If your agent should hand off to a person, you need a human queue and a defined escalation route. Without one, a customer with an out-of-scope request has no way out, so write instructions that handle that case.
Developer Edition limits that affect channels
Developer Edition is a free development environment, so treat its channel support as a testing ground and not a production host. Things to expect:
- Some channels and add-on features may be unavailable, or may need licenses that a Developer Edition org does not include.
- Messaging and Omni-Channel setup can run into limits on licenses, channel counts, or provisioned features.
- Usage allowances for generative AI are limited, so heavy testing can hit a cap.
- A Developer Edition org is not meant for real customer traffic. Public deployments belong in a sandbox or production org with proper licensing.
The reliable approach is to use Developer Edition to validate the agent itself: topics, instructions, and actions. Use the Lightning Experience employee channel to prove the end-to-end behavior. Leave external channels for an org licensed for them.
Programmatic access
Besides channels in Salesforce, an agent can be called from outside through an API that starts a session and exchanges messages. It requires an active agent and an authentication setup, normally a connected app or external client app. Use it when you want to embed the agent in your own application. Because the agent is called through the API, the same activation rule applies: a version must be active.
Common problems
| Symptom | Likely cause | Fix |
|---|---|---|
| Agent missing from the Agentforce panel | Not activated, or user lacks the permission set | Activate the version and assign the permission set |
| Edits do not appear for users | Edited a new version but did not activate it | Activate the new version |
| Can't edit an active agent | Active versions are locked | Create a new version and edit that |
| Different users get different answers | Actions run with the user's sharing and field access | Check each user's access, or review the `with sharing` choice in your Apex |
| Customer chat never reaches the agent | Routing points at a human queue, or the agent user lacks access | Check the Omni-Channel routing target and the agent user's permissions |
| Chat works in preview but fails in the channel | Preview skips routing and deployment | Test the channel setup directly |
Before you go live
- Test in the preview with in-scope, out-of-scope, and empty-result cases.
- Confirm only the intended version is active.
- Run the agent from an ordinary user account, not just as an admin.
- Decide what happens on escalation and when an action fails.
- Keep a prior version available for fast rollback.
Exercise
You edit the instructions of an agent that is already active, save, and test in the preview. The change works in the preview, but users in Lightning Experience still see the old behavior. What most likely happened, and what do you do?
Show answer
The active version is locked, so your edits went into a new, inactive version, and users are still being served the old active version. Preview runs the version you are editing, not the active one. Activate the new version, which deactivates the old one, and then test from a regular user account in the channel.
Exercise
A service agent answers correctly in the preview, but customers in the website chat never get an agent reply. Name two parts of the chain you would check that the preview does not exercise.
Show answer
Check the Omni-Channel routing, which must send incoming conversations to the agent and not to a human queue. Also check the messaging channel and embedded deployment configuration, and the agent user's permissions. Any of these can break the live path while the preview, which bypasses them, still works.