Agentforce Agent
Fan Agent (Nacho Fan Agent)
Download .md**Description**: Deliver personalized customer interactions with an autonomous AI agent. Agentforce Service Agent intelligently supports your customers with common inquiries and escalates complex issues. The Laila instance is themed around fans of an event — its differentiator from a stock Service Agent is the **Premium Experience** topic, which lets a fan redeem points for better seats and notifies the operations team via Slack.
Architecture
Planner · Atlas
Concurrent Multi-Agent Orchestration
The planner reads each user turn, picks one or more topics, and invokes their actions.
Required before any topic that returns or mutates customer data
Functional topics
Control
Subagents (12)
Account Management
3 actionsHandles customer inquiries about changing their contact information and resetting their password.
Ambiguous Question
0 actionsRedirect conversation to relevant topics when user request is too ambiguous.
Case Management
5 actionsHandles customer inquiries and actions related to support cases, including providing case information, updating existing cases, and creating new cases.
Delivery Issues
6 actionsAddresses customer concerns related to delivery problems with an order, including late deliveries or scheduling changes.
Escalation
0 actionsHandles requests from users who want to transfer or escalate their conversation to a live human agent.
General FAQ
1 actionThis topic is for helping answer customer's questions by searching through the knowledge articles and providing information from those articles. The questions can be about the company and its products, policies or business procedures.
Off Topic
0 actionsRedirect conversation to relevant topics when user request goes off-topic.
Order Inquiries
5 actionsHandles questions related to a user's order, order status, or order updates.
Premium Experience
3 actionsValidate Premium Experience, confirm Attendee and solve inquiries.
Reservation Management
4 actionsHandles requests to create new reservations for customers at their desired time slots.
Service Customer Verification
2 actionsVerifies the customer's identity before granting access to sensitive data. Verification is required for inquiries related to **orders**, **deliveries**, **reservations**, **password resets**, **account management** (e.g. contact information updates), or **cases**. Sensitive data includes confidential, private, or security-protected information, such as business-critical data or personally identifiable information (PII).
Topic Selector
0 actionsWelcome the user and determine the appropriate topic based on user input.
Actions (20)
Add Case Comment
used by 1Let a customer add a comment to an existing case.
Answer Questions with Knowledge
used by 6Answers questions about company policies and procedures, troubleshooting steps, or product information.
Cancel Order
used by 2Cancels a customer's order.
Create Case with Enhanced Data
used by 1Create a case for the customer that's transferred from the AI agent to a service rep. The case includes all information gathered from the customer, a summary of the progress made by the AI agent, a link to the conversation, and any attachments.
Finalize New Delivery Time
used by 1Updates the scheduled delivery time to the time slot selected by the customer.
Finalize Reservation
used by 1Books and finalizes a reservation for the time designated by the customer.
Get Case By Verified Case Number
used by 1Returns a case associated with a given contact ID and case number.
Get Cases For Verified Contact
used by 1Returns a list of cases related to a given Contact ID.
Get Delivery Time Slots
used by 1Returns a list of available time slots to schedule a delivery.
Get Order By Order Number
used by 1Returns the order information associated with a given contact ID and order number.
Get Orders By Contact
used by 2Returns a list of orders associated with a given contact record.
Get Reservation Time Slots
used by 1Returns a list of available time slots for the date specified by the customer.
Identify Customer By Email
used by 3Identify a customer by their email address and return their contact record. Used to anchor a conversation to a specific contact for read-only flows that don't need full verification.
JGR Confirm Experience Attendee
used by 1Confirm that the fan has confirmed to redeem the offer to get better seats. The flow updates the Premium Experience Attendee record to a confirmed state and returns a transaction confirmation code.
JGR Experience Validation
used by 1Validate if there still are seats available and if the fan has enough points to redeem.
JGR Slack Notification
used by 1Send a message to the Premium Experience Slack channel to notify the fan transaction.
Reset Secure Password
used by 1Send a password reset link to the email address associated with the given Contact ID.
Send Email with Verification Code
used by 1Sends a generated verification code to the user's email address. The flow generates a random code, persists an authentication key, and emails the code to the customer.
Update Verified Contact
used by 1Updates fields on a customer's contact record, such as the email address, phone number, or postal address.
Verify Customer
used by 1Verifies whether the verification code entered by the user matches the code sent to the user's email address. On success, downstream topics (Account, Cases, Orders, Deliveries, Reservations) can use the resulting `customerId` as the verified Contact ID.
Context variables
The bot exposes 5 messaging context variables. None are injected into the prompt (includeInPrompt = false); they are populated by the channel and consumed by the actions.
| Developer name | Label | Data type | Source SObject.Field | Use |
|---|---|---|---|---|
ContactId | Contact Id | Text | MessagingEndUser.ContactId | Contact ID of the verified customer; consumed by every SvcCopilotTmpl__* flow that takes verifiedContactID. |
EndUserId | End User Id | Text | MessagingSession.MessagingEndUserId | The MessagingEndUser record ID. |
EndUserLanguage | End User Language | Text | MessagingSession.EndUserLanguage | Locale for response generation. |
RoutableId | Routable Id | Text | MessagingSession.Id | The MessagingSession ID. Required by JGR_Experience_Validation to look up the active Premium Experience attendee context. |
Welcome_Message | Welcome Message | Text | MessagingSession.Welcome_Message__c | Custom welcome message rendered by topic_selector. |
All five mappings cover seven channel messageTypes: Text, EmbeddedMessaging, AppleBusinessChat, Custom, Line, WhatsApp, Facebook.
Routing & escalation
<plannerSurfaces>
<surface>SurfaceAction__Messaging</surface>
<surfaceType>Messaging</surfaceType>
<adaptiveResponseAllowed>true</adaptiveResponseAllowed>
<outboundRouteConfigs>
<escalationMessage>One moment, I'm transferring our conversation to get you more help.</escalationMessage>
<outboundRouteName>JGR_Route_to_ASA_Laila</outboundRouteName>
<outboundRouteType>OmniChannelFlow</outboundRouteType>
</outboundRouteConfigs>
</plannerSurfaces>
Hand-off goes through the OmniChannel flow JGR_Route_to_ASA_Laila with the user-facing message above. Triggered exclusively from the escalation topic.
Reuse / port-to-another-org checklist
When cloning this agent into another org:
- Retrieve metadata:
sf project retrieve start \ --metadata "Bot:Fan_Agent" \ --metadata "GenAiPlannerBundle:Fan_Agent_v4" \ --target-org <alias> - Replace the planner-bundle ID suffix (
_16jKY000000CeFO) — Salesforce regenerates this on deploy; do not hard-code it in code. - Provision dependencies:
- Service Agent permission set licenses.
- The 3 extra permission sets required for the bot user (per the
EinsteinServiceAgentdeployment pattern; see feedback memory). MessagingSession.Welcome_Message__ccustom field.- All
SvcCopilotTmpl__*flows (Service Agent template — installed as a managed package). - The 3 custom Premium Experience flows:
JGR_Experience_validation,JGR_Confirm_Premium_Experience_Attendee,JGR_Send_Slack_Message_Premium_Experience. - The OmniChannel routing flow
JGR_Route_to_ASA_Laila. - Slack named credential / app used by the Slack notification flow.
- Update bot user: change
<botUser>laila-asa@laila.demo</botUser>to the destination org's bot user. - Channel setup: configure at least one Messaging channel; the agent expects 7
messageTypemappings (already declared in the bot metadata). - Premium Experience data model: the custom topic depends on
Premium_Experience__candPremium_Experience_Attendee__c(or equivalent objects) read byJGR_Experience_ValidationviaMessagingSession.Id. - Activate the bot version (
v4) after deploy.
Related metadata
force-app/main/default/bots/Fan_Agent/Fan_Agent.bot-meta.xml— bot definition + context variables.force-app/main/default/bots/Fan_Agent/v4.botVersion-meta.xml— version pointer.force-app/main/default/genAiPlannerBundles/Fan_Agent_v4/Fan_Agent_v4.genAiPlannerBundle— full topic + action definitions.force-app/main/default/genAiPlannerBundles/Fan_Agent_v4/agentScript/Fan_Agent_v4_definition.agent— empty in current retrieve (planner uses XML metadata).force-app/main/default/genAiPlannerBundles/Fan_Agent_v4/localActions/<topic>/<action>/{input,output}/schema.json— JSON Schema for every action's IO.
The org also contains older inactive versions: Fan_Agent_v1, Fan_Agent_v2, Fan_Agent_v3. Active deployment is v4 (last modified 2026-06-01).
