Loading
Prepare for Email to Become the Default Login ExperienceRead More
AI Sales Agents
Assign Prospects to an Engagement Agent with a Flow

Assign Prospects to an Engagement Agent with a Flow

Agentforce Engagement includes an invocable action called Assign Target to SDR. With invocable actions, you can perform complex tasks in Salesforce just by calling the action. To assign prospects to an Engagement agent automatically, you can create a flow that calls this invocable action.

Required Editions

Available in: Lightning Experience in Enterprise, Performance, and Unlimited editions with Sales and Einstein for Sales.
User Permissions Needed
To create a flow: Manage Flows

Use Flow Builder to create your flow and call the Assign Target to SDR action from an Action element in the flow. Build a flow that assigns the prospects you want to an agent under the conditions you select.

When you call the invocable action, you include an agent ID and a list of prospect record IDs you want to assign to the agent. The action assigns the prospects and returns a list of the assignment successes and failures.

The action performs these steps:

  • Confirms that the agent specified in the action call exists.
  • Checks that the prospects meet the requirements for assignment to an Engagement agent.
    • The list includes no more than 200 prospect records.
    • The prospect record owners have the Use Engagement Agent or Configure Engagement Agent permission.
    • The record owners have email and Inbox permissions.
    • Checks for duplicate targets in the list and targets already assigned to an Engagement agent.
  • Assigns the prospects to the agent, which includes adding them to the agent’s Sales Engagement cadence. The agent uses this cadence to orchestrate its email outreach and responses to prospects. The action assigns these cadence targets to the agent, or if the agent has Send as Seller turned on, to the prospect record owner.

To use the Assign Target to SDR action, you need:

  • Agentforce Engagement turned on.
  • The Salesforce user calling the action has one of these two permissions:
    • Use Engagement Agent, plus ownership of the lead, contact, or person account.
    • Configure Engagement Agent, plus read access to the lead, contact, or person account.

Invocable Action Reference

  • Label: Assign Target to SDR
  • API name: assignTargetToSdr
  • Category: Agentforce SDR
  • Description: Assigns a lead, contact, or person account record to an Engagement agent for email outreach.
  • Support for partial failures: Yes. If you assign a list of targets and any fail validation, the system still assigns the other targets to the agent.
  • Bulk limit: 200 targets per action call.

Input Parameters

  • Target ID (targetId)—required. The ID of the contact, lead, or person account to assign. Person account IDs are converted automatically to their underlying contact record ID.
  • Bot Definition ID (botDefinitionId)—required. The ID of the specific SDR bot definition (agent) to assign the target to.

Output Parameters

  • Error (errorMessage). The error returned when an assignment fails. This field is empty for each prospect successfully assigned. In Flow Builder, map this output field to a variable so you can branch your flow if failures occur. In Apex, check the standard isSuccess() or getErrors() result of the invocable action call.

To add the invocable action to a flow:

  1. In Flow Builder, click the plus icon where you want the action to run, and select Action from the Add to Flow menu, in the Interaction category. You can use the action in all types of flows.Adding an action to a flow.
  2. In the Action field, search for and select Assign Target to SDR. Remember not to select the similarly named Assign Target to Cadence action.Choosing the Assign Target to SDR action.
  3. Set the input values: Target ID (required) and Bot Definition ID. Optionally, store the error output in a flow variable so you can handle any failures explicitly.Setting the input values for the flow.
  4. Save and activate the flow.

Limits and Best Practices

  • Include up to 200 targets per call. Divide larger lists across multiple invocations.
  • Avoid failures by ensuring each action call includes no duplicate target IDs.
  • Always check the Error output (isSuccess() or getErrors() in Apex). Because the action doesn’t roll back upon errors, some records in a list can succeed while others fail.
 
Loading
Salesforce Help | Article