Agent Customization with Flows | 用 Flow 定制 Agent(练习操作步骤)

《Agent Customization with Flows | 用 Flow 定制 Agent》的分步练习操作指南。...

📅 2026/10/2 ✍️ ponybai 🏷️ agentforce, salesforce, ai

本文是《Agent Customization with Flows | 用 Flow 定制 Agent》的练习操作步骤。阅读原文请见:Agent Customization with Flows | 用 Flow 定制 Agent。

1. Sign Up for a Developer Edition Org

  1. Sign up for the free [Developer Edition org with Agentforce](https://trailhead.salesforce.com/promo/orgs/agent-customization-with-agentforce-flows).
  2. Fill out the form, click Sign me up, open the activation email, and click Verify Account.
  3. Connect the org to Trailhead: Connect Org, sign in, Allow, then Yes! Save it.

2. Create the Flow and Its Variables

  1. Create an Autolaunched Flow (No Trigger).
  2. Create three resources (Toolbox → New Resource):
    • Variable Contact_ID (Text, Available for input; Description about the Contact record).
    • Variable Contact_Bookings (Record, Allow multiple values (collection), Object Booking, Available for output).
    • Variable Error_Message_Output (Text, Available for output).

3. Get the Customer's Bookings

  1. Add a Get Records element: Label Get Contact's Upcoming Bookings, Object Booking, Condition Requirements All Conditions Are Met (AND).
  2. Conditions: Field Contact Equals Contact_ID; Field Date Greater Than Running Flow Interview > CurrentDate; Field Is Canceled Equals False.
  3. Sort Order Ascending, Sort By Date__c, How Many Records All records.
  4. How to Store Record Data: Choose fields and assign variables (advanced), Record Collection Contact_Bookings.
  5. Add fields Experience_Name__c, Date__c, Start_Time__c, and End_Time__c.

4. Add Error Handling

  1. On the Get Contact's Upcoming Bookings element, add a Fault Path.
  2. Add an Assignment element: Label Set the Error Message Output, Variable Error_Message_Output, Operator Equals, Value I'm sorry, I'm having a problem finding your booked activities. Would you like to speak to our support team?
  3. Set Flow Label Get Contact's Upcoming Bookings, add a Description, then Activate.

5. Set Up Agentforce and Add a Subagent

  1. In Setup, search for and select Einstein Setup, ensure Einstein is On (toggle Off/On if needed), then refresh.
  2. Search for and select Agentforce Agents and ensure Agentforce is On.
  3. Open the App Launcher → Agentforce Studio → Coral Cloud Booking Agent.
  4. Click New Subagent: Name Booked Activity Management, Description about the Bookings/Contacts objects, then Create and Open.

6. Add Flows as Agent Actions

  1. Add the Get Customer Details action (Reference Action Type Flow, Reference Action Get Customer Details):
    • email and memberNumber: Require input to execute action; contact: Show in conversation.
  2. Add the Get Contact's Upcoming Bookings action (Reference Action Type Flow):
    • Contact_ID: Require input to execute action; Contact_Bookings and Error_Message_Output: Show in conversation.
  3. Verify email, memberNumber, and Contact_ID are set to Agent Populated.

7. Update the Contact_Bookings Output (Script)

  1. Open the Get Contact's Upcoming Bookings action and switch to Script view.
  2. Change Contact_Bookings: object to Contact_Bookings: list[object].
  3. Change complex_data_type_name: "lightning__listType" to complex_data_type_name: "lightning__recordInfoType".
  4. Click Save and switch back to Canvas.

8. Give Instructions to the Subagent

  1. Open Booked Activity Management and add these Reasoning Instructions:
    • Your job is only to help Coral Cloud Resort guests book activities, give them information about their existing booked activities, and cancel their booked activities. Do not use any Salesforce data that wasn't provided by an action's output. Do not show the customer any ID values.
    • If the customer asks what their current booked activities are, run the Get_Contact_s_Upcoming_Bookings action and then present the output to the customer. (reference the action with @).
    • After showing the customer a list of their activities, ask them how you can help them.
    • If the customer is not known, you must always ask for their email address and their membership number to get their Contact record by running the Get_Customer_Details action before running any other actions. (reference with @).
  2. Save the agent.

9. Test the Agent

  1. Click Preview.
  2. Enter Can you show me my booked activities? and press Enter.
  3. Enter I am sofiarodriguez@example.com and my membership number is 10008155 and press Enter.
  4. Confirm the agent lists Sofia's upcoming, non-canceled bookings.