Loading
Upcoming Mandatory Changes to Public Key Infrastructure (PKI)Read More
Agentforce Field Service and Operations
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Prepare the Assets for a Voice-Enabled Scheduling Agent in the Legacy Agentforce Builder

          Prepare the Assets for a Voice-Enabled Scheduling Agent in the Legacy Agentforce Builder

          Create a flow, an agent action, and a subagent for your voice-enabled scheduling agent.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Performance, Unlimited, and Developer Editions with Field Service and Foundations, or Einstein 1 Field Service Edition or Agentforce 1 Field Service Edition.

          Create the Flow

          Create a flow that identifies the caller automatically by their phone number instead of asking them to provide an email or username.

          Create an Autolaunched Flow that performs the following:

          • Identifies a caller according to their phone number
          • Finds their contact record
          • Generates a 6-digit verification code
          • Sends the code to the contact’s email address
          • Returns the verification code that the caller gives

          Variables

          API Name Details
          authenticationKey

          Data Type: Text

          Available for output

          customerEmail

          Data Type: Text

          Available for output

          customerId

          Data Type: Text

          Available for output

          customerIdType

          Data Type: Text

          Available for output

          incomingPhoneNumber

          Data Type: Text

          Available for input

          verificationCode

          Data Type: Text

          Available for output

          verificationMessage

          Data Type: Text

          Available for output

          Constants

          API Name Details
          codeNotSentMessage

          Data Type: Text

          Value: I’m having trouble sending you a verification code. Please call our contact center directly. Have a nice day.

          codeSentMessage

          Data Type: Text

          Value: I’ve sent you an email with a verification code. Please check your email and read the code back to me so we can get started.

          customerType

          Data Type: Text

          Value: Contact

          Elements

          Tip
          Tip Save the flow before proceeding to create the elements. Enter a name that will be easy to identify later on, such as Send Verification Code for Voice. Continue to save the flow as you proceed so that you don’t lose your changes.
          Flow Element Configuration
          Start > + Decision

          Label: Is Phone Provided?

          Outcome Label: Yes

          Filter: All Conditions Are Met (AND)

          Resource: incomingPhoneNumber, Operator: Is Null, Value: False

          Resource: incomingPhoneNumber, Operator: Does Not Equal, Value: Blank Value (Empty String)

          Default Outcome Label: No (Default)

          No > + Assignment

          Label: Assign Message for No Phone Number

          Variable: verificationCode, Operator: Equals, Value: codeNotSentMessage

          Assignment > + End N/A
          Yes > + Get Records

          Label: Get Contact By Phone Number

          Salesforce Object: Contact

          Filter: All Conditions Are Met (AND)

          Field: Mobile Phone, Operator: Equals, Value: incomingPhoneNumber

          + Decision

          Label: Has Contact?

          Outcome Label: Yes

          Filter: All Conditions Are Met (AND)

          Resource: Contact from Get Contact By Phone Number > Contact ID, Operator: Is Null, Value: False

          Default Outcome Label: No (Default)

          No > + Assignment

          Label: Assign Message for No Contact

          Variable: verificationCode, Operator: Equals, Value: codeNotSentMessage

          Assignment > + End N/A
          Yes > + Assignment

          Label: Assign Contact Values

          Variable: customerId, Operator: Equals, Value: Contact from Get Contact By Phone Number > Contact ID

          Variable: customerType, Operator: Equals, Value: customerType

          Variable: customerEmail, Operator: Equals, Value: Contact from Get Contact By Phone Number > Email

          + Decision

          Label: Has Email Address?

          Outcome Label: Yes

          Filter: All Conditions Are Met (AND)

          Resource: customerEmail, Operator: Is Null, Value: False

          Default Outcome Label: No (Default)

          No > + Assignment

          Label: Assign Message for No Email Address

          Variable: verificationCode, Operator: Equals, Value: codeNotSentMessage

          Assignment > + End N/A
          Yes > + Action

          Action: Generate verification code

          Label: Generate Verification Code

          + Action

          Action: Send Email

          Label: Email Verification Code

          Recipient Addresses: customerEmail

          SenderType: OrgWideEmailAddress

          SenderEmailAddress: Enter the email address from which the email is sent

          Subject: Your Verification Code

          Body:

          Enter this message: To verify your email address, read out this verification code to the agent:

          Insert this resource at the end of the message: Outputs from Generate Verification Code > The six digit generated verification code

          Assignment

          Label: Assign Verification Code

          Variable: verificationCode, Operator: Equals, Value: Outputs from Generate Verification Code > The six digit generated verification code

          Variable: authenticationKey, Operator: Equals, Value: Outputs from Generate Verification Code > Authentication Key

          When you’ve completed the flow, save and activate it. Your flow should look like this.

          Autolaunched Flow that identifies a caller by phone number, finds their Contact record, generates a verification code, and emails it to the contact

          Create the Agent Action

          Create the agent action and assign the referenced flow to it.

          1. In Setup, find and select Agentforce Assets.
          2. From the Actions tab, click New Agent Action.
          3. For Reference Action Type, select Flow.
          4. For Reference Action, select the flow that you created. By default, the action gets the name of the flow — Send Verification Code for Voice.
          5. For Agent Action Description, enter: Sends a generated verification code to the existing user’s email address, taken from the contact record that’s associated with the phone number retrieved from the incoming call.
          6. For Loading Text, enter Default.
          7. For the input, don’t mark it as required and enter this description: Stores the customer’s phone number. This input initiates the verification process.
          8. For the outputs, don’t select Show in conversation and enter these descriptions:
            • authenticationKey: The authentication key that’s used to generate the verification code.
            • customerEmail: The email address retrieved from the Contact record.
            • customerId: The Salesforce user ID or contact ID.
            • customerIdType: The type of ID used in customerId. Can either be userId or contactId.
            • verificationCode: The generated verification code.
            • verificationMessage: A generic message that’s given to the user.
          9. Click Finish.

          Create the Subagent

          Enter the required details for the subagent and the relevant agent actions.

          1. In Setup, find and select Agentforce Assets.
          2. From the Subagents tab, click New Subagent.
          3. Enter a name, for example Customer Verification for Voice.
          4. For Classification Description, enter: Verifies the customer’s identity before scheduling a repair, scheduling maintenance, scheduling an installation, or granting access to sensitive data, service appointments, appointment booking, or providing any service to a customer. Sensitive data includes confidential, private, or security-protected information, such as business-critical data, personally identifiable information (PII). After verification is successful, don’t repeat the process within the same session.
          5. For Scope, enter: Your job is to authenticate the customer who has not yet been authenticated before granting access to any sensitive data, scheduling appointments, booking appointments, or providing any customer service (Vacuum cleaning, TV fix, etc.). You will verify the customer using their phone number only. Never ask for an email address or username. After verification is successful, don’t repeat the process within the same session.
          6. Enter these instructions:

            Instruction 1: The very first action you MUST take when this subagent is activated — before saying anything to the customer is to invoke the "Send Verification Code for Voice" action without asking the customer for any information. Use the "incomingPhoneNumber" value from the conversation as input. This is mandatory and must happen every single time, with no exceptions. Do not greet the customer, do not ask any questions, and do not wait — invoke the action immediately and silently first.

            Instruction 2: After invoking the action, say the exact value of the "verificationMessage" field returned by the action to the customer. Do not add, change, or interpret the message in any way. Do not mention phone, SMS, or text message — the code is sent by email only. Only say what the "verificationMessage" output returns, word for word.

            Instruction 3: If the customer enters the wrong verification code three times, automatically invoke the "Send Verification Code for Voice" action again using the same phone number (incomingPhoneNumber) to send a new code. Do not ask for an email address or username under any circumstances — always use the phone number only.

            Instruction 4: Never process any request for accessing or updating sensitive data without first completing this verification flow. If the customer is not yet verified, always invoke the "Send Verification Code for Voice" action before proceeding.

            Instruction 5: Never reveal the verification code or any internal system values to the customer. Keep all verification details confidential.

            Instruction 6: After the user is verified in a conversation session, switching to a different user is not allowed under any circumstances.

            Instruction 7: If verification is successful, immediately proceed with the action the user originally intended to perform — do not ask them to repeat their request if it was already stated.

          7. Click Next.
          8. Add these actions to the subagent:
            • Send Verification Code for Voice (the action that you created)
            • Verify Customer for Field Service (standard action)
          9. Click Finish.
           
          Loading
          Salesforce Help | Article