Prerequisites
Create Agent Actions
Use OpenAPI Extensions to Create Agent Actions
Limits
Create Actions from Named Queries
Create Custom Actions Using Apex InvocableMethod
Provide Global Copy to Action Responses
Cite Agent Responses with Apex
Add optional OpenAPI extensions to your OpenAPI document to automatically create agent actions when you deploy.
To validate and test documents to make sure that they work with your AuraEnabled Apex controller methods, make sure that the MuleSoft for Agentforce API Design Extension in the MuleSoft for Agentforce Extension Pack (beta) is installed.
| Extension | Description |
|---|---|
x-sfdc/agent/action/publishAsAgentAction | Required. Set this attribute to true to enable the operation as an action. |
x-sfdc/privacy/isPii | Optional. If publishAsAgentAction is enabled, set this attribute to true to enable PII service for queries sent under that operation. |
x-sfdc/agent/action/isUserInput | Required if publishAsAgentAction is enabled. Set this attribute to true to surface the field to the user for further input. |
x-sfdc/agent/action/isDisplayable | Required if publishAsAgentAction is enabled. Set this attribute to true for the field to be displayable to the user. |
These OpenAPI extensions are boolean fields you can add to a resource path in your OpenAPI document. For example:
1...
2paths:
3 /AccountController/createAccount:
4 description: Default description for the path.
5 post:
6 description: Default description for the operation.
7 operationId: createAccount
8 x-sfdc:
9 agent:
10 action:
11 publishedAsAgentAction: true
12 requestBody:
13 description: Default description for the requestBody.
14 required: false
15 content:
16 application/json:
17 schema:
18 type: object
19 properties:
20 accountName:
21 type: string
22 responses:
23 "200":
24 description: Status Code 200
25 content:
26 application/json:
27 schema:
28 type: string
29...If you add the OpenAPI extensions, confirm that the agent actions based on the deployed API are available in your org.
Agentforce Assets and select it.