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

Subagents (12)

Account Management

3 actions

Handles customer inquiries about changing their contact information and resetting their password.

Ambiguous Question

0 actions

Redirect conversation to relevant topics when user request is too ambiguous.

Case Management

5 actions

Handles customer inquiries and actions related to support cases, including providing case information, updating existing cases, and creating new cases.

Delivery Issues

6 actions

Addresses customer concerns related to delivery problems with an order, including late deliveries or scheduling changes.

Escalation

0 actions

Handles requests from users who want to transfer or escalate their conversation to a live human agent.

General FAQ

1 action

This 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 actions

Redirect conversation to relevant topics when user request goes off-topic.

Order Inquiries

5 actions

Handles questions related to a user's order, order status, or order updates.

Premium Experience

3 actions

Validate Premium Experience, confirm Attendee and solve inquiries.

Reservation Management

4 actions

Handles requests to create new reservations for customers at their desired time slots.

Service Customer Verification

2 actions

Verifies 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 actions

Welcome the user and determine the appropriate topic based on user input.

Actions (20)

Add Case Comment

used by 1

Let a customer add a comment to an existing case.

Answer Questions with Knowledge

used by 6

Answers questions about company policies and procedures, troubleshooting steps, or product information.

Cancel Order

used by 2

Cancels a customer's order.

Create Case with Enhanced Data

used by 1

Create 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 1

Updates the scheduled delivery time to the time slot selected by the customer.

Finalize Reservation

used by 1

Books and finalizes a reservation for the time designated by the customer.

Get Case By Verified Case Number

used by 1

Returns a case associated with a given contact ID and case number.

Get Cases For Verified Contact

used by 1

Returns a list of cases related to a given Contact ID.

Get Delivery Time Slots

used by 1

Returns a list of available time slots to schedule a delivery.

Get Order By Order Number

used by 1

Returns the order information associated with a given contact ID and order number.

Get Orders By Contact

used by 2

Returns a list of orders associated with a given contact record.

Get Reservation Time Slots

used by 1

Returns a list of available time slots for the date specified by the customer.

Identify Customer By Email

used by 3

Identify 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 1

Confirm 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 1

Validate if there still are seats available and if the fan has enough points to redeem.

JGR Slack Notification

used by 1

Send a message to the Premium Experience Slack channel to notify the fan transaction.

Reset Secure Password

used by 1

Send a password reset link to the email address associated with the given Contact ID.

Send Email with Verification Code

used by 1

Sends 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 1

Updates fields on a customer's contact record, such as the email address, phone number, or postal address.

Verify Customer

used by 1

Verifies 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 nameLabelData typeSource SObject.FieldUse
ContactIdContact IdTextMessagingEndUser.ContactIdContact ID of the verified customer; consumed by every SvcCopilotTmpl__* flow that takes verifiedContactID.
EndUserIdEnd User IdTextMessagingSession.MessagingEndUserIdThe MessagingEndUser record ID.
EndUserLanguageEnd User LanguageTextMessagingSession.EndUserLanguageLocale for response generation.
RoutableIdRoutable IdTextMessagingSession.IdThe MessagingSession ID. Required by JGR_Experience_Validation to look up the active Premium Experience attendee context.
Welcome_MessageWelcome MessageTextMessagingSession.Welcome_Message__cCustom 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:

  1. Retrieve metadata:
    sf project retrieve start \
      --metadata "Bot:Fan_Agent" \
      --metadata "GenAiPlannerBundle:Fan_Agent_v4" \
      --target-org <alias>
    
  2. Replace the planner-bundle ID suffix (_16jKY000000CeFO) β€” Salesforce regenerates this on deploy; do not hard-code it in code.
  3. Provision dependencies:
    • Service Agent permission set licenses.
    • The 3 extra permission sets required for the bot user (per the EinsteinServiceAgent deployment pattern; see feedback memory).
    • MessagingSession.Welcome_Message__c custom 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.
  4. Update bot user: change <botUser>laila-asa@laila.demo</botUser> to the destination org's bot user.
  5. Channel setup: configure at least one Messaging channel; the agent expects 7 messageType mappings (already declared in the bot metadata).
  6. Premium Experience data model: the custom topic depends on Premium_Experience__c and Premium_Experience_Attendee__c (or equivalent objects) read by JGR_Experience_Validation via MessagingSession.Id.
  7. 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).