You are here:
Use Your Own Data Vendor with Prospecting Agent
Modify the existing Prospecting Agent topics with Apex class or autolaunched flow logic to connect to your own data provider.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Performance, Unlimited, and Developer Editions with the Agentforce for Sales or Agentforce for an Industry add-on, or in Agentforce 1 Sales and Industry Editions where included. Requires each user to have the Agentforce for Sales or Agentforce for an Industry add-on to access actions. |
| User Permissions Needed | |
|---|---|
| To set up Agentforce Prospecting: | View Setup AND Modify All Data OR Customize Application |
| To create and configure prospecting agents: | Sales Agentic Prospecting Manager |
| To use ZoomInfo data: | ZoomInfo Prospecting Access |
Before you begin, Turn On Agentforce Prospecting and Build and Manage Prospecting Agents.
Prospecting Agent uses actions in the existing Account_Research and
Prospect_Finder topics to qualify accounts, find potential prospects, validate
prospects against your ideal customer profile, and enrich prospect details. To use a data vendor
other than the standard provider, create an Apex class with an @InvocableMethod
or an autolaunched flow for each action. Then update the existing topic action references to
point to those implementations. Keep the same inputs, outputs, and JSON response shapes as the
standard actions.
This change is backward compatible and doesn’t affect existing agents. It gives customers the flexibility to customize agent actions so they can run with their own data vendor.
-
Create a source ID format for prospects from your data provider.
Use the format
prefix__id, such asmyvendor__001. The prefix is 1–100 characters, contains only letters and underscores, and can't start or end with an underscore. Don't usesalesforceorzoominfoas the prefix. Use the same custom source ID throughout all four actions. Prospecting Agent uses this ID to pass a prospect from discovery to validation and enrichment. -
Create an Apex class with an @InvocableMethod or an autolaunched flow for each agent action. Include all of
the necessary fields.
Note- Use the same custom source ID throughout all four actions. Prospecting Agent uses this ID to pass a prospect from discovery to validation and enrichment.
- For each Apex class, if a prospect isn't found or the vendor service is unavailable,
return an empty result and include the reason in
errorMessageoroutputErrorMessage.
-
Create an Apex class with an
@InvocableMethodor an autolaunched flow forQualifyAccountaction. This action decides whether an account is worth prospecting. Include these fields.Field Type Fields Required inputs accountId,accountSource,qualificationCriteriaOptional inputs researchSummaries,zoominfoAccountAttributes,niceToHaveCriteria,signalSummariesOutputs isQualified,accountPov,errorMessage,responseJsonReturn
responseJsonin this shape.{ "isQualified": true, "accountPov": "...", "errorMessage": "..." } -
Create an Apex class with an
@InvocableMethodor an autolaunched flow for theFindPotentialProspectsaction. This action returns candidate prospect IDs from your data provider. Include these fields.Field Type Fields Required inputs accountId,accountSource,icpCriteriaOptional inputs maxProspects,agentSpecId,runIdOutputs potentialProspects,outputErrorMessage,responseJsonReturn each prospect ID in the
prefix__idformat.{ "potentialProspects": ["myvendor__001", ...]} -
Create an Apex class with an
@InvocableMethodor an autolaunched flow for theValidateProspectsaction. This action validates one prospect against your ideal customer profile criteria. Echo theprospectIdvalue exactly as the action received it. Include these fields.Field Type Fields Required inputs prospectToValidate,icpCriteriaOutputs validationResults,responseJsonReturn
validationResultsin this shape:{ "validationResults": [ { "prospectId": "Salesforce__003XX000000ABC", "isValid": false, "summary": "Bad fit: Engineer below Senior level matches the bad-fit criterion 'Engineers below Senior level'" } ] }Return
responseJsonin this shape:{"validationResults":[{"prospectId":"Salesforce__003XX000000ABC","isValid":true,"summary":""}]} -
Create an Apex class with an
@InvocableMethodor an autolaunched flow for theGetProspectAttributesaction. This action enriches one valid prospect with details from your data provider. Include these fields.Field Type Fields Required input prospectIdOutputs firstName,lastName,jobTitle,emailAddress,companyName,companyId,phoneNumber,responseJson,outputErrorMessageThe
responseJsonfield names differ from the flat outputs. Usetitleinstead ofjobTitle,emailinstead ofemailAddress, and a nestedcompany.Return
responseJsonin this shape:" { "firstName":"Jane", "lastName":"Doe", "title":"VP of Finance", "email":"jane@acme.com", "phone": "1234", "company": { "name":"Acme Inc.", "id":"acme-co-123" } } "
-
Create custom agent actions from the Apex class or autolaunched flow. These new agent
actions replace the standard agent actions currently referenced by the agent. Keep the action
descriptions, input names, output names, and output types the same as the standard actions.
Wrong names lead to dropped fields. Actions to create:
QualifyAccountFindPotentialProspectsValidateProspectsGetProspectAttributes
-
In the Prospecting Agent, replace the standard actions referenced by the agent with the new
custom agent actions you created.
-
In
ProspectingAgent.agent, modify theAccount_Researchtopic to use yourQualifyAccountimplementation. -
Modify the
Prospect_Findertopic to use yourFindPotentialProspects,ValidateProspects, andGetProspectAttributesimplementations. -
Keep the
Prospect_Finderinstruction that callsGetProspectAttributeswith the same source ID after a validValidateProspectsresult. That instruction also merges theGetProspectAttributesresponseJson value under a prospect key.
-
In
- Preview the agent with an account that has known prospects in your data provider. Verify that the agent qualifies the account, returns prospects with your custom source ID prefix, validates the prospects, and shows the enriched prospect details.

