AiAgentDefinition

Represents the definition of an Agentforce agent, including its type, context variables, and conversation settings.

Parent Type

This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

AiAgentDefinition components have the suffix .AiAgentDefinition and are stored in a subfolder for the agent in the AiAgentDefinition folder.

Version

AiAgentDefinition components are available in API version 68.0 and later.

Special Access Rules

AiAgentDefinition is available only if Agents is enabled in your org.

Fields

Field Name Description
agentDescription
Field Type
string
Description
A description of the agent.
agentDSLEnabled
Field Type
boolean
Description
Indicates whether the agent is defined using Agent Script (true) or not (false).
agentType
Field Type
GenAiAgentType (enumeration of type string)
Description
The type of agent. Valid values are:
  • AgentforceEmployeeAgent
  • Analytics
  • AppDevAgent
  • BankingServiceAgent
  • BuyerAgent
  • CustomAgent
  • EinsteinSDR
  • EinsteinServiceAgent
  • Employee
  • ExperienceBuilder
  • FieldServiceAgent
  • GoalBasedAgent
  • GuidedShoppingAgent
  • LightningAppBuilder
  • ProspectingAgent
  • SalesCanvasAgent
  • SalesDealAgent
  • SalesEinsteinCoach
  • ScaleAgent
  • ServicePlanner
  • Setup
  • ShopperAgent
  • ThirdPartyA2AAgent
botUser
Field Type
string
Description
The username of the integration user that the agent runs as.
contextVariables
Field Type
ConversationContextVariable[]
Description
The context variables that store data available to the agent during a conversation.
logPrivateConversationData
Field Type
boolean
Description
Indicates whether private conversation data is logged (true) or not (false).
richContentEnabled
Field Type
boolean
Description
Indicates whether the agent supports rich content in its responses (true) or not (false).
type
Field Type
BotType (enumeration of type string)
Description
The type of bot. Valid values are:
  • AgentforceOrchestrator
  • Bot
  • ExternalCopilot
  • InternalCopilot

ConversationContextVariable

Represents the context variable that stores data available to the agent during a conversation.

Field Name Description
contextVariableMappings
Field Type
ConversationContextVariableMapping[]
Description
The mappings that associate the context variable with a source field.
dataType
Field Type
ConversationDataType (enumeration of type string)
Description

Required.

Valid values are:
  • Boolean
  • Currency
  • Date
  • DateTime
  • Id (available in API 45.0 and later.)
  • Object
  • Number
  • Text
description
Field Type
string
Description
A description of this context variable. This value may be used by the Agentforce planner service.
developerName
Field Type
string
Description

Required.

This name can contain only underscores and alphanumeric characters and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. Only users with View DeveloperName OR View Setup and Configuration permission can view, group, sort, and filter this field.
includeInPrompt
Field Type
boolean
Description
Indicates whether the context variable is injected into the prompt sent to the Agentforce model (true) or not (false).
label
Field Type
string
Description

Required.

Label that identifies a context variable throughout the Salesforce user interface.
SObjectType
Field Type
string
Description
Specifies the SObjectType of the ID stored in the context variable.

ConversationContextVariableMapping

Represents the variable that associates the context variable with a source field.

Field Name Description
fieldName
Field Type
string
Description

Required.

The name of the field mapped to the context variable.
messageType
Field Type
MessageType (enumeration of type string)
Description

Required.

The type of message that the mapping applies to. Valid values are:
  • Alexa
  • AppleBusinessChat
  • Custom
  • Email
  • EmbeddedMessaging
  • ExternalVoice
  • Facebook
  • GoogleChat
  • GoogleHome
  • InternalCopilot
  • Line
  • MsCopilot
  • Omega
  • Phone
  • PstnVoice
  • Rcs
  • SipVoice
  • Slack
  • Text
  • Voice
  • VoiceIntegrationPilot
  • WebChat
  • WebVoice
  • WeChat
  • WhatsApp
  • WhatsAppVoice
SObjectType
Field Type
string
Description

Required.

Specifies the SObjectType of the ID used in the context variable mapping.