GenAiFunction defines an agent action that can be added to an AI agent. It describes the action's purpose, what it invokes, whether confirmation is required, and its input and output contract. The type is available only when Agents is enabled in the org.
Use GenAiFunction to retrieve actions in the asset library. Actions created within a particular agent are retrieved through GenAiPlannerBundle. An action can therefore appear in Agent Builder without being returned by a GenAiFunction retrieve.
Key Elements
| Element | What the Element Controls |
|---|---|
masterLabel |
Required display label for the action. The label alone does not identify the implementation that runs. |
description |
Explains the action's general purpose and domain. |
invocationTarget |
Required target to invoke. Interpret it together with invocationTargetType. |
invocationTargetType |
Required invocation mechanism. Values include apex, flow, generatePromptResponse, externalService, retriever, and mcpTool. |
pluginField |
Identifies the action's parent topic, rather than describing the action's purpose. |
isConfirmationRequired |
Indicates whether the action requires confirmation. |
isIncludeInProgressIndicator, progressIndicatorMessage
|
Control whether progress is displayed for the action and the progress message. These settings do not control confirmation. |
mappingAttributes |
Contains embedded GenAiPlannerAttr entries connecting planner attributes with parameters. Each entry requires label, name, parameterName, and parameterType. The allowed parameterType values are input and output. |
required |
In the input schema, lists the parameter properties that must be supplied. This is separate from whether a property is presented as user input. |
copilotAction:isUserInput |
Indicates whether an input property is presented as user input. It does not replace the input schema's required list. |
copilotAction:isDisplayable |
Indicates whether an output property is displayable. It does not determine whether the planner uses that property. |
copilotAction:isUsedByPlanner |
Indicates whether the agent planner uses an output property. At least one output property must be true; otherwise, the planner returns random responses. |
lightning:isPII |
Marks whether an input or output property contains personally identifiable information. It is a sensitivity annotation, not an access-control or masking setting. |
lightning:type |
Required at the schema root and on each property. Both input and output roots use lightning__objectType. Property values describe the parameter's data type. |
properties, title
|
properties contains parameter definitions keyed by parameter API values, not display labels. Each property requires a title and lightning:type. |
Behavior and Constraints
invocationTarget and invocationTargetType form a pair: the type selects the invocation mechanism, and the target identifies what that mechanism invokes. A change to the backing implementation can change action behavior even when masterLabel remains unchanged.
Keep the action's purpose, topic context, confirmation, and progress presentation separate. description explains what the action does; pluginField identifies its parent topic. isConfirmationRequired controls confirmation, while isIncludeInProgressIndicator and progressIndicatorMessage control progress presentation.
Input and output schemas
A component can contain separate input/schema.json and output/schema.json files. Together, these files define the parameters the action accepts and returns. Schema changes can alter required inputs, user interaction, displayed results, and the information available to the planner without changing the main action definition.
-
Required input and user input are different. The input schema's
requiredarray names properties that must be supplied.copilotAction:isUserInputseparately determines whether a property is presented as user input. -
Displayed output and planner output are different.
copilotAction:isDisplayablecontrols displayability.copilotAction:isUsedByPlannercontrols planner use. Do not treat either flag as a substitute for the other. -
The planner needs at least one output property. Set
copilotAction:isUsedByPlannertotrueon at least one output property. Without one, the planner returns random responses. -
Property keys must match parameter API values. A property's
titlesupplies its label; the key underpropertiesidentifies the input or output parameter.
Both schema roots use lightning:type set to lightning__objectType. A nested property with that type must also contain its own properties object.
Property types have constraints that can explain mismatches with the backing implementation. lightning__textType has a maximum length of 250 characters. For lightning__dateTimeType, the documented dateTime string format is yyyy-MM-dd'T'HH:mm:ss.SSSZ; an optional time zone uses IANA time zone database notation.
lightning:isPII records whether a property contains personally identifiable information. It does not establish permission enforcement, masking, or regulatory compliance. Actual sensitivity also depends on the values supplied to or returned by the action.
Deployment and Retrieval
GenAiFunction components use the .genAiFunction suffix and are stored in the genAiFunctions folder. A component can also contain input and output folders holding their respective schema.json files. The type inherits the metadata identity field fullName.
The type supports the * wildcard in package.xml. Use a manifest entry with type name GenAiFunction to retrieve library actions. A wildcard does not change the distinction between library actions and actions created within an agent.
For agent-local actions, retrieve the containing GenAiPlannerBundle. If an action is visible in Agent Builder but a GenAiFunction retrieve returns nothing, check whether the action belongs to that agent's bundle.
For change sets, distinguish a library action from a duplicate standalone entry for an agent-local action already included in a planner bundle. A reported internal server error was resolved by removing that duplicate entry, not by removing all library actions deployed alongside the bundle.
Relationships
invocationTarget and invocationTargetType connect the action definition to its backing implementation. pluginField supplies the parent-topic context. These settings describe different relationships and should not be inferred from the action label.
GenAiPlannerBundle is the retrieval container for actions created within a particular agent. Within GenAiFunction, mappingAttributes contains embedded GenAiPlannerAttr entries; these are not separate action components. Their parameterName and parameterType fields connect planner attributes with input or output parameters.
Do not confuse those entries with the GenAiPlannerAttrMapping structure used for attribute mappings inside a planner bundle. A reported namespace requirement for that structure does not establish the same requirement for GenAiFunction.mappingAttributes.
Reported Issues
-
A duplicate agent-local action can cause a change-set internal server error. In November 2025, a deployment included the same local action both as a standalone
GenAiFunctionentry and insideGenAiPlannerBundle. Removing the duplicate standalone entry reportedly resolved the failure. This is not a general prohibition on deploying library actions alongside a planner bundle. Duplicate action deployment report. -
A planner-bundle mapping error can be associated with namespace qualification. In March 2026, a report connected the error "Link between plugin and function should exist" with the
attributeNameinGenAiPlannerAttrMappingwhen actions exchanged custom variables. Adding the namespace reportedly cleared the error, but the reporter still observed missing mappings after CLI deployment. This concerns parent-bundle mappings, not a general rule forGenAiFunction.mappingAttributes. Namespace and mapping deployment report. - Action descriptions can originate in Invocable Apex at creation time. A February 2025 report stated that descriptions from Invocable Apex, including input and output descriptions, are carried into an action when it is created. The report does not establish automatic synchronization after later Apex edits. Action description copying report.
-
Retrieving the planner bundle can resolve missing-action retrieval. In March 2026, a user reported no components returned when adding
GenAiFunctionto a manifest. A respondent reported success retrieving and deploying the agent, topics, and actions throughGenAiPlannerBundle. This matches the distinction between agent-local actions and library actions. Planner bundle retrieval report.
Common Questions
Why does GenAiFunction retrieve no actions when I can see them in Agent Builder?
GenAiFunction retrieves actions in the asset library. Actions created within a particular agent are retrieved through GenAiPlannerBundle, so their presence in Agent Builder does not mean they are standalone library actions.
Why does the planner return random responses after an action runs?
Check the output schema. At least one output property must have copilotAction:isUsedByPlanner set to true. Making a property displayable with copilotAction:isDisplayable does not satisfy that requirement.
Does copilotAction:isUserInput make an action input required?
No. It controls whether the property is presented as user input. The input schema's required array separately lists properties that must be supplied.
Can the same action appear in GenAiFunction and GenAiPlannerBundle in a change set?
A reported failure occurred when the same agent-local action was included separately and inside its planner bundle. Removing the duplicate standalone entry resolved it. That report does not prohibit deploying a distinct library action alongside a planner bundle.
Do changes to Invocable Apex descriptions automatically update an action?
The reported behavior is copying descriptions when the action is created, including input and output descriptions. Automatic synchronization after later Apex edits is not established by that report.